Difference between revisions of "MessageBox Tutorial"
Jump to navigation
Jump to search
→Activator Disadvantages: How to use the Variable-Set-Loaded method
imported>Haama (→Activator Advantages: Added Ob-Cell reset protection info) |
imported>Haama (→Activator Disadvantages: How to use the Variable-Set-Loaded method) |
||
|
====Activator Disadvantages====
* They need to be [[Loaded]] to run every frame.
<pre>short Working
* They can run even when not around the player (though only for a single frame, but enough to cause [[:Category:Tidbits#When_do_remote_activators_run.3F|problems]]).▼
...
begin GameMode
...
set Working to 1
...
</pre>
▲*
<pre>short Working
...
begin onActivate
...
set Working to 1
end
begin GameMode
if Working
...
endif
end</pre>
Set Working to 0 when you wish to keep the script from running.
* These solutions work hand in hand. When the script should be running, and Working is 1, set Working to 1 at the end of every frame to keep it loaded for the next frame. When it's 0, don't set any variables and the activator will be unloaded, preventing the script from errantly running. Combining them looks like this:
<pre>short Working
...
begin onActiavte
...
set Working to 1
end
begin GameMode
if Working
if (Choosing == 0)
set Working to 0
return
elseif (Choosing == 1)
...
endif
set Working to 1
endif
end</pre>
====Other methods====
| |||