Sniper Sight - MilHUD integrated

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

Moderators: winston, another_commander

User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Zireael wrote:
About the contraster: would it be possible to have just the contraster as a buyable "flare" equipment?

Just a thought.
Explain more. What do you mean by "flare"?
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: Sniper Sight - MilHUD integrated

Post by Zireael »

Just that. You buy it (whatever we do call it) and you get the contraster in the middle of your screen/hud like in MilHUD. Makes for easier spotting of enemies.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Yeah, it can be done, but why would you want to buy it? If you want to add just that to your HUD, just do it, you know. Making it buyable equipment is just unnecessary complication. It means one more script running at startup to change the HUD from the standard to the one you've bought.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: Sniper Sight - MilHUD integrated

Post by CommonSenseOTB »

Zireael wrote:
About the contraster: would it be possible to have just the contraster as a buyable "flare" equipment?

Just a thought.
Yes, but not yet. This will be possible when the legends section of the hud.plist is modified to allow "equipment_required" for activation just as the dials section does. This will be added in 1.76 I hear.

Cool idea! 8)
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: Sniper Sight - MilHUD integrated

Post by Cmdr Wyvern »

Wildeblood wrote:
Cmdr Wyvern wrote:
Version 1.0 of MilHUD way back in Oolite 1.65 days featured a contraster and central dot, features that made it into various other HUDs. :) It was just that awesome.
I just noticed that this evening. How's it done? Obviously with a PNG overlay, but slightly more specifically, how's it done (the contraster, I know how to draw a dot)?
The contraster, like the dot, is a .png called from an entry in the 'legends' section in hud plists.
The trick is in how the contraster image is made. The image is a filled white circle with an alpha channel. I dialed the transparency of the alpha channel to 50% in GIMP, and the alpha key in it's plist entry can be used to fine tune it.
It's original purpose was, and is, to brighten up objects that fall into the sighting zone - really useful for aging eyes and aging monitors that otherwise wouldn't see those objects.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6671
Joined: Wed Feb 28, 2007 7:54 am

Re: Sniper Sight - MilHUD integrated

Post by another_commander »

Wildeblood wrote:
What about that more serious bug discussed up there ^, is it a documented one or not? Why isn't there a big, obvious link to the bug-tracker at the top of every page?
It is not and I have just confirmed it. I believe (without having gotten down to the bottom of it yet) that the crash is due to the fact that the HUD is changed via the compassTargetChanged handler before all its elements have been parsed.

The crash is happening even if I take an exact copy of the vanilla hud.plist, copy it under the name sniper-hud.plist in the OXP's Config folder and try to use the Sniper equipment with a Nav Buoy targeted. The interesting thing is that most times it will look OK if run outside of the debugger, but gdb will always stop the program execution with a segfault at that point.

As to why there is no big obvious link etc., well, someone will have to actually go and report it in the bug tracker first. Feel free to open a Berlios account if you want and enter it in the database. The link is http://developer.berlios.de/bugs/?group_id=3577. This link is also on the sticky at the top of the Testing and Bug Reports forum, so it doesn't have to be on the top of every page.
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 »

I had another CTD this afternoon - I reopened Oolite after the crash with a -nosplash flag, which on my machine brings up the window with the graphics exactly as it was when Oolite closed until the spinning cobra appears. The standard HUD was only half drawn.
[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: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Capt. Murphy wrote:
I had another CTD this afternoon - I reopened Oolite after the crash with a -nosplash flag, which on my machine brings up the window with the graphics exactly as it was when Oolite closed until the spinning cobra appears. The standard HUD was only half drawn.
Is this going to turn into the crash reporting thread? I'm not going to take the blame for all of them. I used to get frequent CTDs when I had 153 OXPs in, I always suspected Frame's Bounty Scanner was the culprit.

Where do I put this -nosplash flag Capt. Murphy mentions on a Win7 machine?
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 »

http://wiki.alioth.net/index.php/Hidden ... _in_Oolite

or add -nosplash to the command line of the short-cut you use to open the game.

C:\Oolite\oolite.app\oolite.exe -nosplash

You don't need to take the blame for the crash. It's a bug in the game engine that you just happen to have discovered (we are on a beta phase after all). Another-commander is on to it - all will be well.
[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
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6671
Joined: Wed Feb 28, 2007 7:54 am

Re: Sniper Sight - MilHUD integrated

Post by another_commander »

For reference, the crash discussed earlier is now tracked as Berlios bug #18189.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

another_commander wrote:
For reference, the crash discussed earlier is now tracked as Berlios bug #18189.
Thank you very much, another_commander.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6671
Joined: Wed Feb 28, 2007 7:54 am

Re: Sniper Sight - MilHUD integrated

Post by another_commander »

For further reference, bug #18189 should be resolved with r4568. Please test tomorrow's nightly builds with the equipment version of the sniper HUD.
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 »

Will do...
[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 »

another-commander,

I'm using a slightly modified version of the equipment version with a little extra code to ensure compatibility with the Target Reticle Sensitive OXP. The code below worked in r4567 and 1.75.2

Code: Select all

this.compassTargetChanged = function(whom, mode)
	{
	if (player.ship.equipmentStatus("EQ_SNIPER_SCOPE") != "EQUIPMENT_OK")
			{return;}
	else if (mode == "COMPASS_MODE_TARGET")
			{player.ship.hud = "sniper-hud.plist";}
	else if (mode != "COMPASS_MODE_TARGET" && player.ship.hud == "sniper-hud.plist")
			{
				player.ship.hud = "hud.plist";
				if (missionVariables.reticleTargetSensitive == "TRUE")
				{
					player.ship.reticleTargetSensitive = true;
				}
			}
	}
It looks like the CTD fix in r4568 stops this working (i.e. the standard HUD again loses the reticleTargetSensitive status on switching from sniper-hud.plist), presumable because the hud redrawing is now being delayed? Can easily be rectified using a Timer to delay the missionVariable check, but that seems like a bit of a fudge.

On a positive note no CTD so far.

edit to add:

this works to maintain the reticleTargetSensitive status on r4568.

Code: Select all

this.compassTargetChanged = function(whom, mode)
	{
	if (player.ship.equipmentStatus("EQ_SNIPER_SCOPE") != "EQUIPMENT_OK")
			{return;}
	else if (mode == "COMPASS_MODE_TARGET")
			{player.ship.hud = "sniper-hud.plist";}
	else if (mode != "COMPASS_MODE_TARGET" && player.ship.hud == "sniper-hud.plist")
			{
				player.ship.hud = "hud.plist";
				if (missionVariables.reticleTargetSensitive == "TRUE")
				{
					this.reticleTargetSensitiveTimer = new Timer(this, sniper_scope_reticleTargetSensitive, 0.25);
				}
			}
	}

this.sniper_scope_reticleTargetSensitive = function()
{
 player.ship.reticleTargetSensitive = true;
}
[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: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Sniper Sight - MilHUD integrated

Post by Wildeblood »

Capt. Murphy wrote:
another-commander,

I'm using a slightly modified version of the equipment version with a little extra code to ensure compatibility with the Target Reticle Sensitive OXP...
It looks like the CTD fix in r4568 stops this working (i.e. the standard HUD again loses the reticleTargetSensitive status on switching from sniper-hud.plist), presumable because the hud redrawing is now being delayed? Can easily be rectified using a Timer to delay the missionVariable check, but that seems like a bit of a fudge.

On a positive note no CTD so far.
Wouldn't moving the check up to here (with appropriate insertion of mysterious semi-colons) suffice:

Code: Select all

this.compassTargetChanged = function(whom, mode)
	{
	if (player.ship.equipmentStatus("EQ_SNIPER_SCOPE") != "EQUIPMENT_OK")
			{return;}
	else if (mode == "COMPASS_MODE_TARGET")
			{player.ship.hud = "sniper-hud.plist";}
	else if (mode != "COMPASS_MODE_TARGET" && player.ship.hud == "sniper-hud.plist")
			{player.ship.hud = "hud.plist";}

	if (missionVariables.reticleTargetSensitive == "TRUE")
			{player.ship.reticleTargetSensitive = true;}
	}
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.
Post Reply