Difference between revisions of "EnteringTraderAI"

From Elite Wiki
(script example from Oolite -> scripting page)
 
Line 1: Line 1:
 
The AI that entering 'trader-roles' entities get assigned, decides the route.
 
The AI that entering 'trader-roles' entities get assigned, decides the route.
 
Simple 2 state affair.
 
Simple 2 state affair.
  +
 
{
 
{
GLOBAL = {
+
GLOBAL =
ENTER = ("setStateTo: DECIDE_ROUTE");
+
{
EXIT = ();
+
ENTER = (performIdle, "setStateTo: DECIDE_ROUTE");
UPDATE = (); };
+
};
:
+
"DECIDE_ROUTE" = {
+
"DECIDE_ROUTE" =
ENTER = ("rollD: 3");
+
{
"ROLL_1" = ("switchAITo: route1traderAI.plist");
+
ENTER = ("rollD: 3");
"ROLL_2" = ("switchAITo: route1traderAI.plist");
+
"ROLL_1" = ("switchAITo: route1traderAI.plist");
"ROLL_3" = ("switchAITo: route2sunskimAI.plist");
+
"ROLL_2" = ("switchAITo: route1traderAI.plist");
EXIT = ();
+
"ROLL_3" = ("switchAITo: route2sunskimAI.plist");
UPDATE = ();};}
+
};
  +
}
   
 
'''[[AI|BACK]]'''
 
'''[[AI|BACK]]'''
   
[[Category:Oolite]]
+
[[Category:Oolite scripting]]

Latest revision as of 14:07, 2 January 2011

The AI that entering 'trader-roles' entities get assigned, decides the route. Simple 2 state affair.

{
	GLOBAL =
	{
		ENTER = (performIdle, "setStateTo: DECIDE_ROUTE");
	};
	"DECIDE_ROUTE" =
	{
		ENTER = ("rollD: 3");
		"ROLL_1" = ("switchAITo: route1traderAI.plist");
		"ROLL_2" = ("switchAITo: route1traderAI.plist");
		"ROLL_3" = ("switchAITo: route2sunskimAI.plist");
	};
}

BACK