Difference between revisions of "Scripting Tutorial: My First Spell"

no edit summary
imported>JOG
(Moved to Category "Scripting Tutorials")
imported>Darkness X
 
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:


This tutorial will help you create a new spell using a combination of predefined and custom effects.
This tutorial will help you create a new spell using a combination of predefined and custom effects.
{{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]}}


==First Steps==
==First Steps==
Line 7: Line 9:


==Create the Spell==
==Create the Spell==
Alright! So, after the arduous loading process, we can start making our spell. Go ahead and locate the [[Object_Window]]. We're interested in the [[Category:Magic]] category, so expand that option in the list. There are a few items under Magic, but we're creating a spell, so click on the Spell list item.
Alright! So, after the arduous loading process, we can start making our spell. Go ahead and locate the [[Object_Window]]. We're interested in the [[:Category:Magic]] category, so expand that option in the list. There are a few items under Magic, but we're creating a spell, so click on the Spell list item.


There should be a whole bunch of spells loaded in the list now. Right-click somewhere in this list (it doesn't matter where) and choose "New" from the context menu that pops up. This brings up a blank [[Spell]] dialog.
There should be a whole bunch of spells loaded in the list now. Right-click somewhere in this list (it doesn't matter where) and choose "New" from the context menu that pops up. This brings up a blank [[Spell]] dialog.
Line 38: Line 40:
Now that we've added a standard magical effect to our spell, let's add a custom one. In order to add a custom effect, we need to write a script. Select Gameplay->Edit Scripts... from the menubar.
Now that we've added a standard magical effect to our spell, let's add a custom one. In order to add a custom effect, we need to write a script. Select Gameplay->Edit Scripts... from the menubar.


We're now at a blank [[Script_Edit]] window. Select Script->New from the menubar in this window. The textarea will now be enabled.
We're now at a blank [[Edit Scripts]] window. Select Script->New from the menubar in this window. The textarea will now be enabled.


Choose "Magic Effect" in the Script Type drop down. This is important! If we don't do this, we can't add it to a spell.
Choose "Magic Effect" in the Script Type drop down. This is important! If we don't do this, we can't add it to a spell.
Line 108: Line 110:
Choose Script->Save from the menubar (or click on the disk button in the toolbar) and close the Script Edit window.
Choose Script->Save from the menubar (or click on the disk button in the toolbar) and close the Script Edit window.


<blockquote>You can read more about scripting on the [[Category:Scripting]] page. Also check out the [[My_First_Script]] tutorial.</blockquote>
<blockquote>You can read more about scripting on the [[:Category:Scripting]] page. Also check out the [[Scripting_Tutorial:_My_First_Script|My_First_Script]] tutorial.</blockquote>


==Add Custom Effects==
==Add Custom Effects==
Line 166: Line 168:


Have fun making spells!
Have fun making spells!
==Custom Spell Scripting Notes==
Functions in a magic effect script run on the target by default, so usually there's no need to worry about the target's ID. But if you do need that info, getSelf will get it for you.


[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Scripting Tutorials]]
[[Category:Scripting Tutorials]]
Anonymous user