Difference between revisions of "BuoyAI"

From Elite Wiki
m
(script example from Oolite -> scripting page)
 
Line 1: Line 1:
 
This AI has only one state, the mandatory ''GLOBAL'' state, and responds to only two messages: ''ENTER'' which is sent when the AI enters the state and whichtells the piloting behaviour to idle, and ''ATTACKED'' which is sent when the ship suffers damage from an aggressor and to which the buoy responds by targetting the aggressor and broadcasting a distress message.
 
This AI has only one state, the mandatory ''GLOBAL'' state, and responds to only two messages: ''ENTER'' which is sent when the AI enters the state and whichtells the piloting behaviour to idle, and ''ATTACKED'' which is sent when the ship suffers damage from an aggressor and to which the buoy responds by targetting the aggressor and broadcasting a distress message.
<dict>
+
  {
  <key>GLOBAL</key>
+
  GLOBAL =
  <dict>
+
  {
  <key>ATTACKED</key>
+
  ENTER = (performIdle);
  <array>
+
  ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage);
<string>setTargetToPrimaryAggressor</string>
+
  UPDATE = ("pauseAI: 3600");
<string>broadcastDistressMessage</string>
+
  };
  </array>
+
  }
<key>ENTER</key>
+
 
<array>
 
<string>performIdle</string>
 
</array>
 
<key>EXIT</key>
 
<array/>
 
<key>UPDATE</key>
 
<array/>
 
  </dict>
 
  </dict>
 
  
 
== Links ==
 
== Links ==
 
Back to: [[AI]]
 
Back to: [[AI]]
  
[[Category:Oolite]]
+
[[Category:Oolite scripting]]

Latest revision as of 12:00, 2 January 2011

This AI has only one state, the mandatory GLOBAL state, and responds to only two messages: ENTER which is sent when the AI enters the state and whichtells the piloting behaviour to idle, and ATTACKED which is sent when the ship suffers damage from an aggressor and to which the buoy responds by targetting the aggressor and broadcasting a distress message.

 {
	GLOBAL =
	{
		ENTER = (performIdle); 
		ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage); 
		UPDATE = ("pauseAI: 3600"); 
	}; 
}


Links

Back to: AI