<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Reverse.loop</id>
	<title>Reverse.loop - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Reverse.loop"/>
	<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Reverse.loop&amp;action=history"/>
	<updated>2026-09-14T13:15:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://agiwiki.sierrahelp.com//index.php?title=Reverse.loop&amp;diff=13042&amp;oldid=prev</id>
		<title>Andrew Korson: Created page with &quot;The &#039;&#039;&#039;reverse.loop&#039;&#039;&#039; command switches an object&#039;s cycle mode to &#039;reverse loop&#039;.  == Syntax ==  reverse.loop(obj oA, flg fDONE);  == Remarks ==...&quot;</title>
		<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Reverse.loop&amp;diff=13042&amp;oldid=prev"/>
		<updated>2019-04-20T12:00:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;reverse.loop&amp;#039;&amp;#039;&amp;#039; command switches an object&amp;#039;s &lt;a href=&quot;/index.php?title=Cycle_mode&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Cycle mode (page does not exist)&quot;&gt;cycle mode&lt;/a&gt; to &amp;#039;reverse loop&amp;#039;.  == Syntax ==  reverse.loop(&lt;a href=&quot;/index.php/Screen_object&quot; title=&quot;Screen object&quot;&gt;obj&lt;/a&gt; oA, &lt;a href=&quot;/index.php/Flag&quot; title=&quot;Flag&quot;&gt;flg&lt;/a&gt; fDONE);  == Remarks ==...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;reverse.loop&amp;#039;&amp;#039;&amp;#039; command switches an object&amp;#039;s [[cycle mode]] to &amp;#039;reverse loop&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
reverse.loop([[screen object|obj]] oA, [[flag|flg]] fDONE);&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;reverse loop&amp;#039; [[cycle mode]], [[screen object]] &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; will cycle one time, in the reverse direction, until the first cel is reached.&lt;br /&gt;
&lt;br /&gt;
Setting the cycle mode to &amp;#039;reverse loop&amp;#039; will automatically enable the object for [[updating]] if not currently enabled, and also enables the [[cycling property]].&lt;br /&gt;
&lt;br /&gt;
[[Flag]] &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; is reset to FALSE when the command is executed. When the first [[cel]] is reached, &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; is set to TRUE.&lt;br /&gt;
&lt;br /&gt;
Changing cycle mode does not change the current [[cel]]. The new cycle mode begins with whatever cel is currently assigned to the object. If the current cel is the first cel, no cycling will occur, as the screen object is already at the beginning of the loop. Flag &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; will be set immediately.&lt;br /&gt;
&lt;br /&gt;
Use the &amp;#039;&amp;#039;&amp;#039;[[stop.cycling]]&amp;#039;&amp;#039;&amp;#039; command to turn cycling off. The &amp;#039;&amp;#039;&amp;#039;[[normal.cycle]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[end.of.loop]]&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;[[reverse.cycle]]&amp;#039;&amp;#039;&amp;#039; commands can be used to switch to other cycle modes.&lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
Do not use &amp;#039;&amp;#039;&amp;#039;reverse.loop&amp;#039;&amp;#039;&amp;#039; and movement modes (&amp;#039;&amp;#039;&amp;#039;[[move.obj]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[follow.ego]]&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;[[wander]]&amp;#039;&amp;#039;&amp;#039;) one an object at the same time. The byte in the [[screen object]] data table that AGI uses to store the &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; flag is also used by the movement modes. If you use a movement mode command while the &amp;#039;&amp;#039;&amp;#039;reverse.loop&amp;#039;&amp;#039;&amp;#039; command is active, the flag number gets overwritten, and when the object finishes cycling, the wrong flag will be set.&lt;br /&gt;
&lt;br /&gt;
AGI does not check that object number &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is a valid [[screen object]]. If the object has not been [[animate.obj|initialized]], the &amp;#039;&amp;#039;&amp;#039;reverse.loop&amp;#039;&amp;#039;&amp;#039; command still sets the cycle mode to &amp;#039;reverse loop&amp;#039; and resets the flag; nothing else will happen though. If the object number exceeds the [[max screen object]] number, data used for other purposes will be overwritten, which may result in unexpected results, including possibly [[crashing AGI]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;agi&amp;quot;&amp;gt;&lt;br /&gt;
#define door o7&lt;br /&gt;
...&lt;br /&gt;
[ initialize object&lt;br /&gt;
...&lt;br /&gt;
reverse.loop(door, f99);  [ close the door&lt;br /&gt;
if(isset(f99))&lt;br /&gt;
  {&lt;br /&gt;
  print(&amp;quot;The door is shut.&amp;quot;);&lt;br /&gt;
  reset(f99);&lt;br /&gt;
  }&lt;br /&gt;
...&lt;br /&gt;
end.of.loop(door, f100);  [ open the door&lt;br /&gt;
if(isset(f100))&lt;br /&gt;
  {&lt;br /&gt;
  print(&amp;quot;The door is open.&amp;quot;);&lt;br /&gt;
  reset(f100);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical Information ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; width=&amp;quot;200&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Required Interpreter Version:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| width=&amp;quot;175&amp;quot; | Available in all AGI versions.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Byte-Code Value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| 75 (0x4B hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[end.of.loop]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[normal.cycle]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[reverse.cycle]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[stop.cycling]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Category:Commands]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew Korson</name></author>
	</entry>
</feed>