Open main menu

Difference between revisions of "AGIWiki/Memory and Script"

m
Line 392: Line 392:


Previously known as unknown.172().
Previously known as unknown.172().
These two commands are only available in AGI versions 2.915 and above.
Despite their names, the [[AGIWiki/push.script|push.script]] and [[AGIWiki/pop.script|pop.script]] functions are not stack functions. Pushing the script will save the current script table position. If push.script is called multiple times, it will overwrite the stored script position each time it is called.
Popping the script will restore the script table position. After calling pop.script , the next script entry will be made at the restored position. It is important that push.script be called BEFORE pop.script. Popping the script position without first pushing it could result in unpredictable results since the memory location where the script position is stored may contain an unknown value.
Because AGI relies on the script entries to correctly [[AGIWiki/Saving games|save and restore games]], it is important to exercise caution when manipulating scripts.


=== Script Flags ===
=== Script Flags ===
885

edits