Sniper Sight - MilHUD integrated

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

Moderators: winston, another_commander

User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Sniper Sight - MilHUD integrated

Post by Capt. Murphy »

Wildeblood wrote:
Too, Capt. Murphy, I'll take this opportunity to say, I ignored this "issue" when you first mentioned it last week, in the sense that I did not make an "Oh no!" reply here, but I did give it a little thought. It went unnoticed by me because I set the target reticle sensitive flag directly in hud.plist, as I supposed that anyone else who customizes their HUD would do.
I think your code snippet would have the same issue as my original with the current bug-fixed nightly. No worries about the lack of reply I wasn't necessarily expecting one. It's just worth bearing in mind that someone who doesn't tinker underneath the hood may well have installed both OXP's and then gone running to Eric saying that Target Reticle Sensitive is broken. It didn't occur to me as a problem either until I noticed it and then went to check how Target Reticle Sensitive works.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

I'm for replacing that IF/ELSEIF on compassTargetChanged with a SWITCH/CASE. Is there any reason that's a bad idea?

Also, does the compass behave consistently when coming out of COMPASS_MODE_TARGET because the target is lost (not because the user cycles the compass on to COMPASS_MODE_BEACONS)? Should the compass mode step back to targeting the sun or station, or step forward to beacons mode?
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Sniper Sight - MilHUD integrated

Post by Capt. Murphy »

Wildeblood wrote:
I'm for replacing that IF/ELSEIF on compassTargetChanged with a SWITCH/CASE. Is there any reason that's a bad idea?

Also, does the compass behave consistently when coming out of COMPASS_MODE_TARGET because the target is lost (not because the user cycles the compass on to COMPASS_MODE_BEACONS)? Should the compass mode step back to targeting the sun or station, or step forward to beacons mode?
Don't see any particular advantage to doing it as a switch. <scratches chin> I think it may be difficult to write it as an effective switch and avoid the HUD flashing from the earlier version without lots of extra lines of code.

However the first else is redundant and can be safely removed.

Yep it works fine if the target is lost for any reason. Switches back to default HUD.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Capt. Murphy wrote:
Wildeblood wrote:
I'm for replacing that IF/ELSEIF on compassTargetChanged with a SWITCH/CASE. Is there any reason that's a bad idea?

Also, does the compass behave consistently when coming out of COMPASS_MODE_TARGET because the target is lost (not because the user cycles the compass on to COMPASS_MODE_BEACONS)? Should the compass mode step back to targeting the sun or station, or step forward to beacons mode?
Don't see any particular advantage to doing it as a switch. <scratches chin> I think it may be difficult to write it as an effective switch and avoid the HUD flashing from the earlier version without lots of extra lines of code.

However the first else is redundant and can be safely removed.
Sorry, my ambiguity. I'm for replacing with a switch statement in MilHUD, not the HUD-switching version.
Capt. Murphy wrote:
Yep it works fine if the target is lost for any reason. Switches back to default HUD.
As for my second question, it was what compass mode does the compass itself switch to when the target is lost without the user cycling the compass mode? Because I seem to be getting inconsistent behaviour, sometimes going back to sun mode, when I expected it to go forward to beacons mode. But it might have been the exceptional case of the N beacon, my imagination, or the phase of the moon at play.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Sniper Sight - MilHUD integrated

Post by Capt. Murphy »

Appears to default back to planet mode for me consistently. That's with and without sniper scope installed.

edit - just had a peek at the MilHud version code - again I can't see any obvious advantage to changing it to a Switch. If / else is perfectly adequate when you are evaluating for two possible outcomes (i.e award equipment or take it away). Switch comes into it's own where there are three or more outcomes depending on the value of the variable (i.e. the different HUD's based on alert condition). It would work as a Switch though.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Sniper Sight - MilHUD integrated

Post by Capt. Murphy »

Just a quick post to report no CTD using the standalone version and Trunk r4568 all weekend and yesterday. Probably about 3-4 hours actual game time.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Wildeblood wrote:
Also, does the compass behave consistently when coming out of COMPASS_MODE_TARGET because the target is lost (not because the user cycles the compass on to COMPASS_MODE_BEACONS)?
Capt. Murphy wrote:
Yep it works fine if the target is lost for any reason. Switches back to default HUD.
Wildeblood wrote:
As for my second question, it was what compass mode does the compass itself switch to when the target is lost without the user cycling the compass mode? Because I seem to be getting inconsistent behaviour...
While testing the Sniper Sight this week I had the HUD jam when the compass was already in target mode and the compassTargetChanged event fired with mode = "COMPASS_MODE_TARGET". As previously discussed with regard to the exceptional case of targeting the N buoy, the event is compassTARGETChanged, not compassMODEChanged. Anyway, I added an extra check to prevent that jam from happening, and as far as I know, that was the last bug fix.

Now that Oolite version 1.75.3 is here and there is no longer the danger of this OXP causing crashes, I can finally release this OXP. I just need to decide what size I should make the sight in the included HUD file. I have tried everything from a piddly little 128px to a giant 500+px and still can't decide which I prefer, let alone knowing what most other people might prefer. Any opinions on this would be much appreciated.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5365
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA] Sniper Scope

Post by Cholmondely »

Cdr. Jettison wrote: Fri Jun 24, 2011 7:17 am
Wildeblood wrote:
Now the only mystery is why anyone making a replacement HUD would name the file anything other than hud.plist?
Cobra Mk I and Adder use hud-small.plist instead of hud.plist. There also some OXP ships that use customised HUDS (e.g. most ships from Isis Interstellar by Killer Wolf)
Do you happen to have any of KW's huds? I've been trying to get my hands on one to try out and been failing dismally. I very much like his docked HUD.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: [BETA] Sniper Scope

Post by Mauiby de Fug »

Cholmondely wrote: Mon Aug 23, 2021 8:24 pm
Do you happen to have any of KW's huds? I've been trying to get my hands on one to try out and been failing dismally. I very much like his docked HUD.
I can't remember if they were ever released separately, but they were often incorporated into his ship oxps. Meaning that if you bought the ship and didn't have any other HUDs active, you would get the new HUD.

If you just want to test it out and you've got some of his ship oxps, then fire up a test commander with the appropriate ship and see how you find it. If you like it, it should be possible to extract it from the oxp to run with whatever ship you like. I think his Werewolf, Vampire III Dominatrix, and the Vampire IV Diamondback had their own HUDS...
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: [BETA] Sniper Scope

Post by hiran »

Mauiby de Fug wrote: Tue Aug 24, 2021 3:23 pm
Meaning that if you bought the ship and didn't have any other HUDs active, you would get the new HUD.
I like that concept. Gives a lot more character to a ship. Otherwise they all fly pretty much the same...
Sunshine - Moonlight - Good Times - Oolite
User avatar
Cholmondely
Archivist
Archivist
Posts: 5365
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA] Sniper Scope

Post by Cholmondely »

hiran wrote: Tue Aug 24, 2021 5:31 pm
Mauiby de Fug wrote: Tue Aug 24, 2021 3:23 pm
Meaning that if you bought the ship and didn't have any other HUDs active, you would get the new HUD.
I like that concept. Gives a lot more character to a ship. Otherwise they all fly pretty much the same...
Coluber did the same with his Coluber Racers: racers at top, HUDs beneath, followed by download link.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5365
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA] Sniper Scope

Post by Cholmondely »

Cdr. Jettison wrote: Fri Jun 24, 2011 7:17 am
HUD
Mauiby de Fug wrote: Tue Aug 24, 2021 3:23 pm
HUD
Just to get back to the topic of this thread, does anybody have a copy of the Sniper Sight HUD?

We have lots about it on the wiki & here in the BB, but no links for downloads which still work.

(And ditto for Killer Wolf's Dynamic HUD)
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply