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

Hired Guns OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: [UPDATED] Hired Guns v1.23

Post by Thargoid »

Normal non-hostile ships are yellow on the scanner. Hence the escorts are yellow...

But it's not a difficult thing to change in your personal copy of the OXP if you wish to do so. Just change lines 69 and 99 in hiredGuns_system.js. Specifically if you want yellow/magenta, you'll need to insert a new line directly after the current lines 69 and 99 to read.

Code: Select all

this.escorts[i].scannerDisplayColor2 = "magentaColor";
scannerDisplayColor1 and scannerDisplayColor2 are the two colours used for the lollipop (if only one is defined then the lollipop is static colour).[/color]
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: [UPDATED] Hired Guns v1.23

Post by Zireael »

Well, the escorts are kind of special... Is there a chance we'll see the different colors in the next version?

BTW Thanks for the advice, will do it tomorrow.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: [UPDATED] Hired Guns v1.23

Post by Thargoid »

Zireael wrote:
Well, the escorts are kind of special... Is there a chance we'll see the different colors in the next version?

BTW Thanks for the advice, will do it tomorrow.
As you ask so nicely, I'll put it into v1.25. That'll be released after Oolite v1.75 comes out, in case I get any additional inspiration from the new code stuff...
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Hired Guns OXP

Post by RyanHoots »

I'm going to start taking it apart to see how it works. Who knows, in the end I might have an OXP that gives you escorts whenever you jump into an Anarchy, or more likely escorts on every single journey, for free! :D
Maybe a pair of Vortexes would help in a furball... :lol:
Image
Makara
Dangerous
Dangerous
Posts: 122
Joined: Sat Oct 17, 2009 6:34 pm

Re: Hired Guns OXP

Post by Makara »

Hmmm. Tried hiring some escorts recently (an odd combination of UPS missions - the "don't go through anarchies or feudals" delivery combined with "chase the pirate python in the feudal system" :shock: ) when I knew I was going to pop out of hyperspace straight into a big firefight. One of the escorts actually survived the witchpoint tussle and its contribution to "escorting" thereafter consisted of vaguely injecting around, sometimes even managing to pass through scanner range, regardless of my chosen speed. Can't remember too many details about the firefight at the witchpoint itself, although I did find this pair of Cobra 3s to be slightly less useful than a passing Moray trader would have been.

Can't say they really behaved as "hired guns". More like "disposable decoys" :twisted:
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Hired Guns OXP

Post by Thargoid »

To some degree it's limited by the AI commands available. They should stay somewhere near you (if you fly at normal or injector speeds they should be around, and should reappear shortly after a torus jump) and in terms of combat they should dive in when you attack or have something attack you.

But what can be done is rather limited by the available AI commands, so sometimes yes they are just active decoys ;)
Makara
Dangerous
Dangerous
Posts: 122
Joined: Sat Oct 17, 2009 6:34 pm

Re: Hired Guns OXP

Post by Makara »

Heh heh. They are certainly a lot busier than most rocks you see :D And having played with some "regular" escorts (UPS again - the little ducklings GalCop trainees) the trade of less smarts for no mass-lock is a good one.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Hired Guns OXP

Post by SandJ »

When a Hired Gun accidentally shoots another Hired Gun or myself, I then get attacked by the Hired Guns.

What follows may be rubbish - the terminology is surely wrong. But anyway,

In hiredGuns_escort.js, when the above accidental shooting occurs it passes the message "FRIENDLY_FIRE" in this.fireCheck which is used in hiredGuns_escortAI.plist which, since we are in an "ATTACK_SHIP" state, triggers the "Watch your aim!" message then puts the state to "FIND_PLAYER". The first entry in FIND_PLAYER is to set the sate to ATTACK_SHIP when ATTACKED, so triggering the attack on me as the one responsible for any fire by me or a Hired Gun.

I changed hiredGuns_escortAI.plist under the "FIND_PLAYER" = {part to put the ENTER entry before the ATTACKED entry and added a "FRIENDLY_FIRE" entry before the ATTACKED entry to setStateTo: LOCATE_PLAYER.

This seems to have stopped the behaviour of Hired Guns attacking me when they shoot one another by accident.

Co-incidence, or did I actually do it right?
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Hired Guns OXP

Post by Thargoid »

Unfortunately it's co-incidence (if my understanding on how these things work is right). The order within the state entries doesn't matter.

When the state is entered, "ENTER" is triggered, when it is left "EXIT" is triggered and every 0.25s "UPDATE" is triggered (unless the AI is paused, using the pauseAI command).

The idea of the friendly fire check is to overcome exactly the kind of thing you describe. It seems that somehow on that occasion it failed to work as intended for some reason. What it might be is a remaining command in the queue (which can be dumped) - I'll look at adding that into the next version.
User avatar
hoqllnq
Commodore
Commodore
Posts: 154
Joined: Sun Jan 08, 2006 7:32 pm

Re: Hired Guns OXP

Post by hoqllnq »

Greetings Commanders,

I have encountered an issue with this OXP where after I launch from the station, my hired escorts 'buzz' the station and one (sometimes both) of them crashes into it. I think this happens especially/mostly at high tech worlds, where the escorts are interceptors and the station is a dodo. Maybe the speed/manoeuvrability of the escorts and/or the size of the station makes it happen more on those stations.
I've tested this at Xexedi and at Riredi and it happens most of the time. At lower tech worlds where escorts are sidewinders and stations are coriolis, I've seen it happen but not nearly as 'reliably''.

My theory is that they 'set course' for the player pretty much as soon as they first see it. On launch, this would be very close to or maybe even inside of the station.

Working off of this theory, I added a 5 second AI pause in the escort AI, in the INITIALISE state, in the TARGET_FOUND message, before setStateTo: FOLLOW_PLAYER. This appears to help. The escorts still fly towards and very close to the station but no longer crash into it.

I will try to map out the AI and tinker with it some more, and find a more elegant solution, maybe try and have them adjust course more often or start out slower or something, but this is what I've found for now.

Thanks.

Code: Select all

19:21:40.203 [LogEvents]: Player gui screen changed from GUI_SCREEN_STATUS to GUI_SCREEN_MAIN
19:21:40.203 [LogEvents]: Player will launch from Dodecahedron Station 9230 flying Cobra Mark III 27313
19:21:40.235 [LogEvents]: Player compass targeted lost target in mode COMPASS_MODE_BEACONS
19:21:40.245 [LogEvents]: Player alert condition changed from 0 to 2
19:21:40.247 [LogEvents]: Player got message from Hired Escort 26341 : Where to boss?
19:21:40.248 [LogEvents]: Player got message from Hired Escort 5228 : Reporting for duty Chief.
19:21:40.349 [LogEvents]: Hired Escort 26341 spawned at 11 km
19:21:40.349 [LogEvents]: Hired Escort 5228 spawned at 15 km
19:21:42.724 [LogEvents]: Player launched from Dodecahedron Station 9230
19:22:05.279 [LogEvents]: Player got message from Dodecahedron Station 9230 : Pull up, Hired Escort!
19:22:05.414 [LogEvents]: Wreckage 27531 spawned at 6 km
19:22:05.414 [LogEvents]: Wreckage 7097 spawned at 6 km
19:22:05.414 [LogEvents]: Wreckage 30893 spawned at 6 km
19:22:05.749 [LogEvents]: Wreckage 19905 spawned at 6 km
19:22:11.613 [LogEvents]: Wreckage 474 spawned at 7 km
19:22:11.614 [LogEvents]: Wreckage 2302 spawned at 7 km
19:22:11.614 [LogEvents]: Metal fragment 24706 spawned at 7 km
19:22:11.614 [LogEvents]: Wreckage 4208 spawned at 7 km
19:22:11.949 [LogEvents]: Wreckage 2874 spawned at 7 km
Post Reply