Author Topic: Custom Wingmen HUD Gauge [features now in FSO]  (Read 39542 times)

0 Members and 1 Guest are viewing this topic.

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Custom Wingmen HUD Gauge [features now in FSO]
Final update: I've now ported all the features from this script into FSO. These included color for health, full wing names, and custom dot icons for ship classes (now bombers, interceptors, and fighters all have unique wingmen dots). Beyond the substantial optimization, this has the added benefit that the gauge will now scale at varying resolutions, use HUD brightness settings, and fully work in multiplayer.


Details of which new features were added:
'$Wingmen Gauge Dot Override:' within ships.tbl. This allows modders to set wingmen status dots on a per-ship class basis. If no animation is specified then the default dot animation specified in the HUD table wingmen gauge is used. Wiki link here: https://wiki.hard-light.net/index.php/Ships.tbl#.24Wingmen_Gauge_Dot_Override:

'Use Full Wing Names:' within hud_gauges. Enabling this setting draws the full wing name and does not alter the capitalization. Wiki link here: https://wiki.hard-light.net/index.php/Hud_gauges.tbl#.2BWingman_Status:

'Use Expanded Colors:' hud_gauges. Enabling this setting uses red, yellow, or green color to designate wingmen health (green 1.0 to > 2/3, yellow 2/3 to > 1/3, and red <= 1/3. Wiki link here: https://wiki.hard-light.net/index.php/Hud_gauges.tbl#.2BWingman_Status:






Current Version 3.0
Released August 27, 2020

Custom Wingmen HUD Gauge v3.0




Background:
This script creates a new wingmen HUD gauge that provides three large differences compared to the default Wingmen HUD Gauge.


Major Features:
  • Gauge writes the full wingnames. The script updates the width of the gauge so that you will always see the fill wing name. It will not show characters after a "#", too.
  • Gauge can use two different styles, the traditional wingmean gauge layout, or a compact grid layout. To change to grid layout simply set CustomWingGauge.style = "grid".
  • Custom sexp included so FREDer can change which wings are displayed on the gauge throughout the mission.
  • Gauge shows a color for each wingman's relative health. The color transitions from green to orange to red. If the wingman is dead then a hollow red circle is shown. If the wingman departed then a hollow circle with a line is shown with the color of the departed wingman's health. If you would prefer to use gray-scale dots instead of green-orange-red dots then open the file and simply change CustomWingGauge.isgrayscaled = false to CustomWingGauge.isgrayscaled = true.
  • Different icons are used to differentiate between bombers and other ships. Bombers are shown as square icons and other ships are shown as circles. This feature can be turned off by setting CustomWingGauge.isbombdifferent = false
  • You can now specify the type of font the gauge uses from fonts.tbl. To specify a different font then the default change the values of CustomWingGauge.fonts = {default=1, low_resolution=3} to desired the font name or index.
  • You can specify the position of the gauge easily. To change position of the gauge set values of origin and offset, similar to hud_gaugles.tbl. For example, CustomWingGauge.origin = {x=0.85, y=0.2} and CustomWingGauge.offset = {x=0, y=0}. If you want to use RTT to a cockpit display you can also set CustomWingGauge.RTT = {use=true, gauge_name="Wingmen_Custom_RTT}. If using the RTT feature, the script will use RTT in internal view then switch to screen render for external view. Also, for RTT to work be sure to also make a '+Scripted Gauge:' entry in hud_gauges.tbl, and the 'gauge_name' should equal the 'Name' of the '+Scripted Gauge' in the 'hud_gauges.tbl'.

Installation:
  • Download and copy the "cuswingmengag-sct.tbm" and "cuswingmengag-sexp.tbm" files into your data/tables folder. If you know a bit of basic scripting you can also set this to appear on a mission by mission basis.
  • To change the color of the gauges text and outline simply change the HUD color for the wingmen gauge in the HUD configuration settings.

Last Items:
  • Here is a screenshot showing it in action.
  • Script file is attached. I would be happy to hear any feedback, suggestions, or overall thoughts.

Thanks!   


Download: Custom Wingmen Gauge


Version History:
Code: [Select]
V3.0 Adds option to specify which wings are displayed with custom SEXP.

V2.8-2.9 Adds an option that will scale the gauge to UHD monitors.

V2.7 makes the gauge work more like the retail gauge, because now it won't appear if the player is all alone in the mission.

V2.6 improves support for RTT options using the new SCP scripted gauge feature (thanks m!m)!

V2.5 adds an easier option to change the gauge's position.

V2.4 adds a grid option and improves minor script drawing code discrepancies.

V2.3 stops the gauge from showing if the player disables the wingmen gauge in the HUD configuration window. The update also provides proper scaling at low resolutions (<1024x768) and allows modders to specify custom fonts.

V2.2 provides a fix to check for capitalization inconsistencies between default wing and ship names within a given mission file (thanks for the catch theperfectdrugsk!).

V2.1 provides minor visual fixes and adds an orange color step, which looks much better then the previous simple green to red transition (thanks for the advice m!m!).

V1.8-2.0 gives more buffer space between the gauge borders and long wing names and better adjusts the behavior of drawing wing icons for successive waves to match retail (thanks Spoon!).

V1.7 better supports wings with greater then four ships (ie 5 or 6).

V1.6 better adjusts the behavior of drawing wing icons for successive waves to match retail and removes a debug display (thanks Spoon!).

V1.5 adjusts the behavior of drawing wing icons for successive waves to match retail (thanks Spoon!). Also it adds the option to show bombers as squares instead of circles (thanks Iain Baker!).

V1.4 fixes an issue that drew the gauge on top of fadeouts, etc (thanks Axem!) and fixed an issue of not showing the health of second or more waves of the wing (thanks Spoon!).

V1.3 fixes an issue that shows the gauge in certain views where it should not be shown (thanks Axem!).

V1.2 fixes an issue that would keep a mission file open while FREDing with FSO open (thanks to Spoon and Axem for finding that!), and also it incorporates intensity values so the brightness of the gauge will also match what you set in the HUD configuration settings.

V1.1 of the script now supports gray-scale option, bugs fixes, improved position, and the script now uses the background color of the default wingmen gauge, thus it now matches your current color configuration settings.

« Last Edit: October 10, 2021, 02:49:22 pm by wookieejedi »

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Custom Wingmen HUD Gauge v1.0
This is cool. Nice work!
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.0

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Custom Wingmen HUD Gauge v1.0
To quote a wise man:
This is cool. Nice work!

Two questions/requests, though: 1. Would it be possible for this gauge to take the hud color of the retail gauge? It feels a bit out of place being grey.
2. Could you move it back up to the height of the retail gauge position? (I had a look at the script but I'm too smoothbrained to figure out how to adjust its position) It's overlapping with other custom gauges on my end.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.0
To quote a wise man:
This is cool. Nice work!

Two questions/requests, though: 1. Would it be possible for this gauge to take the hud color of the retail gauge? It feels a bit out of place being grey.
2. Could you move it back up to the height of the retail gauge position? (I had a look at the script but I'm too smoothbrained to figure out how to adjust its position) It's overlapping with other custom gauges on my end.

1. Sure! So you would like the grey border and background/wingname text to use that color?
2. Sure! Since it is a vertical gauge it increases in size as more wings arrive, so I can make it go a bit higher to account for that if needed.
« Last Edit: October 15, 2018, 11:42:48 am by wookieejedi »

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Custom Wingmen HUD Gauge v1.0
Nice  :yes:
1. Yeah, lets color everything. I think the white text looks pretty nice too, but looking at how the hud currently is, all of the other hud gauges have their text in color too (with the directives themselves as an exception), so for consistency sake.

2. It's needed in my case:

If you could raise it so it's at the top of the screen, with a small distance away from the edge of the border, that'd be great.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Custom Wingmen HUD Gauge v1.0
Honestly, I'd love it if it worked a little smarter. So like it does 3 wings horizontally and then after that it starts a new row?

Bonus points to make color automatically get it from the Player's HUD color and/or configurable with a cfg file. Could do the same with text color and the horizontal vs vertical layouts.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
Just posted a new version. Now the script now supports gray-scale option, improved position, and the script now uses the background color of the default wingmen gauge, thus it matches your current color configuration settings. Also fixed quite a few minor bugs.

Hmm two horizontal lines is a good idea, then it would nicely fit with the old gauge's placement. Changing the line colors and whatnot in a configure file is certainly doable, but since the player can alter it from the HUD Configuration in game I think that covers most use cases.

Just to note, the max list is 5 wings, since the script gathers the wings to list from the "Squadron Wing Names" in the mission file.

Thanks for both of your suggestions. I would be happy to hear any additional feedback, too!
« Last Edit: October 15, 2018, 02:53:56 pm by wookieejedi »

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Custom Wingmen HUD Gauge v1.1
New version is nice  :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
New version is nice  :yes:

Thanks! I also tried to make a few variable names more understandable in case anyone wanted to adjust it for specific purposes.

 

Offline theperfectdrugsk

  • 26
  • thinks there should be a dedicated 'en-dash' key
Re: Custom Wingmen HUD Gauge v1.1
Ooooo I like it.

Very very very small suggestion, you may want to allow it to have high-contrast toggled instead of being at full brightness all the time.  Again, just for consistency.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
Ooooo I like it.

Very very very small suggestion, you may want to allow it to have high-contrast toggled instead of being at full brightness all the time.  Again, just for consistency.

Thanks! Just so I can better address your suggestion, are you referring the the color contrast on the dots, or the color contrast on the text?

 

Offline theperfectdrugsk

  • 26
  • thinks there should be a dedicated 'en-dash' key
Re: Custom Wingmen HUD Gauge v1.1
Thanks! Just so I can better address your suggestion, are you referring the the color contrast on the dots, or the color contrast on the text?

I meant the "high contrast" toggle that you can bind to a key for use in-mission that makes the entire HUD brighter.  Right now the custom wingmen gauge is always at full brightness even when the rest of the HUD is at lower brightness.  Like I said, it's a super minor detail (especially since I always toggle the HUD to full brightness anyway).

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
Thanks! Just so I can better address your suggestion, are you referring the the color contrast on the dots, or the color contrast on the text?

I meant the "high contrast" toggle that you can bind to a key for use in-mission that makes the entire HUD brighter.  Right now the custom wingmen gauge is always at full brightness even when the rest of the HUD is at lower brightness.  Like I said, it's a super minor detail (especially since I always toggle the HUD to full brightness anyway).

Oh I had completely forgotten about that! Let me see what I can do! (Hopefully there is a scripting hook that can tell when it is set.)

 

Offline m!m

  • 211
Re: Custom Wingmen HUD Gauge v1.1
This looks pretty nice :yes: The default wingman gauge was always a little limited for my tastes...

I had some previous instances where I wanted to scale the health of a ship to a color and I found out that it is better to add a second color step in the middle to avoid that ugly red/green mix. When you use a shade of orange at 50% health the progression should look a bit nicer.

EDIT: Also, your script is nicely isolated from the rest of the scripting system. Only once global variable and everything else is local. I know that may be obvious to you but I see way too many scripts that pollute the global namespace :yes:

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
This looks pretty nice :yes: The default wingman gauge was always a little limited for my tastes...

I had some previous instances where I wanted to scale the health of a ship to a color and I found out that it is better to add a second color step in the middle to avoid that ugly red/green mix. When you use a shade of orange at 50% health the progression should look a bit nicer.

EDIT: Also, your script is nicely isolated from the rest of the scripting system. Only once global variable and everything else is local. I know that may be obvious to you but I see way too many scripts that pollute the global namespace :yes:

Thank you! Ah adding an orange step is a very good idea. I appreciate the coding comments, I learned a lot of how to lua script from reading your and Axem's scripts : D

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Custom Wingmen HUD Gauge v1.1
So I ran into a big issue that FRED couldn't save to the mission file that was open in FSO. FRED didn't give any warnings, it just straight up undid all of the changes made and would only agree to save to the file if the mission was no longer open in FSO. Behavior I had never seen before and wrongly attributed to some bug in recent builds and/or FRED. Thankfully, Axem is a very smart man, and he figured out that bug was caused by this script. Probably because it reads the wing names from the mission file, and then keeps the file open. Preventing FRED from writing to it.

Just a heads up to everyone using the script in its current version.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.1
So I ran into a big issue that FRED couldn't save to the mission file that was open in FSO. FRED didn't give any warnings, it just straight up undid all of the changes made and would only agree to save to the file if the mission was no longer open in FSO. Behavior I had never seen before and wrongly attributed to some bug in recent builds and/or FRED. Thankfully, Axem is a very smart man, and he figured out that bug was caused by this script. Probably because it reads the wing names from the mission file, and then keeps the file open. Preventing FRED from writing to it.

Just a heads up to everyone using the script in its current version.

Thanks for the update, I have fixed the issue and uploaded a new version (v1.2). That must have been very annoying to try and figure out, and I am sorry about all that extra bug fixing I put you guys through!

The new version also incorporates the intensity value from the player's HUD settings as well, so if you like a brighter or darker HUD the gauge will match what you have set.

 

Offline m!m

  • 211
Re: Custom Wingmen HUD Gauge v1.2
I made some changes to how the engine handles the file handles so that you get yelled at if you forget to close a file handle so this shouldn't happen again in the future.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Custom Wingmen HUD Gauge v1.2
Good idea! It's fixed in this script now, but that is definitely a good safety check to have for any future scripts.