Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Could NPCs be made more likley to jump out?

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

Post Reply
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Could NPCs be made more likley to jump out?

Post by LittleBear »

In playing the game, NPCs very rarely seem to make hyperspace jump to escape. As players we'd usually get a hyperspace lock on another system, if fuel's available, just in case things get really tough. I've seen em jump occasionally and following them though their own wormhole was cool. Would it be do-able to up the chance of NPCs jumping out when on ENERGY_LOW?
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

In Oolite\oolite.app\Contents\Resources\AIs\route1traderAI.plist, you'll find

Code: Select all

    FLEE = {
        ATTACKED = (fightOrFleeHostiles); 
		FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
		FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
        "TARGET_LOST" = (performIdle, "setStateTo: GLOBAL"); 
        "TARGET_DESTROYED" = (performIdle, "setStateTo: GLOBAL"); 
        ENTER = ("setDesiredRangeTo: 25600", performFlee); 
        EXIT = (); 
        "INCOMING_MISSILE" = (setTargetToPrimaryAggressor, broadcastDistressMessage, fightOrFleeMissile, fightOrFleeHostiles); 
        "REACHED_SAFETY" = (performIdle, "setStateTo: GLOBAL"); 
        UPDATE = (); 
Change

Code: Select all

		FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
to

Code: Select all

		FLEEING = (setTargetToPrimaryAggressor, "setSpeedFactorTo: 1.0", "pauseAI: 15.0", "setStateTo: EXIT_SYSTEM"); 
and add

Code: Select all

    "EXIT_SYSTEM" = {
		ENTER = ();
		EXIT = ();
		UPDATE = (performHyperSpaceExit);
		"WITCHSPACE OKAY" = (wormholeEscorts);
		"WITCHSPACE BLOCKED" = (setTargetToFoundTarget, setDestinationWithinTarget, "setDesiredRangeTo: 10000.0", performFlyToRangeFromDestination);
		"WITCHSPACE UNAVAILABLE" = ("setAITo: route1traderAI.plist");
	}; 
That should do it. Maybe?
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

I'll give that a try. I thought it might be hard coded, but that AI should work. Might do a quick brave_sir_robin.oxp hack. Make traders say 50% likely to jump out on energy low (if they can) and 50% likely to flee (either on injectors or normal power). Too higher chance or to low?
Last edited by LittleBear on Wed Jun 20, 2007 7:48 pm, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
johnsmith
Deadly
Deadly
Posts: 141
Joined: Fri Sep 22, 2006 10:32 am
Location: Teance
Contact:

Post by johnsmith »

I did an AI using that method, and can confirm that it worked. Of course you can allways follow then through the wormhole if you're quick.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

LittleBear wrote:
Might do a quick brave_sir_robin.oxp hack.
With soundtrack?

http://www.stmoroky.com/sirrobin/robin~~.au
http://www.stmoroky.com/sirrobin/meeting~~.au
http://www.stmoroky.com/sirrobin/fleeing~~.au

Or will the minstrels be eaten followed by much rejoicing?
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Done a tweaked AI (so installing the OXP gives all ships with the role "trader" this run-away AI). Doing a "sendCommsMessage: [runaway1] [runaway2] [runaway3] [tones] [cargo]" So the trader sends a random word from each list as a message when jumping out such as:-

"Beastly Brigand! I'm bravely running away to save my 7 tones of food!"

Wonder if I could make it play an .ogg at the same time!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Post Reply