How do I make a summon spell?

Post » Tue Dec 22, 2009 2:49 am

All I want is to make a spell like the vanilla summoning spells that summons a creature and I've looked in the cs but can't figure out how to do it.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Tue Dec 22, 2009 4:05 pm

Game summons are coded into the game. With Bloodmoon, there are a couple slots you can use, but those could also be used by another mod, thus a conflict.

There are different scripting approaches to summons. I am in the process of figuring out all that myself right now. Someone should be able to give you some scripting help soon here. :)
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Tue Dec 22, 2009 4:03 am

A scripted approach is definitely the way you'll want to go to avoid conflicts (as redwoodtreesprite noted), but if you're new to scripting, it might be a bit tricky to get started. I suggest that if you're unfamiliar with scripting currently, then take a look at Morrowind Scripting for Dummies 9. It is an excellent resource for learning script basics. Perhaps someone else has some good example code to show you, too.


Good luck!
User avatar
Manny(BAKE)
 
Posts: 3407
Joined: Thu Oct 25, 2007 9:14 am

Post » Tue Dec 22, 2009 3:43 am

Scripting is the way to go. I found that once I had looked into it was relitivly easy to do.

I reconmend you take alook at the scripts in my scripted summoning mod: http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=6816

The scripts are reletivly simple :) - hope that helps.

=MA=
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Tue Dec 22, 2009 10:22 am

I did this many years ago, and yes, scripting this is the best method if you plan on releasing the mod.

Here was my approach:

1. Create a unique reference of the creature you wish to summon. Place this creature (in this case a BM_ice_troll) in your test cell (every mod should have one for testing stuff). Set the creatures AI to Fight: 30, and add a follow package with the player as the target.

2. Create a new spell. I did something simple like "fortify fatigue for 1 sec on self", and called it "Summon Troll". Do not auto-calc the value of the spell as it will not be balanced. Set the spell cost to a minimum of 130 (depending on the power of the summoned creature and spell duration). Just keep it balanced. :)

Next, add the spell to your vendors inventory.

3. Create your global script. This will run as soon as the game loads. This code will require the creation of a new global variable (short). To do this go to-> Gameplay-> Globals-> New-> [name your variable here] -> OK. Default values should be "Short and 0" if not, set to that value and type. Click OK. In this case my global var is AST_TrollEnabled.

Begin AST_MAIN_Summonif ( AST_TrollEnabled == 1 )     Returnendifif ( MenuMode == 1 )     returnendifif ( AST_TrollEnabled == 0 )     if ( Player-> GetSpellEffects, AST_Summon_Test == 1 )          PlaySound, "conjuration hit"          PlaceAtPc, ast_mountain_troll, 1, 128, 0          set AST_TrollEnabled to 1     endifendifend


Now, once that's compiled it will need to be added to the start scripts. Go to -> Gameplay-> Edit Start Scripts-> Add Script-> find your script, double-click to add, and then close the window.

Now you need a local script for the creature. This will remove the creature once the spell effect wears off the player:

Begin AST_MountainTrollShort AIStateif ( AST_TrollEnabled == 1 )     set AIState to 10endifif ( AIState == 10 )     if ( Player-> GetSpellEffects, ast_summon_test == 0 )          PlaySound, "conjuration hit"          PositionCell, 1540, -800, 91, 000, "clutter warehouse - everything must go!"          SetHealth 0          set AST_TrollEnabled to 0          set AIState to 0     endifendifend


Like I said, it's been many years and there may be a better and more efficient way of doing this.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Tue Dec 22, 2009 11:02 am




The scripts I use are very similar to this, just with a few more bells and whistles ( such as adding in special effects) but essentially its as stright forward as Miles posted.
User avatar
Soku Nyorah
 
Posts: 3413
Joined: Tue Oct 17, 2006 1:25 pm

Post » Tue Dec 22, 2009 12:58 am

Thanks so much y'all! That's just what I needed!
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm


Return to III - Morrowind