Difference between revisions of "Talk:ScriptEffectUpdate"

Jump to navigation Jump to search
1,463 bytes added ,  21:48, 24 August 2007
answer about rearranging blocks
imported>ShadowDancer
m (signing for Haama)
imported>ShadowDancer
(answer about rearranging blocks)
 
[[User:Haama|Haama]] 16:33, 24 August 2007 (EDT)
 
:No, if the '''ScriptEffectFinish''' block is placed before the '''ScriptEffectUpdate''' block (which does not cause any problems that I can see), it will find the '''ScriptEffectFinish''' block before it finds the '''ScriptEffectUpdate''' block and finish the spell without running the '''ScriptEffectUpdate''' block. Once a block is no longer valid, it won't run so this can be used to get around the '''Return''' command firing in a '''ScriptEffectUpdate''' block (although in my experience, most of the time a constantly active '''Return''' command isn't necessary in a '''ScriptEffectUpdate''' block). For instance in the following spell script:
<pre>ScriptName SCAlterWeather
 
Short WeatherButton
 
Begin ScriptEffectStart
 
MessageBox "What weather would you like?", "Clear", "Cloudy", "Fog", "Overcast", "Rain", "Snow", "Thunderstorm"
 
End
 
Begin ScriptEffectUpdate
 
Set WeatherButton to GetButtonPressed
If WeatherButton == 0
ForceWeather Clear 1
ElseIf WeatherButton == 1
ForceWeather Cloudy 1
ElseIf WeatherButton == 2
ForceWeather Fog 1
ElseIf WeatherButton == 3
ForceWeather Overcast 1
ElseIf WeatherButton == 4
ForceWeather Rain 1
ElseIf WeatherButton == 5
ForceWeather Snow 1
ElseIf WeatherButton == 6
ForceWeather Thunderstorm 1
EndIf
End
 
Begin ScriptEffectFinish
 
ReleaseWeatherOverride
ForceWeather DefaultWeather
 
End</pre>
 
:--[[User:ShadowDancer|ShadowDancer]] 22:48, 24 August 2007 (EDT)
Anonymous user

Navigation menu