Difference between revisions of "Casting Spells From An Activator"
no edit summary
imported>Haama (Updated to use MoveTo instead of PlaceAtMe) |
imported>Darkness X |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{FeatNom}} | |||
This is a short tutorial on how to use activators to cast spells. This will allow you to create more complicated spell effects such as lightning strikes or point blank area of effect spells.[[Image:CallLightning01.jpg|thumb|200px|The script you will be creating]] | |||
This is a short tutorial on how to use activators to cast spells. This will allow you to create more complicated spell effects such as lightning strikes or point blank area of effect spells. | [[Image:CallLightning03.jpg|thumb|200px|Another view]] | ||
By the end of this tutorial you should have a working point blank AoE lightning strike spell. | By the end of this tutorial you should have a working point blank AoE lightning strike spell. | ||
[[ | ==What you need== {{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]|opt0=[[OBSE]]}} | ||
[[ | During this tutorial we will be creating the following: | ||
During this tutorial we will creating the following: | |||
*1 activator object | *1 activator object | ||
*2 spells | *2 spells | ||
Line 15: | Line 12: | ||
==Create the Activator== | ==Create the Activator== | ||
The first thing we need to do is create | The first thing we need to do is create a new activator object. This object will be used to cast spells. | ||
In the [[Object_Window|Object Window]], Expand the WorldObjects item and select Activator. Rename the activator with the Editor ID "ActivatorFlameNode0" to "SourceID" by slowly double-clicking on it, changing the name, and selecting "Yes" when the menu comes up. | In the [[Object_Window|Object Window]], Expand the WorldObjects item and select Activator. Rename the activator with the Editor ID "ActivatorFlameNode0" to "SourceID" by slowly double-clicking on it, changing the name, and selecting "Yes" when the menu comes up. | ||
Line 63: | Line 60: | ||
;get a reference to the caster | ;get a reference to the caster | ||
set me to GetSelf | set me to GetSelf | ||
;set the reference to the activator | |||
set source to YourActivatorsReferenceEditorID | |||
;add 200 to the height so it is above the actor | ;add 200 to the height so it is above the actor | ||
Line 86: | Line 86: | ||
;get a reference to this actor | ;get a reference to this actor | ||
set me to GetSelf | set me to GetSelf | ||
;set source to the activator | |||
set source to YourActivatorsReferenceEditorID | |||
;add 1000 to the height to simulate lightning coming from the sky | ;add 1000 to the height to simulate lightning coming from the sky | ||
Line 136: | Line 139: | ||
==Caveats== | ==Caveats== | ||
*This spell will hit the player as well as everyone around him. This may or may not be what you want. A simple if check in the TutCallLightningAoeSpellScript will prevent the spell from hitting the player: | *This spell will hit the player as well as everyone around him. This may or may not be what you want. A simple if check directly below the <tt>'''Begin ScriptEffectStart'''</tt> line in the TutCallLightningAoeSpellScript will prevent the spell from hitting the player: | ||
<pre> | <pre> | ||
... | ... | ||
Line 152: | Line 155: | ||
*You could force the target into combat using [[StartCombat]] in TutCallLightningAoeSpellScript, but there are still some problems with that as well. | *You could force the target into combat using [[StartCombat]] in TutCallLightningAoeSpellScript, but there are still some problems with that as well. | ||
*Another solution to this problem is to only allow the spell to effect current | *Another solution to this problem is to only allow the spell to effect current enemies of the player. | ||
This code can be added directly below the avoid hitting player code in TutCallLightningAoeSpellScript. | This code can be added directly below the avoid hitting player code in TutCallLightningAoeSpellScript. | ||
<pre> | <pre> |