Difference between revisions of "Scripting Tutorial: Summoned Creatures"

m
added internal links, and standardized formatting
imported>Gdarknight
imported>Qazaaq
m (added internal links, and standardized formatting)
==CUSTOM SUMMONED CREATURES==
[[Category: Tutorials]]
[[Category: Scripting Tutorials]]
 
__TOC__
 
This tutorial will help you set up a custom Summon Creature spell using the Script Effect system. This is a complete tutorial starting at the basics.
 
This will not change any game play settings or magic effects.
 
===What you will do===
This tutorial will show you how to:
* Create a simple holding cell
* Create a new spell with the scripted "summon" effect
 
===Step 1: Create a holding cell for your creatures.===
* Open the '''[[:Category:Cells|World-> Cells''']] menu and make sure the drop-down menu is set on [[Interior cells|Interiors]]. ▼
<hr>
* Right-click on a cell name and select '''New'''. Make sure your idID is something unique you can remember.▼
<p>
▲* Open the '''World-> Cells''' menu and make sure the drop-down menu is set on Interiors.
▲* Right-click on a cell name and select '''New'''. Make sure your id is something unique you can remember.
* Click Ok when done, and Ok again to close the menu.
* Double-click on your Interior under the '''Cell View''' listing. You will now drag in an anchor reference to move the creature back to the cell.
* In the '''[[Object Window]],''' expand''' World Objects -> Static, ''', and click on Architecture.
* Drag an interior such as “'''''AnvilHouseMCInterior01'''''” into the render[[Render viewWindow]].
* Right-click on the architecture object in the '''[[Cell View''' Window]] listing, and select '''Edit.'''.
* Enter a name for the reference such as “'''''CreatureCageREF'''''”, select “'''Persistent Reference'''” and click '''Ok'''.
 
===Step 2: Choose an AI follow package.===
There is a default “'''''FollowPlayer'''''” [[Glossary#A|AI package]], but it does not allow for swimming, falls, etc. You can use the steps below to create a custom package, or skip to Step 3.▼
</p><p>
<hr>
▲There is a default “'''''FollowPlayer'''''” package, but it does not allow for swimming, falls, etc. You can use the steps below to create a custom package, or skip to Step 3.
 
* Open the '''[[:Category:Packages|Characters->Packages''']] menu.
* Right-click on a space and select '''New'''.
 
<div class="thumbinner" style="width:"100%" align="center">
''[[Image:Packages01.jpg|624px|Packages01.jpg]]''
 
</div>
* Enter a unique name for you package that you can remember.
* Select “'''Must Complete'''” and “'''Defensive Combat'''” at a minimum; “'''Allow Swimming'''” and “'''Allow Falls'''” are optional. The other options are more for [[Glossary#N|NPC’s]] than creatures.
* Change the '''Package Type ''' drop-down to “Follow”.
* Click on the '''Target''' tab and select “Specific Reference”.
* Choose the Cell “'''''AbandonedMine02'''''” and the Ref “'''''Player PlayerRef'''''”.
* Set the distance the creature can be from you: recommend 128.
 
<div class="thumbinner" style="width:"100%" align="center">
''[[Image:Packages02.jpg|624px|Packages02.jpg]]''
 
</div>
* Click '''OK''' when done.
 
===Step 3: The Critter!===
</p><p>
<hr>
You will now change a normal creature into your summon version. I recommend editing an existing creature to ensure proper animation and models. For this example, I picked a Rat.
 
* In the '''Object Window''', expand '''Actors->Creatures->Creatures'''. Scroll down to '''''CreatureRat''''' and double-click to open the properties window.
* Change the ID to “RatSummon01”, and the Name to “Summoned Rat”.
* Uncheck the “'''Respawn'''” box so we can control the resurrection from script.
* Click on the AI button to open the [[AI_Button|AI menu]].
 
<div class="thumbinner" style="width:"100%" align="center">
''[[Image:AIMenu01.jpg|568px|AIMenu01.jpg]]''
 
</div>
* Set the “'''Aggression'''” to zero and delete any existing packages by selecting them in the list and pressing delete.
* Open the '''Character->Packages''' menu and drag either the “'''''FollowPlayer'''''” package, or a custom one made in step 2 into the AI menu.
* Click '''Save''' to close the menu. You can also close the '''Packages''' menu.
* Select the “'''Factions'''” tab and delete any existing factions. Open the '''Character->Factions''' menu and drag over the “'''''PlayerFaction'''''”.
* Click '''Ok''' and answer “'''Yes'''” to create a new form.
* Drag your new creature into the Interior you created. Edit the creature reference just like the architecture piece and enter the namereference editor ID “'''''SummonRat1RESummonRat1REF'''''F””.
* Select “'''Persistent ReferencReference'''e”” and “'''Initially Disabled'''”. This ensures our creature is always available, but not moving around or running AI yet.
* Click '''Ok''' when done.
 
===Step 4: Creating the script effect.===
</p>
<hr>
<p>
This script uses the [[MoveTo]] command to perform the actual summoning of the creature to the player. The remaining code is for visual effects and placement of the creature back in the holding cell when done, or dead.
* Open the '''[[Edit Scripts|Gameplay->Edit Scripts''']] menu and click '''Scripts->New'''.
* Copy the script and paste into the editor window. Be sure to change the reference names if different from the tutorial (lines 13, 27, and 58).
 
<pre>
ScriptName SummonRatSCR
End
</pre>
 
* Change the script type to “Magic Effect” in the drop-down and change the name if desired.
* Click the “'''Disk'''” icon (Save) when done, and exit the Script Editor.
 
===Step 5: The Spell!===
</p><p>
<hr>
Now we put it all together. The script will simulate the summon effect, while the “Follow” package will make the new creature follow and fight for you.
 
* In the '''Object Window''', expand '''Magic->Spells'''. Right-click on a spell name and select '''New'''.
* Give your spell a unique idID like “'''''SummonRatCast'''''”. Name the spell as desired, and select the type of spell (Spell, Lesser Power, or Power).
* Click on “'''Script Effect Always Applies'''” and deselect “'''Auto-Calculate'''”.
* Choose the minimum skill and set the cost if a Spell or LP.
* Right-click under “'''Effect Name'''” and select '''New'''.
* Select “'''Script Effect'''” under the Effect drop-down, and set the spelleffect's lengthduration to 30. (see the script notes on adjusting the spell length).
* Select your script from the script menu, and give the effect a name like “'''Summon Creature'''”.
* Finally, set the school to “'''Conjuration'''” and choose one of the default Summon spells for the Visual Effect.
* Click '''Ok''' twice when done to exit the spell editor.
 
===Step 6: Getting your spell into the world.=game==
</p><p>
<hr>
Adapted from [[Scripting Tutorial: My First Spell]].
 
====Find the Form ID====
Go to the top of the spell list and find the "Count" column. Directly to the left of this column, you should see a double column line instead of the usual single line. Click and drag the right line of these double lines to the right to expand the "[[FormID]]" column. Now, scroll down and find the spell you just added. Write down the number in the Form Id column. It should look something like "01000ED9". (but may not be exactly that).
====Save====▼
 
▲====Save====
This is important!
 
Choose File->Save from the menubar. If you were editing a new plugin, you will be prompted for a filename. Choose something memorable like "'''''Summon Rat Spell'''''".
 
====Testing====
Go ahead and start Oblivion up. When the launcher comes up, click on the "Data Files" button. Make sure that "Oblivion.esm" and the filename you chose earlier are the only entries checked. Click "OK"
 
Anonymous user