<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://sciwiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Advanced_Use_of_Control_Areas</id>
	<title>Advanced Use of Control Areas - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://sciwiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Advanced_Use_of_Control_Areas"/>
	<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Advanced_Use_of_Control_Areas&amp;action=history"/>
	<updated>2026-10-28T05:13:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://sciwiki.sierrahelp.com/index.php?title=Advanced_Use_of_Control_Areas&amp;diff=279&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Advanced_Use_of_Control_Areas&amp;diff=279&amp;oldid=prev"/>
		<updated>2013-08-05T21:23:53Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:23, 5 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://sciwiki.sierrahelp.com/index.php?title=Advanced_Use_of_Control_Areas&amp;diff=278&amp;oldid=prev</id>
		<title>Andrew Branscom at 23:42, 5 January 2011</title>
		<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Advanced_Use_of_Control_Areas&amp;diff=278&amp;oldid=prev"/>
		<updated>2011-01-05T23:42:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Chapter 8 - Advanced use of control areas=&lt;br /&gt;
&lt;br /&gt;
The main set of SCI tutorials shows that the way to check if the ego is on a particular control area is the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;(instance RoomScript of Script&lt;br /&gt;
  (properties)&lt;br /&gt;
  (method (doit)&lt;br /&gt;
    (if(== (send gEgo:onControl()) ctlGREEN)&lt;br /&gt;
      (send gRoom:newRoom(1))&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the ego is on GREEN, then he is sent to a new room.&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s only part of the story.  The value returned by &amp;#039;&amp;#039;&amp;#039;onControl()&amp;#039;&amp;#039;&amp;#039; is actually a bit mask, which can contain any combination of the following values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
These are defined in sci.sh:&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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;(define ctlBLACK                       $0001)&lt;br /&gt;
(define ctlNAVY                        $0002)&lt;br /&gt;
(define ctlGREEN                       $0004)&lt;br /&gt;
(define ctlTEAL                        $0008)&lt;br /&gt;
(define ctlMAROON                      $0010)&lt;br /&gt;
(define ctlPURPLE                      $0020)&lt;br /&gt;
(define ctlBROWN                       $0040)&lt;br /&gt;
(define ctlSILVER                      $0080)&lt;br /&gt;
(define ctlGREY                        $0100)&lt;br /&gt;
(define ctlBLUE                        $0200)&lt;br /&gt;
(define ctlLIME                        $0400)&lt;br /&gt;
(define ctlCYAN                        $0800)&lt;br /&gt;
(define ctlRED                         $1000)&lt;br /&gt;
(define ctlFUCHSIA                     $2000)&lt;br /&gt;
(define ctlYELLOW                      $4000)&lt;br /&gt;
(define ctlWHITE                       $8000)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes sense, because the &amp;#039;footprint&amp;#039; of the ego (or any &amp;#039;&amp;#039;&amp;#039;Act&amp;#039;&amp;#039;&amp;#039; class) is actually a two-dimensional area, not a single point.Â  Therefore, he may be on several colors at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
To detect if the ego is &amp;#039;&amp;#039;completely&amp;#039;&amp;#039; on one color do the following:&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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;        (if (== (send gEgo:onControl()) ctlGREEN)&lt;br /&gt;
            // Ego is completely on green (no part of his footprint hits black, even).&lt;br /&gt;
        )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
To detect if some part of the ego&amp;#039;s footprint is touching a particular color:&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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;        (if (&amp;amp; (send gEgo:onControl()) ctlGREEN)&lt;br /&gt;
            // Part of ego is touching green.&lt;br /&gt;
        )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
To detect if the ego is touching one or more of ctlGREEN and ctlCYAN, do the following:&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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;        (if (&amp;amp; (send gEgo:onControl()) (| ctlGREEN ctlCYAN))&lt;br /&gt;
            // Ego is touching green or cyan.&lt;br /&gt;
        )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
To detect if the ego is touching both ctlGREEN and ctlCYAN exclusively, do the following:&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;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;        (if (&amp;amp; (send gEgo:onControl()) (| ctlGREEN ctlCYAN))&lt;br /&gt;
            // Ego is touching green or cyan.&lt;br /&gt;
        )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basically, just remember it is a bit-mask, so the &amp;#039;&amp;amp;amp;&amp;#039; and &amp;#039;|&amp;#039; operators are your friends.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;float: left&amp;quot;&amp;gt;[[Memory Management|&amp;amp;lt; Previous: Chapter 7 - Memory Management (advanced)]]&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;float: right&amp;quot;&amp;gt;[[SCI_Point_and_Click_Tutorial|Next: Cloudee1&amp;#039;s SCI Point and Click Tutorial &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[[Category:Control Areas]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
</feed>