Difference between revisions of "OXP howto AI"
(shipEntityAI laid out) |
(filled in some) |
||
Line 2: | Line 2: | ||
− | acceptDistressMessageFrom:(ShipEntity *)other; |
+ | === acceptDistressMessageFrom:(ShipEntity *)other; === |
+ | Has police either respond to a distress call, or possibly decide it is too busy or too scared. |
||
− | addFuel:(NSString*) fuel_number; |
+ | === addFuel:(NSString*) fuel_number; === |
− | broadcastDistressMessage; |
+ | === broadcastDistressMessage; === |
+ | Locates all the stations, bounty hunters and police ships in range and tells them that you are under attack. |
||
− | checkCourseToDestination; |
+ | === checkCourseToDestination; === |
+ | Will return "COURSE_OK" or in case of obstacles on the direct route, "WAYPOINT_SET". |
||
− | checkDistanceTravelled; |
+ | === checkDistanceTravelled; === |
+ | May return "GONE_BEYOND_RANGE". |
||
− | checkGroupOddsVersusTarget; |
+ | === checkGroupOddsVersusTarget; === |
+ | Will return "ODDS_GOOD" or "ODDS_BAD". |
||
− | checkForFullHold; |
+ | === checkForFullHold; === |
+ | If entity's cargo capacity is reached, will return "HOLD_FULL". |
||
− | checkForMotherStation; |
+ | === checkForMotherStation; === |
+ | Will return "STATION_FOUND" or "NOTHING_FOUND". |
||
− | checkForNormalSpace; |
+ | === checkForNormalSpace; === |
+ | Will return "NORMAL_SPACE" or "INTERSTELLAR_SPACE". |
||
− | checkTargetLegalStatus; |
+ | === checkTargetLegalStatus; === |
+ | Returns "TARGET_CLEAN, "TARGET_MINOR_OFFENDER", "TARGET_OFFENDER", "TARGET_FUGITIVE" or "NO_TARGET". |
||
− | commsMessage:(NSString *)valueString; |
+ | === commsMessage:(NSString *)valueString; === |
− | ejectCargo; |
+ | === ejectCargo; === |
+ | Ejects cargo. |
||
− | enterTargetWormhole; |
+ | === enterTargetWormhole; === |
+ | Will locate nearest wormhole, and enter it. |
||
− | escortCheckMother; |
+ | === escortCheckMother; === |
+ | Returns "ESCORTING" or "NOT_ESCORTING". |
||
− | exitAI; |
+ | === exitAI; === |
+ | Exits current AI. |
||
− | fightOrFleeHostiles; |
+ | === fightOrFleeHostiles; === |
+ | Has entity consider whether to fight, deploy missiles or flee. Returns "FIGHTING", "DEPLOYING_ESCORTS" or "FLEEING". |
||
− | fightOrFleeMissile; |
+ | === fightOrFleeMissile; === |
+ | Deals with missiles, launches ECM if available, flees if not, marks as offender if police. |
||
− | findNearestPlanet; |
+ | === findNearestPlanet; === |
+ | (PlanetEntity *) |
||
− | getWitchspaceEntryCoordinates; |
+ | === getWitchspaceEntryCoordinates; === |
+ | Calculates coordinates from the nearest station it can find, or just fly 10s forward. |
||
− | groupAttackTarget; |
+ | === groupAttackTarget; === |
− | initialiseTurret; |
+ | === initialiseTurret; === |
+ | Prepares the turret. |
||
− | landOnPlanet; |
+ | === landOnPlanet; === |
+ | Selects the nearest planet it can find, lands (10km from planet) and 'removes' the entity. |
||
− | markTargetForFines; |
+ | === markTargetForFines; === |
+ | Deals out a fine. |
||
− | messageMother:(NSString *)msgString; |
||
+ | === markTargetForOffence:(NSString*) valueString; === |
||
+ | Has police mark up the criminal status. |
||
+ | === messageMother:(NSString *)msgString; === |
||
− | numberOfShipsInGroup:(int) ship_group_id; |
||
+ | === patrolReportIn; === |
||
− | patrolReportIn; |
||
+ | === pauseAI:(NSString *)intervalString; === |
||
+ | Sets AI think-time. |
||
− | pauseAI:(NSString *)intervalString; |
||
+ | === performAttack; === |
||
+ | Attacks target. |
||
− | performAttack; |
||
+ | === performCollect; === |
||
+ | Performs 'collection' of target. |
||
− | performCollect; |
||
+ | === performDocking; === |
||
+ | NOT YET IMPLEMENTED. |
||
− | performDocking; |
||
+ | === performEscort; === |
||
+ | Performs escorting. |
||
− | performEscort; |
||
+ | === performFaceDestination; === |
||
+ | Has entity face destination. |
||
− | performFaceDestination; |
||
+ | === performFlee; === |
||
+ | Performs the flee. |
||
− | performFlee; |
||
+ | === performFlyToRangeFromDestination; === |
||
+ | NOT YET IMPLEMENTED |
||
− | performFlyToRangeFromDestination; |
||
+ | === performHold; === |
||
+ | Performs idleness while tracking a potential target. |
||
− | performHold; |
||
+ | === performHyperSpaceExit; === |
||
+ | Gets a list of destinations within range, checks if clear of nearby masses, and select one at random. May return "WITCHSPACE UNAVAILABLE" or "WITCHSPACE BLOCKED". |
||
− | performHyperSpaceExit; |
||
+ | === performIdle; === |
||
+ | Performs idleness. |
||
− | performIdle; |
||
+ | === performIntercept; === |
||
+ | Performs target interception. |
||
− | performIntercept; |
||
+ | === performMining; === |
||
+ | Performs mining. |
||
− | performMining; |
||
+ | === performTumble; === |
||
+ | Performs pitch and roll evasive maneuvers. |
||
− | performTumble; |
||
+ | === recallDockingInstructions; === |
||
− | recallDockingInstructions; |
||
+ | === requestDockingCoordinates; === |
||
+ | Requests coordinates from the nearest station it can find (which may be a rock hermit. |
||
− | requestDockingCoordinates; |
||
+ | === requestNewTarget; === |
||
+ | Locates all the ships in range targetting the mother ship, and chooses the nearest/biggest. |
||
− | requestNewTarget; |
||
+ | === rollD:(NSString*) die_number; === |
||
+ | Uses "dice" for random situation use. |
||
− | rollD:(NSString*) die_number; |
||
+ | === scanForFormationLeader; === |
||
+ | Locates the nearest suitable formation leader in range. |
||
− | scanForFormationLeader; |
||
+ | === scanForHostiles; === |
||
+ | Locates all the ships in range targetting the receiver and chooses the nearest. |
||
− | scanForHostiles; |
||
+ | === scanForLoot; === |
||
+ | Locates the nearest debris in range. |
||
− | scanForLoot; |
||
+ | === scanForNearestMerchantmen; === |
||
+ | Locates the nearest merchantman in range |
||
− | scanForNearestMerchantmen; |
||
+ | === scanForNearestShipWithRole:(NSString*) scanRole; === |
||
+ | Locates all the ships in range and chooses the nearest. |
||
− | scanForNearestShipWithRole:(NSString*) scanRole; |
||
+ | === scanForNonThargoid; === |
||
+ | Locates all the non thargoid ships in range and chooses the nearest. |
||
− | scanForNonThargoid; |
||
+ | === scanForOffenders; === |
||
+ | Locates all the ships in range and compares their legal status or bounty, and chooses the worst offender. |
||
− | scanForOffenders; |
||
+ | === scanForRandomLoot; === |
||
+ | Locates the all debris in range and chooses a piece at random from the first sixteen found. |
||
− | scanForRandomLoot; |
||
+ | === scanForRandomMerchantmen; === |
||
+ | Locates one of the merchantman in range. |
||
− | scanForRandomMerchantmen; |
||
+ | === scanForRocks; === |
||
+ | Locates the all boulders and asteroids in range and selects one of up to 16. Returns "TARGET_FOUND" or"NOTHING_FOUND". |
||
− | scanForRocks; |
||
+ | === scanForThargoid; === |
||
+ | Locates all the thargoid warships in range and chooses the nearest. |
||
− | scanForThargoid; |
||
+ | === scriptActionOnTarget:(NSString*) action; === |
||
+ | Will cause immediate reaction to any changes this makes. |
||
− | + | === sendTargetCommsMessage:(NSString*) message; === |
|
+ | Sends any message to the established (found) target. |
||
− | sendTargetCommsMessage:(NSString*) message; |
||
+ | Example: |
||
+ | "sendTargetCommsMessage: Listen to me!!" |
||
− | setAITo:(NSString *)aiString; |
+ | === setAITo:(NSString *)aiString; === |
+ | Changes to another *AI.plist, without clearing 'the stack'. |
||
− | setCoordinates:(NSString *)system_x_y_z; |
+ | === setCoordinates:(NSString *)system_x_y_z; === |
+ | Sets PWM destination coords. |
||
− | setCourseToPlanet; |
+ | === setCourseToPlanet; === |
+ | Selects the nearest planet it can find, reaching desired range 50 km from the planet. |
||
− | setCourseToWitchpoint; |
+ | === setCourseToWitchpoint; === |
+ | Sets destination coords to Witchpoint area. |
||
− | setDesiredRangeTo:(NSString *)rangeString; |
+ | === setDesiredRangeTo:(NSString *)rangeString; === |
+ | Defines acceptable range distance from destination. |
||
− | setDestinationFromCoordinates; |
+ | === setDestinationFromCoordinates; === |
− | setDestinationToCurrentLocation; |
+ | === setDestinationToCurrentLocation; === |
− | setDestinationToDockingAbort; |
+ | === setDestinationToDockingAbort; === |
− | setDestinationToStationBeacon; |
+ | === setDestinationToStationBeacon; === |
+ | Gets station beacon position. |
||
− | setDestinationToTarget; |
+ | === setDestinationToTarget; === |
+ | Sets destination to target coords. |
||
− | setDestinationToWitchpoint; |
+ | === setDestinationToWitchpoint; === |
+ | Sets destination coords to WitchspaceExitPosition. |
||
− | setDestinationWithinTarget; |
+ | === setDestinationWithinTarget; === |
− | setPlanetPatrolCoordinates; |
+ | === setPlanetPatrolCoordinates; === |
+ | Check we've arrived near the last given coordinates. |
||
− | setSpeedTo:(NSString *)speedString; |
+ | === setSpeedTo:(NSString *)speedString; === |
− | setSpeedFactorTo:(NSString *)speedString; |
+ | === setSpeedFactorTo:(NSString *)speedString; === |
− | setSunSkimEndCoordinates; |
+ | === setSunSkimEndCoordinates; === |
− | setSunSkimExitCoordinates; |
+ | === setSunSkimExitCoordinates; === |
− | setSunSkimStartCoordinates; |
+ | === setSunSkimStartCoordinates; === |
− | setTakeOffFromPlanet; |
+ | === setTakeOffFromPlanet; === |
+ | Selects the nearest planet it can find and adds entity 10 km from planet, unless there is no planet to be found. |
||
− | setTargetToFoundTarget; |
+ | === setTargetToFoundTarget; === |
+ | Affirms target as unversal target. |
||
− | setTargetToPrimaryAggressor; |
+ | === setTargetToPrimaryAggressor; === |
+ | Changes to a different enemy target if attacked, unless already very busy attacking another. |
||
− | suggestEscort; |
+ | === suggestEscort; === |
+ | Has an escort seek employment and either gets accepted or rejected by the "mother". |
||
− | switchAITo:(NSString *)aiString; |
+ | === switchAITo:(NSString *)aiString; === |
+ | Switches entity AI to another *AI.plist |
||
− | wormholeEntireGroup; |
+ | === wormholeEntireGroup; === |
+ | Wormholes ships in this group. |
||
− | wormholeEscorts; |
+ | === wormholeEscorts; === |
+ | Wormholes official escorts. |
||
− | wormholeGroup; |
+ | === wormholeGroup; === |
+ | Wormholes ships in group of which this is a leader. |
||
Revision as of 12:50, 21 January 2006
Contents
- 1 Methods for AI
- 1.1 acceptDistressMessageFrom:(ShipEntity *)other;
- 1.2 addFuel:(NSString*) fuel_number;
- 1.3 broadcastDistressMessage;
- 1.4 checkCourseToDestination;
- 1.5 checkDistanceTravelled;
- 1.6 checkGroupOddsVersusTarget;
- 1.7 checkForFullHold;
- 1.8 checkForMotherStation;
- 1.9 checkForNormalSpace;
- 1.10 checkTargetLegalStatus;
- 1.11 commsMessage:(NSString *)valueString;
- 1.12 ejectCargo;
- 1.13 enterTargetWormhole;
- 1.14 escortCheckMother;
- 1.15 exitAI;
- 1.16 fightOrFleeHostiles;
- 1.17 fightOrFleeMissile;
- 1.18 findNearestPlanet;
- 1.19 getWitchspaceEntryCoordinates;
- 1.20 groupAttackTarget;
- 1.21 initialiseTurret;
- 1.22 landOnPlanet;
- 1.23 markTargetForFines;
- 1.24 markTargetForOffence:(NSString*) valueString;
- 1.25 messageMother:(NSString *)msgString;
- 1.26 patrolReportIn;
- 1.27 pauseAI:(NSString *)intervalString;
- 1.28 performAttack;
- 1.29 performCollect;
- 1.30 performDocking;
- 1.31 performEscort;
- 1.32 performFaceDestination;
- 1.33 performFlee;
- 1.34 performFlyToRangeFromDestination;
- 1.35 performHold;
- 1.36 performHyperSpaceExit;
- 1.37 performIdle;
- 1.38 performIntercept;
- 1.39 performMining;
- 1.40 performTumble;
- 1.41 recallDockingInstructions;
- 1.42 requestDockingCoordinates;
- 1.43 requestNewTarget;
- 1.44 rollD:(NSString*) die_number;
- 1.45 scanForFormationLeader;
- 1.46 scanForHostiles;
- 1.47 scanForLoot;
- 1.48 scanForNearestMerchantmen;
- 1.49 scanForNearestShipWithRole:(NSString*) scanRole;
- 1.50 scanForNonThargoid;
- 1.51 scanForOffenders;
- 1.52 scanForRandomLoot;
- 1.53 scanForRandomMerchantmen;
- 1.54 scanForRocks;
- 1.55 scanForThargoid;
- 1.56 scriptActionOnTarget:(NSString*) action;
- 1.57 sendTargetCommsMessage:(NSString*) message;
- 1.58 setAITo:(NSString *)aiString;
- 1.59 setCoordinates:(NSString *)system_x_y_z;
- 1.60 setCourseToPlanet;
- 1.61 setCourseToWitchpoint;
- 1.62 setDesiredRangeTo:(NSString *)rangeString;
- 1.63 setDestinationFromCoordinates;
- 1.64 setDestinationToCurrentLocation;
- 1.65 setDestinationToDockingAbort;
- 1.66 setDestinationToStationBeacon;
- 1.67 setDestinationToTarget;
- 1.68 setDestinationToWitchpoint;
- 1.69 setDestinationWithinTarget;
- 1.70 setPlanetPatrolCoordinates;
- 1.71 setSpeedTo:(NSString *)speedString;
- 1.72 setSpeedFactorTo:(NSString *)speedString;
- 1.73 setSunSkimEndCoordinates;
- 1.74 setSunSkimExitCoordinates;
- 1.75 setSunSkimStartCoordinates;
- 1.76 setTakeOffFromPlanet;
- 1.77 setTargetToFoundTarget;
- 1.78 setTargetToPrimaryAggressor;
- 1.79 suggestEscort;
- 1.80 switchAITo:(NSString *)aiString;
- 1.81 wormholeEntireGroup;
- 1.82 wormholeEscorts;
- 1.83 wormholeGroup;
Methods for AI
acceptDistressMessageFrom:(ShipEntity *)other;
Has police either respond to a distress call, or possibly decide it is too busy or too scared.
addFuel:(NSString*) fuel_number;
broadcastDistressMessage;
Locates all the stations, bounty hunters and police ships in range and tells them that you are under attack.
checkCourseToDestination;
Will return "COURSE_OK" or in case of obstacles on the direct route, "WAYPOINT_SET".
checkDistanceTravelled;
May return "GONE_BEYOND_RANGE".
checkGroupOddsVersusTarget;
Will return "ODDS_GOOD" or "ODDS_BAD".
checkForFullHold;
If entity's cargo capacity is reached, will return "HOLD_FULL".
checkForMotherStation;
Will return "STATION_FOUND" or "NOTHING_FOUND".
checkForNormalSpace;
Will return "NORMAL_SPACE" or "INTERSTELLAR_SPACE".
checkTargetLegalStatus;
Returns "TARGET_CLEAN, "TARGET_MINOR_OFFENDER", "TARGET_OFFENDER", "TARGET_FUGITIVE" or "NO_TARGET".
commsMessage:(NSString *)valueString;
ejectCargo;
Ejects cargo.
enterTargetWormhole;
Will locate nearest wormhole, and enter it.
escortCheckMother;
Returns "ESCORTING" or "NOT_ESCORTING".
exitAI;
Exits current AI.
fightOrFleeHostiles;
Has entity consider whether to fight, deploy missiles or flee. Returns "FIGHTING", "DEPLOYING_ESCORTS" or "FLEEING".
fightOrFleeMissile;
Deals with missiles, launches ECM if available, flees if not, marks as offender if police.
findNearestPlanet;
(PlanetEntity *)
getWitchspaceEntryCoordinates;
Calculates coordinates from the nearest station it can find, or just fly 10s forward.
groupAttackTarget;
initialiseTurret;
Prepares the turret.
landOnPlanet;
Selects the nearest planet it can find, lands (10km from planet) and 'removes' the entity.
markTargetForFines;
Deals out a fine.
markTargetForOffence:(NSString*) valueString;
Has police mark up the criminal status.
messageMother:(NSString *)msgString;
patrolReportIn;
pauseAI:(NSString *)intervalString;
Sets AI think-time.
performAttack;
Attacks target.
performCollect;
Performs 'collection' of target.
performDocking;
NOT YET IMPLEMENTED.
performEscort;
Performs escorting.
performFaceDestination;
Has entity face destination.
performFlee;
Performs the flee.
performFlyToRangeFromDestination;
NOT YET IMPLEMENTED
performHold;
Performs idleness while tracking a potential target.
performHyperSpaceExit;
Gets a list of destinations within range, checks if clear of nearby masses, and select one at random. May return "WITCHSPACE UNAVAILABLE" or "WITCHSPACE BLOCKED".
performIdle;
Performs idleness.
performIntercept;
Performs target interception.
performMining;
Performs mining.
performTumble;
Performs pitch and roll evasive maneuvers.
recallDockingInstructions;
requestDockingCoordinates;
Requests coordinates from the nearest station it can find (which may be a rock hermit.
requestNewTarget;
Locates all the ships in range targetting the mother ship, and chooses the nearest/biggest.
rollD:(NSString*) die_number;
Uses "dice" for random situation use.
scanForFormationLeader;
Locates the nearest suitable formation leader in range.
scanForHostiles;
Locates all the ships in range targetting the receiver and chooses the nearest.
scanForLoot;
Locates the nearest debris in range.
scanForNearestMerchantmen;
Locates the nearest merchantman in range
scanForNearestShipWithRole:(NSString*) scanRole;
Locates all the ships in range and chooses the nearest.
scanForNonThargoid;
Locates all the non thargoid ships in range and chooses the nearest.
scanForOffenders;
Locates all the ships in range and compares their legal status or bounty, and chooses the worst offender.
scanForRandomLoot;
Locates the all debris in range and chooses a piece at random from the first sixteen found.
scanForRandomMerchantmen;
Locates one of the merchantman in range.
scanForRocks;
Locates the all boulders and asteroids in range and selects one of up to 16. Returns "TARGET_FOUND" or"NOTHING_FOUND".
scanForThargoid;
Locates all the thargoid warships in range and chooses the nearest.
scriptActionOnTarget:(NSString*) action;
Will cause immediate reaction to any changes this makes.
sendTargetCommsMessage:(NSString*) message;
Sends any message to the established (found) target.
Example:
"sendTargetCommsMessage: Listen to me!!"
setAITo:(NSString *)aiString;
Changes to another *AI.plist, without clearing 'the stack'.
setCoordinates:(NSString *)system_x_y_z;
Sets PWM destination coords.
setCourseToPlanet;
Selects the nearest planet it can find, reaching desired range 50 km from the planet.
setCourseToWitchpoint;
Sets destination coords to Witchpoint area.
setDesiredRangeTo:(NSString *)rangeString;
Defines acceptable range distance from destination.
setDestinationFromCoordinates;
setDestinationToCurrentLocation;
setDestinationToDockingAbort;
setDestinationToStationBeacon;
Gets station beacon position.
setDestinationToTarget;
Sets destination to target coords.
setDestinationToWitchpoint;
Sets destination coords to WitchspaceExitPosition.
setDestinationWithinTarget;
setPlanetPatrolCoordinates;
Check we've arrived near the last given coordinates.
setSpeedTo:(NSString *)speedString;
setSpeedFactorTo:(NSString *)speedString;
setSunSkimEndCoordinates;
setSunSkimExitCoordinates;
setSunSkimStartCoordinates;
setTakeOffFromPlanet;
Selects the nearest planet it can find and adds entity 10 km from planet, unless there is no planet to be found.
setTargetToFoundTarget;
Affirms target as unversal target.
setTargetToPrimaryAggressor;
Changes to a different enemy target if attacked, unless already very busy attacking another.
suggestEscort;
Has an escort seek employment and either gets accepted or rejected by the "mother".
switchAITo:(NSString *)aiString;
Switches entity AI to another *AI.plist
wormholeEntireGroup;
Wormholes ships in this group.
wormholeEscorts;
Wormholes official escorts.
wormholeGroup;
Wormholes ships in group of which this is a leader.
stub