Page 1 of 1

Basic station AI

Posted: Sun Aug 07, 2016 9:46 am
by spara
I'm messing with YAH stations' AI and would really, really much appreciate a basic station js AI that, on top of doing the basic defense and traffic control, would have it's own defense ship patrolling the station. Basically I would like to write something like this:

Code: Select all

this.aiStarted = function() {
...
	ai.setParameter("oolite_stationPatrolRole","tescoosecurity");
	ai.setPriorities([
...
		/* Patrol */
		{
			preconfiguration: ai.configurationCheckScanner,
			notcondition: ai.conditionScannerContainsPatrol,
			behaviour: ai.behaviourStationLaunchPatrol,
			reconsider: 60
		},
...
	]);
}
So logically after setting ai.setParameter("oolite_stationPatrolRole","tescoosecurity");, ai.conditionScannerContainsPatrol would check for "tescoosecurity" and ai.behaviourStationLaunchPatrol would launch "tescoosecurity" that would keep patrolling the station perimeter.

I'm not sure what ai.setParameter("oolite_stationPatrolRole","tescoosecurity"); and ai.conditionScannerContainsPatrol exactly achieve, but ai.behaviourStationLaunchPatrol always launches police ships.

Hope that makes some sense :D .