Difference between revisions of "MessageBox Tutorial"

14 bytes removed ,  13:34, 20 July 2007
m
imported>Haama
(→‎Basics: New section and split things up into sections)
imported>Haama
Line 28: Line 28:


===Where to place MessageBox and GetButtonPressed===
===Where to place MessageBox and GetButtonPressed===
[[MessageBox]] takes one frame to display, so you can use any block to display it. However, [[GetButtonPressed]] needs to be in a block that continuously runs (i.e., [[GameMode]], [[MenuMode]], [[ScriptEffectUpdate]]) and needs to be on a script that is running every frame (i.e., an activator that is in a loaded cell, a quest running every .001 seconds, etc.). The reason for this – in order to read it, make a decision, click the option, and let go of the mouse button it will take the player longer than a frame, so you need to run the script every frame until then.
[[MessageBox]] takes one frame to display, so you can use any [[BlockType]] to display it. However, [[GetButtonPressed]] needs to be in a [[BlockType]]that continuously runs (i.e., [[GameMode]], [[MenuMode]], [[ScriptEffectUpdate]]) and needs to be on a script that is running every frame (i.e., an activator that is in a loaded cell, a quest running every .001 seconds, etc.), until the player's decision is caught. This is because it will take at least a few frames for the player to read the menu and make a decision (as well as some other peculiarities).


===Keep 'em separated===
===Keep 'em separated===
Anonymous user