Difference between revisions of "MessageBox Tutorial"

250 bytes added ,  02:50, 29 August 2007
→‎Multiple Menus in a Spell Script: updating script to recast if choice isnt completed
imported>Haama
imported>ShadowDancer
(→‎Multiple Menus in a Spell Script: updating script to recast if choice isnt completed)
Line 351: Line 351:
<pre>Short Choosing
<pre>Short Choosing
Short Choice
Short Choice
 
Ref TargetRef




Begin SpellEffectStart
Begin SpellEffectStart
  Set TargetRef to GetSelf
   if MenuVariables.Choosing
   if MenuVariables.Choosing
     Set Choosing to MenuVariables.Choosing
     Set Choosing to MenuVariables.Choosing
Line 420: Line 421:
     set MenuVariables.Choosing to Choosing
     set MenuVariables.Choosing to Choosing
     set MenuVariables.Choice to Choice
     set MenuVariables.Choice to Choice
     player.Cast Spell
     TargetRef.Cast Spell TargetRef
   endif
   endif
end</pre>
end</pre>
Line 427: Line 428:
* Using multiple menus, or catching a button press with [[GetButtonPressed]] in a magic effect script requires that the spell duration be more than 0 in order for '''GetButtonPressed''' to capture the button.
* Using multiple menus, or catching a button press with [[GetButtonPressed]] in a magic effect script requires that the spell duration be more than 0 in order for '''GetButtonPressed''' to capture the button.
* The [[ScriptEffectFinish]] block will always run immediately after the last running of the [[ScriptEffectUpdate]] block. Due to this, if the '''ScriptEffectUpdate''' block has a '''Return''' statement that fires at this point of the script, the '''ScriptEffectFinish''' block will not run.
* The [[ScriptEffectFinish]] block will always run immediately after the last running of the [[ScriptEffectUpdate]] block. Due to this, if the '''ScriptEffectUpdate''' block has a '''Return''' statement that fires at this point of the script, the '''ScriptEffectFinish''' block will not run.
* Spell using the script must have a '''Range''' of ''Self''
* ''Spell'' in the above script (TargetRef.Cast ''Spell'' TargetRef) must be replaced with '''Spell ID''' of the Spell using the script


==Extras==
==Extras==
Anonymous user