Difference between revisions of "MessageBox Tutorial"

1,696 bytes added ,  11:23, 29 August 2007
→‎Creating Your New Menu: Info on different methods
imported>Haama
(→‎Intro: Oops, not there yet)
imported>Haama
(→‎Creating Your New Menu: Info on different methods)
Line 236: Line 236:


==Creating Your New Menu==
==Creating Your New Menu==
===In which I try to convince you to use an activator===
There are 4 mediums you could use for the script: Quest, Activator, Token, and Spell. Each has their own advantages and disadvantages, but it's suggested you use an activator:
* Activators can keep persistent variables that other scripts can use (unlike tokens and spells)
** Quest variables can be reset by using 'StartQuest' when the quest is already running (and there are reports of quests requiring resetting if a variable is added in a mod's update).
*There's a clear beginning to it ([[OnActivate]])
* It's easy and fast to start (harder for a quest)
* Tokens can randomly cause CTDs when removed (unless you wait for 5 frames first)
* And it's simply easier to manage than a spell
** Spells will only run in GameMode
** There will always be time inbetween menus, in which the spell's duration will decrease. Giving the spell a long duration can work, but is not a guarantee for multi-layered menus.
Disadvantages of an activator:
* They need to be moved to the player's cell to use
* They can run even when not around the player (though not for long enough to use effectively)
** This requires a bit of extra coding, to prevent them from doing something unexpected
[[MessageBox Tutorial#Multiple Menus in a Spell Script|Multiple Menus in a Spell Script]]
The only disadvantage is that activators need to be in the same cell as the player (loaded in memory) to run, so you will have to remember to add a few lines to move the activator to the player when starting and away when finished. Of course, with some work, quests and tokens can be made to do the same, but I don't find them quite as easy to set up.
===What you'll need=
You'll need to set up some objects for the next script: an invisible activator, an XMarker, and your own cell:
You'll need to set up some objects for the next script: an invisible activator, an XMarker, and your own cell:


Line 325: Line 346:
End</pre>
End</pre>
Ok, no games that time. You can start your menus from any script with <u>'''''YourActivatorsReferenceEditorID.Activate player, 1'''''</u> and this script will do the rest.
Ok, no games that time. You can start your menus from any script with <u>'''''YourActivatorsReferenceEditorID.Activate player, 1'''''</u> and this script will do the rest.


==Moving Between Multiple Menus==
==Moving Between Multiple Menus==
Anonymous user