Difference between revisions of "Push.script"

From AGI Wiki
Jump to navigationJump to search
(Created page with "The '''push.script''' command (previously known as '''unknown171''') saves the current position in the script buffer so that it can be restored later by a ca...")
 
 
Line 1: Line 1:
The '''push.script''' command (previously known as '''unknown171''') saves the current position in the [[Script Buffer|script buffer]] so that it can be restored later by a call to [[pop.script]].
+
The '''push.script''' command saves the [[script table]] pointer.
  
<code>push.script();</code>
+
== Syntax ==
  
Note: the name of this command is a little misleading. It does not push a position onto a stack. Every time this command is issued, it overwrites the last saved position.
+
push.script();
  
This command must be called ''before'' <code>pop.script</code> is called.
+
== Remarks ==
  
'''Note:''' this command does not work with the [[AGI Mouse]] hack, which replaces this command.
+
This command saves the script pointer so that it can be restored later by the '''[[pop.script]]''' command.
  
&nbsp;
+
A detailed discussion of scripts, and how to push and pop the pointer can be found in the [[AGI Scripts]] topic.
  
==Parameters==
+
== Possible Errors ==
  
This command takes no parameters.
+
Do not manipulate the [[AGI Scripts|script]] features of AGI unless you fully understand what you are doing, as it is easy to corrupt save game files if the script entries are not correct.
  
==Possible errors==
+
== Example ==
  
(Unknown)
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
push.script();
 +
...  [ some activities that add script entries
 +
pop.script();  [ script pointer is reset
 +
</syntaxhighlight>
  
==Examples==
+
== Technical Information ==
  
See the [[Memory and Script]] article for examples.
+
{| border="1" cellpadding="2"
 +
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
 +
| width="175" | Available in version 2.915 and above.
 +
|-
 +
| style="background-color: #efefef" | '''Byte-Code Value:'''
 +
| 171 (0xAB hex)
 +
|}
  
==See also==
+
== See Also ==
  
* [[pop.script]]
+
[[System Commands]]<br />
* [[Memory and Script]]
+
'''[[pop.script]]'''<br />
* [[AGI Mouse]]
+
[[AGI Scripts]]<br />
 
+
[[Category:Commands]]<br />
==Sources==
 
 
 
* [[Memory and Script]]
 
* [[AGI Studio]] help file
 
 
 
&nbsp;
 

Latest revision as of 21:45, 18 April 2019

The push.script command saves the script table pointer.

Syntax

push.script();

Remarks

This command saves the script pointer so that it can be restored later by the pop.script command.

A detailed discussion of scripts, and how to push and pop the pointer can be found in the AGI Scripts topic.

Possible Errors

Do not manipulate the script features of AGI unless you fully understand what you are doing, as it is easy to corrupt save game files if the script entries are not correct.

Example

Code:

<syntaxhighlight lang="agi"> push.script(); ... [ some activities that add script entries pop.script(); [ script pointer is reset </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in version 2.915 and above.
Byte-Code Value: 171 (0xAB hex)

See Also

System Commands
pop.script
AGI Scripts