Difference between revisions of "ExitingTraderAI"
From Elite Wiki
Eric Walch (talk | contribs) (script example from Oolite -> scripting page) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
*'''ATTACK_SHIP:''' ->HEAD_AWAY_FROM_PLANET |
*'''ATTACK_SHIP:''' ->HEAD_AWAY_FROM_PLANET |
||
*'''FLEE:''' ->HEAD_AWAY_FROM_PLANET, ->ATTACK_SHIP |
*'''FLEE:''' ->HEAD_AWAY_FROM_PLANET, ->ATTACK_SHIP |
||
+ | |||
+ | One AI reference: [[route1traderAI]].plist |
||
Line 21: | Line 23: | ||
: |
: |
||
"EXIT_SYSTEM" = { |
"EXIT_SYSTEM" = { |
||
− | + | ENTER = (); |
|
− | + | EXIT = (); |
|
− | + | UPDATE = (performHyperSpaceExit); }; |
|
: |
: |
||
FLEE = { |
FLEE = { |
||
Line 55: | Line 57: | ||
[[AI|BACK]] |
[[AI|BACK]] |
||
+ | |||
+ | [[Category:Oolite scripting]] |
Latest revision as of 13:11, 2 January 2011
Defines standard behaviour for traders exiting the system.
Defined states:
- GLOBAL: ->HEAD_AWAY_FROM_PLANET
- HEAD_AWAY_FROM_PLANET: ->EXIT_SYSTEM, ->ATTACK_SHIP, ->FLEE
- EXIT_SYSTEM: ->performHyperspaceExit
- ATTACK_SHIP: ->HEAD_AWAY_FROM_PLANET
- FLEE: ->HEAD_AWAY_FROM_PLANET, ->ATTACK_SHIP
One AI reference: route1traderAI.plist
{ "ATTACK_SHIP" = { "ENERGY_LOW" = ("setSpeedFactorTo: 1.0", "pauseAI: 15.0", "setStateTo: EXIT_SYSTEM"); ENTER = (performAttack); EXIT = (); "INCOMING_MISSILE" = (fightOrFleeMissile, "setSpeedFactorTo: 1.0", "pauseAI: 15.0", "setStateTo: EXIT_SYSTEM"); "TARGET_DESTROYED" = ("setStateTo: HEAD_AWAY_FROM_PLANET"); "TARGET_LOST" = ("setStateTo: HEAD_AWAY_FROM_PLANET"); UPDATE = (); };
"EXIT_SYSTEM" = { ENTER = (); EXIT = (); UPDATE = (performHyperSpaceExit); };
FLEE = { ATTACKED = (fightOrFleeHostiles); FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE"); "TARGET_LOST" = (performIdle, "setStateTo: GLOBAL"); "TARGET_DESTROYED" = (performIdle, "setStateTo: GLOBAL"); ENTER = ("setDesiredRangeTo: 25600", performFlee); EXIT = (); "INCOMING_MISSILE" = (setTargetToPrimaryAggressor, broadcastDistressMessage, fightOrFleeMissile); "REACHED_SAFETY" = (performIdle, "setStateTo: GLOBAL"); UPDATE = (); };
"HEAD_AWAY_FROM_PLANET" = { ENTER = (getWitchspaceEntryCoordinates, setDestinationFromCoordinates, "setDesiredRangeTo: 100.0", "setSpeedFactorTo: 0.75", performFlyToRangeFromDestination); "DESIRED_RANGE_ACHIEVED" = (dockEscorts, "setSpeedFactorTo: 1.0", "pauseAI: 15.0", "setStateTo: EXIT_SYSTEM"); ATTACKED = (fightOrFleeHostiles); FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); "EXITED WITCHSPACE" = ("setAITo: route1traderAI.plist"); EXIT = (); UPDATE = (); };
GLOBAL = { ENTER = ("setStateTo: HEAD_AWAY_FROM_PLANET"); EXIT = (); UPDATE = (); }; }