AI help
Posted: Wed Dec 28, 2016 4:16 pm
I have a stranded liner - I set fuel = 0
I have NPC deliver fuel (see photo) using AI:
GLOBAL = {
ENTER = ("setStateTo: WAIT_FOR_PLAYER");
EXIT = ();
UPDATE = ();
};
"WAIT_FOR_PLAYER" = {
ENTER = ("setStateTo: FIND_STATION");
NOTHING_FOUND = ("setStateTo: HUNT_FOR_STATION");
EXIT = ();
UPDATE = ("scanForNearestShipWithRole: patrollinerwreck");
};
"FIND_STATION" = {
ENTER = ("scanForNearestShipWithRole: patrollinerwreck");
TARGET_FOUND = (setTargetToFoundTarget, "setAITo: dockingAI.plist");
NOTHING_FOUND = ("setStateTo: HUNT_FOR_STATION");
"RESTARTED" = ("scanForNearestShipWithRole: patrollinerwreck");
};
"HUNT_FOR_STATION" = {
ENTER = ("setSpeedFactorTo: 0.5", "targetFirstBeaconWithCode: Marooned StarLiner");
TARGET_FOUND = (setTargetToFoundTarget, "setStateTo: APPROACH_STATION");
NOTHING_FOUND = (setTargetToNearestStation, "setStateTo: APPROACH_STATION");
"RESTARTED" = ("setSpeedFactorTo: 0.5", "targetFirstBeaconWithCode: Marooned StarLiner");
};
"APPROACH_STATION" = {
ENTER = ("setSpeedFactorTo: 0.5", setDestinationToTarget, "setDesiredRangeTo: 10000");
"DESIRED_RANGE_ACHIEVED" = (dockEscorts, "setAITo: dockingAI.plist");
UPDATE = ("setDesiredRangeTo: 10000", "pauseAI: 5.0");
"RESTARTED" = ("setSpeedFactorTo: 0.5", "setStateTo: FIND_STATION");
};
How do I detect that the NPC has docked and assign fuel to the liner?
I have NPC deliver fuel (see photo) using AI:
GLOBAL = {
ENTER = ("setStateTo: WAIT_FOR_PLAYER");
EXIT = ();
UPDATE = ();
};
"WAIT_FOR_PLAYER" = {
ENTER = ("setStateTo: FIND_STATION");
NOTHING_FOUND = ("setStateTo: HUNT_FOR_STATION");
EXIT = ();
UPDATE = ("scanForNearestShipWithRole: patrollinerwreck");
};
"FIND_STATION" = {
ENTER = ("scanForNearestShipWithRole: patrollinerwreck");
TARGET_FOUND = (setTargetToFoundTarget, "setAITo: dockingAI.plist");
NOTHING_FOUND = ("setStateTo: HUNT_FOR_STATION");
"RESTARTED" = ("scanForNearestShipWithRole: patrollinerwreck");
};
"HUNT_FOR_STATION" = {
ENTER = ("setSpeedFactorTo: 0.5", "targetFirstBeaconWithCode: Marooned StarLiner");
TARGET_FOUND = (setTargetToFoundTarget, "setStateTo: APPROACH_STATION");
NOTHING_FOUND = (setTargetToNearestStation, "setStateTo: APPROACH_STATION");
"RESTARTED" = ("setSpeedFactorTo: 0.5", "targetFirstBeaconWithCode: Marooned StarLiner");
};
"APPROACH_STATION" = {
ENTER = ("setSpeedFactorTo: 0.5", setDestinationToTarget, "setDesiredRangeTo: 10000");
"DESIRED_RANGE_ACHIEVED" = (dockEscorts, "setAITo: dockingAI.plist");
UPDATE = ("setDesiredRangeTo: 10000", "pauseAI: 5.0");
"RESTARTED" = ("setSpeedFactorTo: 0.5", "setStateTo: FIND_STATION");
};
How do I detect that the NPC has docked and assign fuel to the liner?