Page 1 of 1

Random hits problemos

Posted: Tue Jul 21, 2009 1:45 pm
by Pasi
Hello everybody.

I have been playing Oolite with Random hits for a while now and enjoying it very much. After getting my new Mac I have been getting strange messages with lots of underscores. Also bulleting boards on space bars seem look very confusing. This is what it looks like: random_hits_makeoffer3_start random_hits_makeoffer3_start_levelone etc..

I have re installed oolite as well as random hits. Tried with or without other oxps. Im using macbook pro, oolite 1.72.2. and random hits 1.3.5

Maybe i should try older version of Random hits? Does anyone know where to get it from, please?

Thank you very many

Force be with all of you


Pasi

Posted: Tue Jul 21, 2009 1:50 pm
by DaddyHoggy
Hi Pasi - welcome to the Forums!

I think your problem can be solved by looking in this part of the Random Hits thread:

https://bb.oolite.space/viewtopic.ph ... &start=330

Hope this helps

DH

Posted: Tue Jul 21, 2009 3:00 pm
by Pasi
Thank you for quick reply.

Ill have a look.



Thanks again



P

Posted: Tue Jul 21, 2009 8:55 pm
by LittleBear
Sorry about that. I'll try and upload a fixed version by the weekend, but ATM you'll need to fix it by removing that pesky German style u and then start Oolite holding SHIFT down, the first time you start up after fixing it. Basically that u is a valid character on Vista but not on the Mac, so the Mac won't read the file that contains all the words for the random generator.

Posted: Wed Jul 22, 2009 12:50 pm
by Pasi
Thank you Little Bear.


Appreciated.



Pasi

Posted: Sat Aug 08, 2009 10:03 am
by Eric Walch
A few weeks ago I did a RH kill and today again. I use version 1.3.5. There must be a serious bug in the escort AI of the mark as I always caught them attacking their master. When making an entity dump, immediately after entering the system, you often see that the escorts are already in attack mode.
I now just killed my mark but his escorts were helping me killing it. Now I get a message I killed it but are fined for using "pusillanimous" practice. (I need a dictionary for that but I have a rough idea of its meaning) I played fair, can I help that the mark uses unreliable escorts?

Anyhow, that is 4 times in a row I found RH mark escorts killing my mark.

Posted: Sat Aug 08, 2009 10:20 am
by LittleBear
Hmm thats decidely odd. The AIs of the marks don't yet have any friendly fire code added, although the escorts do (at least i think they do - its been a while since a checked the marks AIs as I for the last release I'd concentrated on the AIs for the hunters / bars / super criminals), so the AIs for marks as still the same as the ones from 1.2. Improving their AIs is on my to do list, but I'd left it until last as I wanted to use a modded version of the randomhitsbigbossAI (in the OXP ATM but not used by anything yet as this is the AI for randomly generated hunter-killer in system missions, which are turned off as I haven't finished code for generating them yet). As I'm still working on a generic criminal patrol AI, I'd wanted to get this one right before using it as a base for the new mark's AI. I'm not quite sure how they turned on their master unless they somehow got shunted into route1patrolAI?

The somewhat odd way the characters speak is due to writing one line and then using an on-line theasures to swap each word to a word list of words meaning the same thing.

:wink:

Posted: Sat Aug 08, 2009 3:18 pm
by Eric Walch
LittleBear wrote:
Hmm thats decidely odd. The AIs of the marks don't yet have any friendly fire code added, although the escorts do (at least i think they do - its been a while since a checked the marks AIs as I for the last release :wink:
No it is the escort AI that might go for the wrong one for unknown reason.

Posted: Sat Aug 08, 2009 6:39 pm
by LittleBear
Thats what is puzzeling me. Although I haven't added any friendly fire code to the Mark's AI (so it will return fire on an escort that hits it by mistake), I had (I thought) added it to the escorts's AI, so escorts shouldn't fire on the mark they are escorting as they have no reaction to ATTACKED =, even though the Mark could fire on an escort that hit it by mistake. This is the AI the escorts should be using :-

Code: Select all

{
    

GLOBAL = {
ENTER = ("setStateTo: BEGIN_BUSINESS");
EXIT = ();
UPDATE = (); };

"FLYING_ESCORT" = {

ENTER = (performEscort);
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
RESTARTED = ("setStateTo: BEGIN_BUSINESS");

ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);

"NOT_ESCORTING" = ("setStateTo: LOOK_FOR_BUSINESS");
"TARGET_LOST" = ("setStateTo: LOOK_FOR_BUSINESS");
"TARGET_DESTROYED" = ("setStateTo: LOOK_FOR_BUSINESS");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");

EXIT = ();

UPDATE = (escortCheckMother, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
 
    };

"BEGIN_BUSINESS" = {
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 

ENTER = (escortCheckMother);
EXIT = ();

ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");

"NOT_ESCORTING" = ("setStateTo: LOOK_FOR_PLAYER");

UPDATE = (escortCheckMother, "pauseAI: 1.0"); 
    };

"LOOK_FOR_PLAYER" = {
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 

ENTER = ("scanForNearestShipWithPrimaryRole: player");
EXIT = ();

"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");

"NOTHING_FOUND" = ("setStateTo: LOOK_FOR_BUSINESS");
UPDATE = ("scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0"); 
    };

"LOOK_FOR_BUSINESS" = {


RESTARTED = ("setStateTo: BEGIN_BUSINESS");

ENTER = (scanForFormationLeader);
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
EXIT = ();

ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");

"TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort);
"NOTHING_FOUND" = ("switchAITo: randomhitsmarkrevenge2AI.plist");
UPDATE = (scanForFormationLeader); 
    };

"ATTACK_SHIP" = {
ENTER = (performAttack); 
"ENEMY_ATTACK" = (setTargetToPrimaryAggressor);
"ENERGY_LOW" = (performAttack); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile);
"TARGET_DESTROYED" = ("setStateTo: BEGIN_BUSINESS"); 
"TARGET_LOST" = ("setStateTo: BEGIN_BUSINESS");
"FRUSTRATED" = (performAttack);
UPDATE = (); 
EXIT = ();     };


 
}

I'd deliberatley missed out any response to "ATTACKED =", so the escorts should only react to a script message of "ENEMY_ATTACK =". Odd. I suspect that they can still be switched into one of the random hits AIs that doesn't yet have friendly fire code implemented.

If they lose their mother, then they should switch to this patrol AI, but this AI does not respond to a normal "ATTACKED =" either.

Code: Select all

{    

GLOBAL = {
ENTER = ("setSpeedFactorTo: 0.75", "setStateTo: HEAD_FOR_PLANET");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile,  "setStateTo: ATTACK_SHIP"); 
UPDATE = (); 
EXIT = (); 
    }; 

"ATTACK_SHIP" = {
ENTER = (performIdle, performAttack);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT"); 
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToPrimaryAggressor);
"ENERGY_LOW" = (performIdle, performAttack); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile);
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL"); 
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = (); 
EXIT = ();     };

"ATTACK_SELECTED_TARGET" = {
ENTER = (performIdle, performAttack);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK"); 
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToPrimaryAggressor);
"ENERGY_LOW" = (performIdle, performAttack); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile);
"TARGET_DESTROYED" = ("switchAITo: randomhitsmarkrevenge2AI.plist"); 
"TARGET_LOST" = ("switchAITo: randomhitsmarkrevenge2AI.plist");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = (); 
EXIT = ();     };

"FRIENDLY_FIRE_INCIDENT" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: DECIDE_PATROL");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL");      };

"DECIDE_PATROL" = {
ENTER = ("rollD: 2");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"APPROACHING_SURFACE" = (landOnPlanet);

"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"ROLL_1" = (performIdle, "setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = (performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");
UPDATE = (); 
EXIT = (); 
    }; 

"HEAD_FOR_PLANET" = {		
ENTER = ("setSpeedFactorTo: 0.75", setCourseToPlanet, "setDesiredRangeTo: 115000.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_PLANET");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_PLANET");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");

"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (setCourseToPlanet, "setDesiredRangeTo: 115000.0", checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		
	
};
 
"GO_TO_WAYPOINT_PLANET" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_PLANET");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_PLANET");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");

"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		


	};

"NEW_WAYPOINT_PLANET" =
	{

ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");

"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_PLANET");

"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_PLANET");

"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_PLANET");
		

"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");

"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
	

};


"ARRIVED_AT_PLANET" = {
ENTER = (setTargetToSystemStation, performIdle, "rollD: 2");

"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget,   "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,  fightOrFleeMissile,  "setStateTo: ATTACK_SHIP"); 
"ROLL_1" = (performIdle, "setStateTo: FACE_STATION");
"ROLL_2" = (performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");
UPDATE = ();
EXIT = ();
	};

"FACE_STATION" = {
ENTER = ("setSpeedFactorTo: 0.1", setTargetToSystemStation, performIdle, "setDesiredRangeTo: 5000.0", setDestinationToTarget, performFaceDestination);

"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,  fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
"FACING_DESTINATION" = ("setSpeedFactorTo: 0.5", "setStateTo: HEAD_FOR_STATION"); 
UPDATE = ("pauseAI: 3.0", "setSpeedFactorTo: 0.5", "setStateTo: HEAD_FOR_STATION");
EXIT = ();
	};

"HEAD_FOR_STATION" = {		
ENTER = ("setSpeedFactorTo: 0.75", setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_STATION");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);

"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
"NOTHING_FOUND" = ("setStateTo: RANGE_CHECK_STATION");
UPDATE = (setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		
	
};
 
"GO_TO_WAYPOINT_STATION" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget,   "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,   fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_STATION");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		


	};

"NEW_WAYPOINT_STATION" =
 {

ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");

"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_STATION");

"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_STATION");

"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_STATION");

"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);		

"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"TARGET_FOUND" = (setTargetToFoundTarget,  "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
	

};


"RANGE_CHECK_STATION" = {		
ENTER = ("setSpeedFactorTo: 0.75", setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, "pauseAI: 2.0");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,   fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");

UPDATE = (setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, "setStateTo: STATION_CHECK");
EXIT = ();
		
	
};

"STATION_CHECK" = {
"ENTER" = (setTargetToSystemStation, performIdle, "scanForNearestShipHavingAnyRole: station coriolis oolite-coriolis-station dodo dodec dodecahedron oolite-dodecahedron-station ico icosa icosahedron oolite-icosahedron-station");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"EXIT" = ();
"NOTHING_FOUND" = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_STATION");
"TARGET_FOUND" = ("setStateTo: ARRIVED_AT_STATION");
"UPDATE" = ("scanForNearestShipHavingAnyRole: station coriolis oolite-coriolis-station dodo dodec dodecahedron oolite-dodecahedron-station ico icosa icosahedron oolite-icosahedron-station");

};

"ARRIVED_AT_STATION" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");

"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,  fightOrFleeMissile, "setStateTo: ATTACK_SHIP"); 
UPDATE = ();
EXIT = ();
	};

"HEAD_FOR_WITCHPOINT" = {		
ENTER = ("setSpeedFactorTo: 0.75", setCourseToWitchpoint, checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);

"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
"NOTHING_FOUND" = ("setStateTo: RANGE_CHECK_WITCHPOINT");
UPDATE = (setCourseToWitchpoint, checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		
	
};
 
"GO_TO_WAYPOINT_WITCHPOINT" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget,   "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,   fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
		


	};

"NEW_WAYPOINT_WITCHPOINT" =
 {

ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");

"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_WITCHPOINT");

"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");

"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WITCHPOINT");

"APPROACHING_SURFACE" = (landOnPlanet);		

"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"TARGET_FOUND" = (setTargetToFoundTarget,  "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
	

};


"RANGE_CHECK_WITCHPOINT" = {
"ENTER" = (setTargetToSystemStation, performIdle, "scanForNearestShipHavingAnyRole: buoy-witchpoint oolite-buoy-witchpoint repaired-buoy-witchpoint");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"EXIT" = ();
"NOTHING_FOUND" = (setTargetToSystemStation, performIdle, "setStateTo: COURSE_CHECK_WITCHPOINT");
"TARGET_FOUND" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"UPDATE" = ("scanForNearestShipHavingAnyRole: buoy-witchpoint oolite-buoy-witchpoint repaired-buoy-witchpoint");	};

"COURSE_CHECK_WITCHPOINT" = {		
ENTER = ("setSpeedFactorTo: 0.75", setCourseToWitchpoint, checkCourseToDestination, "pauseAI: 2.0");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget,   "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget,   fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);

UPDATE = (setCourseToWitchpoint, checkCourseToDestination, "setStateTo: HEAD_FOR_WITCHPOINT");
EXIT = ();
	};


"ARRIVED_AT_WITCHPOINT" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_PLANET");

"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile,  "setStateTo: ATTACK_SHIP"); 
UPDATE = ();
EXIT = ();
	};

"DEAL_WITH_TURRET_ATTACK" = {
ENTER = ("rollD: 2");

"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = ("setStateTo: ATTACK_SPACEBAR");
"ROLL_2" = ("setAITo: randomhitsbreakoff3AI.plist");
"ROLL_3" = ("setAITo: randomhitsbreakoff3AI.plist");
UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL");
	};

"ATTACK_SPACEBAR" = {
ENTER = (performIdle, performAttack); 
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"ENERGY_LOW" = ("setStateTo: CRIMINAL_HURT"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL"); 
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = (); 
EXIT = ();     };

"CRIMINAL_HURT" = {
ENTER = ("rollD: 2");

"APPROACHING_SURFACE" = (landOnPlanet);

"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = ("setStateTo: FLEE_BAR");
"ROLL_2" = ("setStateTo: FIGHT_BAR");
UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL");
	};

"FLEE_BAR" = {
ENTER = ("addFuel: 3", "setSpeedFactorTo: 2.0", "setDesiredRangeTo: 5500", performFlee);
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");  
"TARGET_LOST" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL"); 
"TARGET_DESTROYED" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
"NO_TARGET" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL"); 
EXIT = ();  
"REACHED_SAFETY" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
"DESIRED_RANGE_ACHIEVED" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
UPDATE = ();     };


"FIGHT_BAR" = {
ENTER = (performIdle, performAttack); 
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL"); 
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = (); 
EXIT = ();     };


}

:?

Posted: Sat Aug 08, 2009 9:11 pm
by Eric Walch
LittleBear wrote:
Thats what is puzzeling me. Although I haven't added any friendly fire code to the Mark's AI (so it will return fire on an escort that hits it by mistake), I had (I thought) added it to the escorts's AI, so escorts shouldn't fire on the mark they are escorting as they have no reaction to ATTACKED =, even though the Mark could fire on an escort that hit it by mistake. This is the AI the escorts should be using :- :?
No they don't switch AI. They are still in their original AI. I also did not see why it went wrong with this AI. On thing that can be done is not setting the AI with the ship-script, but define an auto_ai key for all escorts and set it to false. That way oolite itself sets up the right ai_type for you.
This works since 1.71 I think. Before escorts would always get the default escortAI.

EDIT: Now you change the escortAI on shipSpawned. This triggers about one or two seconds after spawning. Without auto_ai or with auto_ai is true, the normal escortAI runs during that initial period. The only thing I can come with is that AI already did a scanForFormationLeader and has a FOUND_TARGET set when you switch AI. Your AI reads it in and attacks this ship. When using auto_ai is false, the default ai will never used as starting ai.

Posted: Sun Aug 09, 2009 10:21 am
by LittleBear
Ahh. That could be it. I'll add an auto-ai false key to all the escorts in the OXP.