Author Topic: Custom Wingmen HUD Gauge v2.7  (Read 19756 times)

0 Members and 1 Guest are viewing this topic.

Offline wookieejedi

  • 28
  • Intensify Forward Firepower
Custom Wingmen HUD Gauge v2.7
Current Version 2.7
Released April 23, 2019

Custom Wingmen HUD Gauge v2.7




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.
  • 2) 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".
  • 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" file 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 Script V2.7 Script


Version History:
Code: [Select]
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: April 25, 2019, 09:22:02 am by wookieejedi »

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Anims: 420, Cutscenes: 10, Mainhalls: 7, Logos: 52
    • Steam
    • Twitter
    • Mix-Hai Productions
Re: Custom Wingmen HUD Gauge v1.0
This is cool. Nice work!
Cutscene Upgrade Project - Mainhall Remakes - MixaelANITools - Between the Ashes - MjnMixael's Render Boutique - Mix-Hai Productions
Youtube Channel - P3D Model Box - Photobucket Albums - Model Releases - Downloads
Between the Ashes is looking for committed testers, PM me for details.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!

 

Offline wookieejedi

  • 28
  • 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

  • 28
  • 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
  • Anims: 420, Cutscenes: 10, Mainhalls: 7, Logos: 52
    • Steam
    • Twitter
    • Mix-Hai Productions
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 - MixaelANITools - Between the Ashes - MjnMixael's Render Boutique - Mix-Hai Productions
Youtube Channel - P3D Model Box - Photobucket Albums - Model Releases - Downloads
Between the Ashes is looking for committed testers, PM me for details.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!

 

Offline wookieejedi

  • 28
  • 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

  • 28
  • 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.

 
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

  • 28
  • 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?

  
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

  • 28
  • 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

  • 28
  • 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

  • 28
  • 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

  • 28
  • 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.