Difference between revisions of "Talk:MessageBox Tutorial/Spell Scripts"
Jump to navigation
Jump to search
Talk:MessageBox Tutorial/Spell Scripts (edit)
Revision as of 07:05, 30 August 2007
, 07:05, 30 August 2007adding more talk
imported>Haama (or should we move the dicussion over here?) |
imported>ShadowDancer (adding more talk) |
||
|
See [[Talk:MessageBox_Tutorial]] for the discussion.
----
Haama, out of curiosity, why do you have so many
If (Choice == -1) ;No choice yet
Set Choice to GetButtonPressed
statements in the script? If you use a couple more '''If''' statements, you could just put one of those in and remove that '''If''' statement from each of the additional menu sections. I don't even think you need to use an '''If''' statement with '''GetButtonPressed''' to begin with.
--[[User:ShadowDancer|ShadowDancer]] 05:59, 29 August 2007 (EDT)
:See [[MessageBox_Tutorial#Running_the_same_choice_for_multiple_frames]]. It's rare, but I've needed to do it, and I've had to answer a couple of threads on it.
:--[[User:Haama|Haama]] 11:50, 29 August 2007 (EDT)
::OK, I can understand the reasoning behind using the '''If''' statement and that makes sense. However all of the '''GetButtonPressed''' statements can still be handled by just one '''If''' statement outside of the main '''If/ElseIf''' statements can't they? If the '''If''' statement were the first in the ScriptEffectUpdate, it won't fire because choice will be zero during the first iteration, but will then be overridden once any button is clicked from the MessageBox section including moving to a new menu. Once that section starts looping, it will keep looking for a return of something besides -1 and will eventually produce the key choice. At that point, even if you are doing looping for counting items, choice will no longer be -1 and it won't fire during those loops. And if it is -1 because the Magic Effect script ran out of time, ScriptEffectUpdate will still just return -1 and loop.
::BTW, there is one small issue here that hasn't been explored yet (as far as I know). If someone clicked on a button and it hasn't returned from the '''GetButtonPressed''' and you run out of time, your Choosing will be positive on recasting of the spell. I am not sure if that button press will show up after the recasting of the spell. Do you have any idea about this? I am also adding in the dispel section that I wrote in the other Talk section of the original article so that when finishing the spell by choice it dispels the spell.
::--[[User:ShadowDancer|ShadowDancer]] 08:05, 30 August 2007 (EDT)
| |||