Difference between revisions of "How To Create A Custom NPC Summoning Spell"

Fixed the script - MoveTo >> PositionCell
imported>UDUN
m
imported>QQuix
(Fixed the script - MoveTo >> PositionCell)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Hello friend, so, you made say a custom race and you want to add a nice little something special perhaps, well my friend, crank up your construction set for Oblivion and lets do this.
[[Category: Tutorials]]
[[Category: Scripting Tutorials]]
{{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]}}
__TOC__


==Introduction==


Step 1: First off we are going to create a new Global, so to the
Let's say you made a custom race and would like to add a Power that lets you summon a creature to aid you. Well, you're in luck, because today we're going to learn how to do just that!
game play menu and click and select globals. We want to make the global short so make sure the setting is on short and then go the globals already in the box and right click and a option should
appear select from the options, New. Ok now since I am trying to have a summoned siren race dude show up I’m going to make my new global - SirenCount -


==Step One: Creating a New Global==
* Go to the Gameplay menu and select [[Globals]].
* Be sure Short is selected, then right click anywhere in the list and select New.
* Name it, in this case I am going to call it - SirenCount -.


Step 2: Creating the spell, go to the spell in the left box and click a whole lotta spells should appear in the box beside it right click in the box and select from the options, that’s right, new. Ok so we need a id for our spell so I have chosen -aaadiasummonspell - as mine.  Now we need a name to show up in the player spell list and I chose  Siren Aid. Tick the box where is says Script Effect always applies. Now we ether have the choice to go for a lesser power option which will mean the player can only cast this spell once per day or we can choose the spell option, the choice is yours. If you want a specified time go to the duration box and add the time you want there.
==Step Two: Creating the Spell==
* In the [[Object Window]], select [[Spell]], right click anywhere in the list to the right and select New.
* Choose an ID and name for the spell, in this case I used  -aaadiasummonspell for the ID and Siren Aid for the name.
* Choose the type of spell. Since this is going to be a racial ability, we're going to go with Power so it can only be used once per day.
* Make sure Script Effect Always Applies is checked.
* Go over to the Effects list, right click and select New.
* In the Effect drop down box, select Script Effect, simply hitting the S key should take you right to it. The spell Range should be set to Self and the Duration to whatever you prefer.
* In the same window, go down to the Script Effect Info area and select Conjuration next to School. For Visual Effect, you can choose whatever you like, an existing summon creature effect works well in this case.


Next up, we gotta add a effect in the blank box of our new spell or lesser power, so we right click and select new, now a small box will show up with a magic such as fire damage, we want script effect so scroll down the list and select script effect  now we leave this and close it just for a few minutes.
==Step Three: Creating the Summoned Creature==
* In the [[Object Window]], go to the [[Creature]] or [[NPC]] section and pick out the one you want. For this, I simply used the NPC Dremora1CaitliffMelee1, which happens to be already summonable.
* Choose a unique ID and rename the [[NPC]] to your liking, I set the ID to - Dremora1CaitliffMelee1 - and name as - aaaSirendianne. I also went to his race box and selected my custom made siren race to make him a siren.
* Click the AI button and change [[Aggression]] to 5 and save. This helps prevent him from attacking anyone unless attacked.
* Customize the [[NPC]] how you like by adding whatever clothing or items you would like it to wear/have. If you want to change its gender, check or uncheck the Female box.
* Click Ok and a message box will pop up asking if you would like you change the original [[NPC]] to your unique name. Select yes, otherwise you could end up with a lot of problems in your mod.
* Next, we want to place our new [[NPC]] into the game world, so choose a cell in the Cell View window and double click to open it up. It doesn't much matter which one, so long as you place it outside of the normal playable area. You may also wish to simple create a new cell instead.


Step 3: The npc you want to summon, for ease of use I used the npc Dremora1CaitliffMelee1 - this npc is already summonable so we click on him and first off we backspace on his id which is the - Dremora1CaitliffMelee1 - we type in our unique and original name, I chose  - aaaSirendianne next I went to his race box and I opened it and selected my custom made siren race, now he’s a siren! So we go to his AI box and we change his aggression to 5 and then save on it, this is to help prevent him from attacking the player. Add whatever clothing or weapons you want him or her ( tick the female box) wear. Now select ok and a message box will say if you wish to create a new npc or change the original one to your unique name, you must always select new. Otherwise you could end up with a lot of problems in your mod.
Next, we want to place out new [[NPC]] into the game world, so go to the Cell View window and double click to open it up. Right click and select New, and rename it to something like aaaPetCell.
* Go to the [[Object Window]] and find an interior under WorldObjects -> Static -> Architecture and drag that over to your new cell. Change the reference to something suitable, then set the Position to (0,0,10) and check the Persistent Reference box.
* Next drag your new [[NPC]] over into the cell and right click it in the Editor ID list and select Edit. Change its position to the same as above (0,0,10), then set its Reference Editor ID, in this case I went with aaasirendp. Once that's done check the "Persistent Reference" and "Initially Disabled" boxes.
If your summon is a creature, you can go to the Ownership tab and select Player under NPC.Doing this will prevent it from attacking you should you hit it a few times.


Next we want to place our new npc we created into the game world, so choose somewhere and double click and bring up the cell, once loaded click on your npc and drag and drop him or her into the cell use the f key to drop them to the floor of the cell. Now we need to make him or her a persistent reference.
In regards to "NPCRefHere" in the script, replace it with the Reference Editor ID you chose for your [[NPC]].


Double click on the npc you dropped into the cell and a menu should come up with your npc's id with numbers and letters on it the top box is empty - this is left empty for you to add a unique ref id. Make one up - I chose aaasirendp and then tick the persistent reference box option. Next I made another persistent reference with the blood grass plant close to my npc. Same process as above although one can use other objects etc.
==Step Four: Creating the Script==


In regards to the npcrefhere - the id you chose along with moving your mouse cursor to get the added numbers and letters the game had - you need to include the numbers and letters in the script.
* Go to the Gameplay menu, select edit scripts and create a new script and name it it, I called mine aaasirenspelldp.
Paste this in and edit it accordingly, you should recongnize the names used.
<pre>
Scriptname aaaSirenspelldp


Example:    My npc idref is aaaSirendianne  the numbers and letters that showed up for me was (01000EDC)  all together it looked like‘aaaSirendianne’(01000EDC) - but you don’t include the ‘ in the script.
Begin ScriptEffectStart
 
;You can edit the numbers to change where it appears relative to the player.
Now scripts in the oblivion CS always need a name.
           NPCRefHere.moveto player 30 30 10
 
I called mine,
 
Script name aaasirenspelldp
 
Here is the complete spell, you will recognize the ID’s I used,
 
script name aaaSirenspelldp
 
<pre>Begin ScriptEffectStart
           npcrefhere.moveto player
           playMagicShaderVisuals effectSummonMythicDawn 2
           playMagicShaderVisuals effectSummonMythicDawn 2
           playsound AMBThunder
           playsound AMBThunder
;Activates global quest
           set SirenCount to 1
           set SirenCount to 1
            
            
Line 40: Line 55:


Begin ScriptEffectFinish
Begin ScriptEffectFinish
            npc ref here moveto other ref close to where npc has been placed
;This moves the NPC back to where it was.
;Edit the line below and change the cell name to the one your NPC was placed in.
          NPCRefHere.PositionCell 0 0 10 0 CellNameHere
;Deactivates global quest
             set SirenCount to 0
             set SirenCount to 0
End</pre>
End</pre>
 
Change the script effect type to Magic Effect and save.
 
Now go to the gameplay menu select the * edit scripts * choice and then select new. Copy the spell ether typing it in the Box by hand or if you like saving time go and do a copy and in the cs box press CTRL and then C and the script will appear like magic in the box.


Now change the type of script it is to * Magic Effect *
Now change the type of script it is to * Magic Effect *
We're almost done!


Almost done now. Hooray!
==Step Five: Finishing Up==
 
Go back to the spell you created in the Spell list and edit the effect. Under Script Effect Info, select your newly created spell next to Script, mine was called 1diasummonspell.
 
Click Ok and save.
Step 5 : Go back to your summon spell mine was named
Now we just have to add the spell to the game. If you had made a custom race, go to Character -> Race and select your race, then drag and drop your spell into the Specials list. Save your .esp and enjoy!
1diasummonspell open it up where we had set the effect to script
effect  now there should by a little box with None written in it, that where you want to click and then scroll through the various scripts in there and then select your script and add it.
 
Click ok and close the box and congratulations you have now
completed this tutorial.  
 
All you need to do now is test it in game,  happy gaming friend.
Anonymous user