<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=On_off_scripts</id>
	<title>On off scripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=On_off_scripts"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=On_off_scripts&amp;action=history"/>
	<updated>2026-04-21T05:31:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=On_off_scripts&amp;diff=2376&amp;oldid=prev</id>
		<title>Qrow: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=On_off_scripts&amp;diff=2376&amp;oldid=prev"/>
		<updated>2026-03-03T23:55:46Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 16:55, 3 March 2026&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>Qrow</name></author>
	</entry>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=On_off_scripts&amp;diff=2375&amp;oldid=prev</id>
		<title>interemmanuel&gt;Emmanuel: removed cob synthax</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=On_off_scripts&amp;diff=2375&amp;oldid=prev"/>
		<updated>2013-03-18T15:41:56Z</updated>

		<summary type="html">&lt;p&gt;removed cob synthax&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;---&amp;#039;&amp;#039;&amp;#039;know and change the on off button state&amp;#039;&amp;#039;&amp;#039;---&lt;br /&gt;
&lt;br /&gt;
defined in UnitDef by the tags:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ActivateWhenBuilt=false,&lt;br /&gt;
OnOffable=true,&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
switched by player or by script action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*detect the switching of on/off button &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local starton startoff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function script.Activate ( ) &lt;br /&gt;
&lt;br /&gt;
starton=1 &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function script.Deactivate ( ) &lt;br /&gt;
&lt;br /&gt;
startoff=1&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*know the state of on/off&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local isactive&lt;br /&gt;
&lt;br /&gt;
isactive==Spring.GetUnitIsActive(unitID)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*change the on/off state(1=on,0=off)&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local something&lt;br /&gt;
&lt;br /&gt;
if something==true&lt;br /&gt;
&lt;br /&gt;
then SetUnitValue (20,1) &lt;br /&gt;
&lt;br /&gt;
else SetUnitValue (20,0) &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
**note : the lua equivalent is maybe not possible&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[SpringRtsTutorialAnimDef]] return to the list of animDef exemples&lt;br /&gt;
&lt;br /&gt;
[[Category:Emmanuel]]&lt;/div&gt;</summary>
		<author><name>interemmanuel&gt;Emmanuel</name></author>
	</entry>
</feed>