thanks for the ideas, i've rescaled the objects a bit since i uploaded those files. i don't think the missile idea is going to work afterall, i thought i could spawn a 'miningbeacon' (basically just a 'likeship-ed' nav point with a new role) near the asteroid cluster that the autominers would rolldice, and if successful, target this beacon and do a 'performattack' on it to fire their 'missiles'. the missiles would then travel close to the miningbeacon and explode (dealing no damage, just a simple 'becomeExplosion' command) spawning scoopable cargo pods stuffed full of minerals as a death action.
The AI at the moment seems to be rolling its dice correctly ("MINING"), occasionaly getting a result that sends it to the fire_missile branch ("EJECT_MINERALS") of the script, the autominers then re-orientate themselves to point at the beacon but they never fire a missile unless i blast them with a few laser shots - which is odd because the "attacked" command should send the autominer to the ("SHUTDOWN") branch untill hostiles have moved on, i hope you guys don't mind me posting so many requests for help!
anyway here's the ai script (with place holder comms messages to help debug the script and very good odds at rolling a 1) - is there a different way to launch a missile other than performattack? - i've made sure the autominers don't have lasers fitted only 3 missiles.
Code: Select all
{
GLOBAL = {
ENTER = (performTumble, "setStateTo: MINING");
EXIT = ();
UPDATE = ();
};
"MINING" = {
ENTER = (switchLightsOn);
"ROLL_1" = ("scanForNearestShipWithRole: player");
"TARGET_FOUND" = (setTargetToFoundTarget, "sendTargetCommsMessage: Hey, I rolled a 1!", "setStateTo: EJECT_MINERALS");
"ATTACKED" = (setTargetToPrimaryAggressor, "commsMessage: [griff_proc_alert]", "setStateTo: SHUTDOWN");
EXIT = ();
UPDATE = ("rollD: 3", "pauseAI: 4.0");
};
"SHUTDOWN" = {
ENTER = (switchLightsOff, "pauseAI: 20.0", "setDesiredRangeTo: 30000.0", scanForHostiles);
"NOTHING_FOUND" = ("setStateTo: MINING");
EXIT = ();
UPDATE = ("pauseAI: 20.0", scanForHostiles);
};
"EJECT_MINERALS" = {
ENTER = ("setDesiredRangeTo: 30000.0", "scanForNearestShipWithRole: griff_buoy");
"TARGET_FOUND" = (setTargetToFoundTarget, performAttack, "pauseAI: 20.0", "setStateTo: MINING");
"NOTHING_FOUND" = ("setStateTo: WHERE_BUOY");
UPDATE = ();
EXIT = ();
};
"WHERE_BUOY" = {
ENTER = ("scanForNearestShipWithRole: player");
"TARGET_FOUND" = (setTargetToFoundTarget, "sendTargetCommsMessage: Can't find the Griff_buoy!", "setStateTo: MINING");
EXIT = ();
UPDATE = ("pauseAI: 20.0", scanForHostiles);
};
}
again, thanks for all the help on this and sorry for de-railing the thread yet again!