Hey guys, Stickmenfalling here, I saw some of the great tutorials OblivionModda had on here and thought I would make one. I'm going to try and help you learn how to make spells the way I did, through example, and then you're own private practice.
Okay so first of all, it's a pretty good idea to start out in the Construction Set (CS) itself
Now lets put the actual script into a spell.
Okay so first of all, it's a pretty good idea to start out in the Construction Set (CS) itself
- Now just load up the Oblivion Master file in File -> Data (this may take a while)
- Once loaded, click on Gameplay -> Edit Scripts
- Once in the script window, click on Script -> New...
- Near the upper right-hand corner of the window, there is a drop-down box that says "script type" drop down the list, and select "Magic Effect"
- Now first thing's first, the script needs a name. Begin the script with the following:
Scriptname TutorialSpellScript
(note that the CS is not case-sensitive)
What you have just done is named your script. Naming your script allows you to find your script easily when you assign it to an item or spell, not to mention just plain giving it a label
- In this script, we will make a spell that removes all of a target NPC's items, making them naked (we will get to more advanced stuff, like conditions and making them run around, later) so type out the following:
Begin ScriptEffectStart
Allow me to quickly explain this. This is a block command. Block commands tell the script when to start happening. This particular block command is only usable for spell scripts. It means begin the script when the spell is cast.
Alright back to business.
Begin ScriptEffectStart
RemoveAllItems
end
So what we just did was, we told the script to start when the spell effect begins, and then remove all of items on the target. Simple, right?
Here is how your script should look:
Scriptname TutorialSpellScript
Begin ScriptEffectStart
RemoveAllItems
end
- Now click file -> Save. If everything went right, it should save without complaining.
Now lets put the actual script into a spell.
- In the object window, expand the Magic set, then Spell, and then select "Spell"
- Right click in the spell list, and select "New"
- In the ID Box type TutorialSpell (it's always a good idea to name your script the same as your spell ID, but with the word "script" at the end. For example, this spell's ID is TutorialSpell, and the script is called TutorialSpellScript). In the Name Box type whatever you want to call it. This name will appear in your spell menu in the game.
- In the area called "Effects" (to the right of the information area) right click and select "New"
- Now in the Effect drop-down box, select Script Effect. In the Range box, select Target. Then select TutorialSpellScript in the Script drop-down box. For this spell type "Make naked" in the Effect Name box. Select "Charm" in the Visuals Effect box. Leave "Effect is Hostile" unchecked. Now click OK in the Effect menu and in the Spell menu. But you still aren't done yet.
- Go to Items -> Clothing -> Amulet in the object window. Right-click your favorite amulet and select "Edit". Change the ID to SpellAmulet and the name to whatever you want it to be. Now make a new script and make it look like this:
Scriptname SpellAmuletScript
Begin OnEquip
Player.addSpell TutorialSpell
end
Save it, and go back to the amulet's info menu. Select SpellAmuletScript from the Script drop-down box (if it is not there you will have to click OK, then come back to the amulet's info menu by double-clicking it) also don't forget to uncheck Quest Item, and click OK. Now go to Actors -> NPC -> Imperial -> Male. Look for a character with the ID Player and the name Bendu Olo. This is the player, in other words, you. Do not change ANYTHING! Just click and drag the amulet you made into the character's inventory.
- Now go to File -> Save and name the file TutorialSpell.
- Begin running Oblivion. In the menu that first appears as soon as you open Oblivion, select Data Files. You should see a list of files. Check the one that says TutorialSpell by clicking on it. Click OK and begin playing. Equip your amulet and then test out the spell. If it all worked out correctly, the person you shot should now be naked, wearing only their underwear. Now try some stuff out on you own. This website will help: http://cs.elderscrolls.com/constwiki/index.php/CS_Functions it lists all the different functions in the CS and what they do. We'll get to more advanced stuff later on in another tutorial. Happy scripting!
Last edited by Stickmenfalling on Mon Jun 15, 2009 5:45 pm; edited 1 time in total