Basic station AI

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Basic station AI

Post by spara » Sun Aug 07, 2016 9:46 am

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 .

Post Reply