Difference between revisions of "AGI Command Reference - Program Control Commands"

From AGI Wiki
Jump to navigationJump to search
(Blanked the page)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[AGI Tutorials|Tutorials Table of Contents]]<br />
 
[[AGI Command Reference|AGI Command Reference Index]]<br />
 
  
<div align="center">
 
Page:
 
[[AGI Command Reference - Arithmetic Commands|1]] |
 
[[AGI Command Reference - Commands to Load and unLoad Resources|2]] |
 
[[AGI Command Reference - Program Control Commands|3]] |
 
[[AGI Command Reference - Object Control Commands|4]] |
 
[[AGI Command Reference - Object Description Commands|5]] |
 
[[AGI Command Reference - Object Motion Control Commands|6]] |
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |
 
[[AGI Command Reference - PIC Resource Management Commands|8]] |
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |
 
[[AGI Command Reference - Text Management Commands|10]] |
 
[[AGI Command Reference - String Management Commands|11]] |
 
[[AGI Command Reference - Initialization Commands|12]] |
 
[[AGI Command Reference - Menu Management Commands|13]] |
 
[[AGI Command Reference - Test Commands|14]] |
 
[[AGI Command Reference - Other Commands|15]] |
 
[[AGI Command Reference - Unknown Commands|16]]
 
</div><br />
 
 
<div align="center"><span style="font-size: 22pt">Program Control Commands</span><br />
 
''By [[Chris Cromer]]''</div>
 
 
&nbsp;
 
 
<code>new.room</code> command is one of the most powerful commands of the interpreter. It is used to change algorithms of the object behavior, props, etc. Automatic change of EGO coordinates imitates moving into a room adjacent to the edge of the initial one.
 
 
Sounds awkward but that's what it says.
 
 
The format of the command:
 
 
== <br />new.room(n); new.room.v(n); ==
 
 
<blockquote>
 
* These commands do the following:
 
* Commands stop_update and unanimate are issued to all objects;
 
* All resources except Logic(0) are discarded;
 
* Command player_control is issued;
 
* unblock command is issued;
 
* set_horizon 36' command is issued;
 
* Var(1) is assigned the value of Var(0);
 
* Var(0) is assigned n (or the value of Var(n)
 
* when the command is new_room_v);
 
* Var(4) is assigned 0;
 
* Var(5) is assigned 0;
 
* Var(16) is assigned the ID number of the VIEW resource that was
 
* associated with EGO (the player character).
 
* Logic(i) resource is loaded where i is the value of Var(0)!
 
* Set EGO coordinates according to Var(2):
 
** if EGO touched the bottom edge, put it on the horizon;
 
** if EGO touched the top edge, put it on the bottom edge of the screen;
 
** if EGO touched the right edge, put it at the left and vice versa.
 
* Var(2) is assigned 0 (meaning EGO has not touched any edges).
 
* Flag(5) is set to 1 (meaning in the first interpreter cycle after the new_room command all initialization parts of all logics loaded and called from the initialization part of the new room's logic will be called. In the subsequent cycle Flag(5) is reset to 0.
 
* Clear keyboard input buffer and return to the main AGI loop.
 
</blockquote>
 
 
== call(n); call.v(n); ==
 
 
<blockquote>Subroutine call commands
 
 
<blockquote>LOGIC resource number n (or number i where i the value of Var(n)) is executed as a subroutine. If the logic with the given ID is not loaded in memory, it is temporarily loaded and discarded after returning from the call (this takes extra time). call command does not change any variables or flags.</blockquote></blockquote>
 
 
== return(); ==
 
 
<blockquote>This command returns control to the interpreter if it is executed in Logic(0), or to the command following the call command which called the current logic.</blockquote>
 
 
== jump [label] ==
 
 
&nbsp;This command unconditionally transfers control to a command starting with a symbol combination within the same logic.
 
 
== set.scan.start reset.scan.start ==
 
 
<blockquote>Normally, when a logic is called using call command, execution begins at the first instruction. set_scan_start command sets the entry point at the command following it, while reset_scan_start returns entry point to the beginning.</blockquote>
 
 
&nbsp;
 
 
<div align="center">
 
Page:
 
[[AGI Command Reference - Arithmetic Commands|1]] |
 
[[AGI Command Reference - Commands to Load and unLoad Resources|2]] |
 
[[AGI Command Reference - Program Control Commands|3]] |
 
[[AGI Command Reference - Object Control Commands|4]] |
 
[[AGI Command Reference - Object Description Commands|5]] |
 
[[AGI Command Reference - Object Motion Control Commands|6]] |
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |
 
[[AGI Command Reference - PIC Resource Management Commands|8]] |
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |
 
[[AGI Command Reference - Text Management Commands|10]] |
 
[[AGI Command Reference - String Management Commands|11]] |
 
[[AGI Command Reference - Initialization Commands|12]] |
 
[[AGI Command Reference - Menu Management Commands|13]] |
 
[[AGI Command Reference - Test Commands|14]] |
 
[[AGI Command Reference - Other Commands|15]] |
 
[[AGI Command Reference - Unknown Commands|16]]
 
</div><br />
 
 
[[AGI Tutorials|Tutorials Table of Contents]]<br />
 
[[AGI Command Reference|AGI Command Reference Index]]
 
 
<span style="float: left">[[AGI Command Reference - Commands to Load and unLoad Resources|&lt; Previous: Commands to Load and unLoad Resources]]</span><span style="float: right">[[AGI Command Reference - Object Control Commands|Next: Object Control Commands &gt;]]</span>
 
 
&nbsp;
 
 
[[Category:Logic]]
 
[[Category:Commands]]
 
[[Category:References]]
 
[[Category:Tutorials]]
 

Latest revision as of 19:56, 22 March 2019