Difference between revisions of "Scripting Tutorial: Summoned Creatures"

no edit summary
imported>Darkness X
imported>Coolboys335
Line 25: Line 25:
* Drag an interior such as “'''''AnvilHouseMCInterior01'''''” into the [[Render Window]].
* 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'''.
* 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'''.
* 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==
==Step 2: Choose an AI follow package==
Line 59: Line 59:
* Open the '''Character->Packages''' menu and drag either the “'''''FollowPlayer'''''” package, or a custom one made in step 2 into the AI menu.
* 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.
* 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'''''”.
* 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.
* 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 reference editor ID “'''''SummonRat1REF'''''”.
* 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.
* 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.
* Click '''Ok''' when done.
Line 68: Line 68:
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.
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'''.
* 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).
* Copy the script and paste into the editor window. Be sure to change the reference names if different from the tutorial (lines 14, 33, and 74). 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>
<pre>
Line 160: Line 160:


* In the '''Object Window''', expand '''Magic->Spells'''. Right-click on a spell name and select '''New'''.
* 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).
* 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'''”.
* Click on “'''Script Effect Always Applies'''” and deselect “'''Auto-Calculate'''”.
* Choose the minimum skill and set the cost if a Spell or LP.
* 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'''.
* 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).
* 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).
Line 172: Line 172:
Adapted from [[Scripting Tutorial: My First Spell]].
Adapted from [[Scripting Tutorial: My First Spell]].


===Find the Form ID===
===Setting Spell For Sale===
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).
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).


Line 181: Line 184:


===Testing===
===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"
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 both 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?)


It should look something like:
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.
<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.
Choose this spell from your spellbook and cast it.


You should now have a Rat following you!
You should now have a Rat following you!
Anonymous user