Difference between revisions of "Scripting Tutorial: Summoned Creatures"

no edit summary
imported>Darkness X
imported>Coolboys335
* Drag an interior such as “'''''AnvilHouseMCInterior01'''''” into the [[Render Window]].
* Right-click on the architecture object in the [[Cell View Window]] listing, and select '''Edit'''.
* Enter a name for the reference such as “'''''CreatureCageREF'''''”,Set the Location to (0,0,10), select “'''Persistent Reference'''” and click '''Ok'''.
 
==Step 2: Choose an AI follow package==
* 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(Not Required If NPC is Special). 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. Set the Location to (0,0,10). Edit the creature reference just like the architecture piece and enter the reference editor ID “'''''SummonRat1REF'''''”.
* Select “'''Persistent Reference'''” and “'''Initially Disabled'''”. This ensures our creature is always available, but not moving around or running AI yet.
* Click '''Ok''' when done.
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 1314, 2733, and 5874). These lines contain 3 numbers (0,0,10) which is the location of the reference, you can switch the reference location, but you must also switch the script location reference.
 
<pre>
 
* In the '''Object Window''', expand '''Magic->Spells'''. Right-click on a spell name and select '''New'''.
* Give your spell a unique ID like “'''''SummonRatCast'''''”. Name the spell as desired, and select the type of spell (Spell, Lesser Power, or Power).("spell" is Recommended)
* Click on “'''Script Effect Always Applies'''” and deselect “'''Auto-Calculate'''”.
* Choose the minimum skill and set the cost to 0 and the charge to 0 if a Spell or LP.
* Right-click under “'''Effect Name'''” and select '''New'''.
* Select “'''Script Effect'''” under the Effect drop-down, and set the effect's duration to 30 (see the script notes on adjusting the spell length).
Adapted from [[Scripting Tutorial: My First Spell]].
 
===FindSetting theSpell FormFor IDSale===
Go to the object window. Maximize Actors, NPC, and Breton. Select male. click on a name listed and type (ed) quickly. Right click on EdgarVautrine, click Edit. Select the tab called spelllist. Do Not Close, go to object window maximize spells. Look for the spell you created. Move it to the EdgarVautrine spelllist. Click ok.
 
===Find the Form ID (Not Necessary)===
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).
 
 
===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 entriesboth checked. Click "OK"
 
Click "Play"
 
Start a new game or load up a save file.
 
Once you are actually playing, bring up the console by hitting the ~ key, and type the following:
 
<pre>player.addspell <formId></pre>
 
where <formId> is the formId for the spell. (You did write it down, right?)
 
Teleport to The Imperial City Market District. Go to Edgar's Discount Spells. Buy The Spell From Edgar. If you followed the tutorial the cost of Buying the spell from Edgar should be $0.
It should look something like:
<pre>player.addspell 01000ED9</pre>
 
If all goes well, a message will appear notifying you that "(your spell name)" was added. Choose this spell from your spellbook and cast it.
 
You should now have a Rat following you!
Anonymous user