Difference between revisions of "MessageBox Tutorial"
→Which Block to run MessageBox and GetButtonPressed?: Bit of a rewrite
imported>Haama |
imported>Haama (→Which Block to run MessageBox and GetButtonPressed?: Bit of a rewrite) |
||
Line 32: | Line 32: | ||
elseif (Choice == 0)</pre> | elseif (Choice == 0)</pre> | ||
=== | ===Timing=== | ||
MessageBox takes one frame to display, so you can use any [[:Category:Blocktypes|block]] to display it. However, GetButtonPressed needs to be in a block that | MessageBox takes one frame to display, so you can use any [[:Category:Blocktypes|block]] to display it. However, it can take up to 15 frames before GetButtonPressed will return the player's button press (even if the player presses the button on the same frame as the MessageBox function). Therefore, it needs to be in a block that runs every frame, such as [[GameMode]], [[MenuMode]], and [[ScriptEffectUpdate]]. It also needs to be on a script that is running every frame. For objects this means it must be in a [[Loaded]] cell, for quests this means [[Special variables#Locals|fQuestDelayTime]] must be set to .001 and they must be running, and for spells this means the duration must be long enough (more on that in the Spell Menus subsection). | ||
===Keep 'em separated=== | ===Keep 'em separated=== |