Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: wookieejedi on October 14, 2018, 02:54:17 pm

Title: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on October 14, 2018, 02:54:17 pm
Current Version 3.0
Released August 27, 2020

Custom Wingmen HUD Gauge v3.0

(https://i.ibb.co/t3JsBGz/Custom-Wingmen-Gauge.png) (https://i.ibb.co/ZdVMx4B/screen0113.png)


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


Major Features:

Installation:

Last Items:

Thanks!   


Download:  Custom Wingmen Gauge (https://github.com/wookieejedi/FSO-Scripts/tree/master/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.

Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: mjn.mixael on October 14, 2018, 05:17:50 pm
This is cool. Nice work!
Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: wookieejedi on October 14, 2018, 08:42:51 pm
This is cool. Nice work!

Thanks!
Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: Spoon on October 15, 2018, 08:19:16 am
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.
Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: wookieejedi on October 15, 2018, 11:25:35 am
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.
Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: Spoon on October 15, 2018, 12:33:43 pm
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:
(https://i.imgur.com/iGgsQKi.png)
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.
Title: Re: Custom Wingmen HUD Gauge v1.0
Post by: mjn.mixael on October 15, 2018, 02:33:53 pm
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.
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 15, 2018, 02:40:19 pm
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!
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: Spoon on October 15, 2018, 02:55:22 pm
New version is nice  :yes:
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 15, 2018, 02:58:05 pm
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.
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: theperfectdrugsk on October 15, 2018, 03:47:54 pm
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.
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 15, 2018, 04:18:40 pm
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?
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: theperfectdrugsk on October 15, 2018, 06:26:55 pm
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).
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 15, 2018, 07:22:31 pm
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.)
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: m!m on October 17, 2018, 12:43:31 pm
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:
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 17, 2018, 02:00:27 pm
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
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: Spoon on October 20, 2018, 09:32:31 am
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.
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: wookieejedi on October 20, 2018, 10:41:04 am
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.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: m!m on October 20, 2018, 10:44:59 am
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.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: wookieejedi on October 20, 2018, 10:46:26 am
Good idea! It's fixed in this script now, but that is definitely a good safety check to have for any future scripts.
Title: Re: Custom Wingmen HUD Gauge v1.1
Post by: Spoon on October 20, 2018, 12:26:14 pm
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.
No worries!
I would be lying if I said I wasn't freaking out for a bit earlier. "How many changes have I made in these past months that have not been saved?! :shaking:" But thankfully that turned out to be non-issue.

The fixes and added safeties are  :yes:
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: wookieejedi on October 21, 2018, 08:54:06 pm
New version released, Version 1.3. This fixes an issue that shows the gauge in certain views where it should not be shown. Thanks to Axem for the fix!
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: Rampage on November 05, 2018, 06:19:38 pm
This is a great addition to the community.  Any chance there might be an option to include images (eg radar icons) to represent wingmen instead of dots?  This will allow the script to represent allied capital ships in capship command missions.

Once again great work!

R
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: Spoon on November 06, 2018, 04:57:31 pm
One more major issue to report: If you have a wing with multiple waves on your hud gauge, any wave aside from the first one won't show up on the gauge.

So for example. Alpha wing has 3 wingmen to start with, they die, next three launch from the hangarbay, the hud gauge is then not updated to reflect the status of alpha 4, 5 and 6 etc.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: wookieejedi on November 07, 2018, 08:05:06 pm
This is a great addition to the community.  Any chance there might be an option to include images (eg radar icons) to represent wingmen instead of dots?  This will allow the script to represent allied capital ships in capship command missions.

Once again great work!

R

That is a good idea, though implementation will just depend on how much free time I can muster over the next few weeks. Thanks for you feedback!

One more major issue to report: If you have a wing with multiple waves on your hud gauge, any wave aside from the first one won't show up on the gauge.

So for example. Alpha wing has 3 wingmen to start with, they die, next three launch from the hangarbay, the hud gauge is then not updated to reflect the status of alpha 4, 5 and 6 etc.

Ah good to know, that is a rather important issue to address, so I will work on fixing that this weekend or next! Thanks again for you continued suggestions and comments.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: Spoon on November 24, 2018, 10:48:03 pm
Hey, not to be pushy, but it's been a few weekends now.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: wookieejedi on November 26, 2018, 09:27:56 pm
I knew there was something else on my FSO list, thanks for the reminder! I am testing fixes now and will hopefully have something by the end of the week once I return from travels.
Title: Re: Custom Wingmen HUD Gauge v1.2
Post by: Spoon on November 27, 2018, 12:10:09 am
I knew there was something else on my FSO list, thanks for the reminder! I am testing fixes now and will hopefully have something by the end of the week once I return from travels.
  :yes:
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: wookieejedi on December 04, 2018, 09:05:34 pm
Version 1.4 has been released! This version 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!).
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: Spoon on December 04, 2018, 09:50:35 pm
Thanks for the hardwork (https://fi.somethingawful.com/images/smilies/discoursechef.png)

The way it fills up new slots for new wave arrivals is kind of... interesting, though.
Alpha is a wing of 3 with a threshold of 1 and Custodian is a wing of 2. So after three waves the display ends up looking like this (attachment)

[attachment deleted by admin]
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: wookieejedi on December 05, 2018, 03:59:29 am
Thanks for the hardwork (https://fi.somethingawful.com/images/smilies/discoursechef.png)

The way it fills up new slots for new wave arrivals is kind of... interesting, though.
Alpha is a wing of 3 with a threshold of 1 and Custodian is a wing of 2. So after three waves the display ends up looking like this (attachment)

Thanks! Yeah if there are less then 6 slots filled the next wave fills the six slots first. That behavior can be easily changed :) Would you like it if the new wing simply filled over the previous wing. For example, Alpha wing has 3 ships and 2 waves. On the first wave three dots are shown and on the second wing only three dots are still shown. Does that sound like more what you were looking for?
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: Spoon on December 05, 2018, 12:07:03 pm
Yeah, that's how the retail wingmen hud works, it just fills the same dots again. I do think that looks a bit nicer on the hud. So if you could change it to behave like that, that would be good.
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: Iain Baker on December 05, 2018, 01:36:10 pm
Nice!

One addition that would be very handy would be an indication as to what the ships in each wing are.

In particular, it would be very handy to know which ones are bombers. In some missions of some mods you may have five wings under your command, possibly more. It can be tricky to work out / remember which are your bomber wings in the middle of a fight. Especially so if you didn't choose the wings yourself in the hanger. Even more so if you are dropped into the middle of a hairball and don't have time to visually check each wing / cycle through each friendly ship.

Is this technically possible? If so, how would it react if the player were to swap ships around in the hanger?
Title: Re: Custom Wingmen HUD Gauge v1.4
Post by: wookieejedi on December 05, 2018, 05:10:09 pm
Yeah, that's how the retail wingmen hud works, it just fills the same dots again. I do think that looks a bit nicer on the hud. So if you could change it to behave like that, that would be good.

Good point. That is now changed to match retail behavior in Verizon 1.5.

Nice!

One addition that would be very handy would be an indication as to what the ships in each wing are.

In particular, it would be very handy to know which ones are bombers. In some missions of some mods you may have five wings under your command, possibly more. It can be tricky to work out / remember which are your bomber wings in the middle of a fight. Especially so if you didn't choose the wings yourself in the hanger. Even more so if you are dropped into the middle of a hairball and don't have time to visually check each wing / cycle through each friendly ship.

Is this technically possible? If so, how would it react if the player were to swap ships around in the hanger?

Thanks, that is a good suggestion. It is indeed possible and the changes between waves and player swapping ships in the load-out (hangar) screen is also accounted for. I have added the different bomber icons as a feature for Version 1.5. Now bombers are designated by squares and other ships by circles.

Version 1.5 is released and the link is on the front page.

As always, I appreciate the feedback from you both, and I would be happy to answer any additional questions or address any issues! Thanks!
Title: Re: Custom Wingmen HUD Gauge v1.5
Post by: Spoon on December 05, 2018, 11:27:43 pm
Sorry to be difficult here  :p

Issue 1. I have Alpha wing start with 3 in the wing, but with a threshold of 1. So when 2 are destroyed, the next three in the wing arrive. With the retail hud gauge, it would add the fourth icon to the hud.
The fourth icon would remain empty (ergo: dead. Not empty as in, its gone completely) if the wing got reduced to 3 again, but in the cases where the wing was again 4 on the field, it would fill up again.
Currently the script doesn't account for that, and only ever shows the three circles, even if there are four in the wing.

Issue 2. see attachment
Is this a debug text thing? The text seems to color along with the dot, but only for the first three fighters.


[attachment deleted by admin]
Title: Re: Custom Wingmen HUD Gauge v1.5
Post by: wookieejedi on December 06, 2018, 03:31:17 am
Sorry to be difficult here  :p

Issue 1. I have Alpha wing start with 3 in the wing, but with a threshold of 1. So when 2 are destroyed, the next three in the wing arrive. With the retail hud gauge, it would add the fourth icon to the hud.
The fourth icon would remain empty (ergo: dead. Not empty as in, its gone completely) if the wing got reduced to 3 again, but in the cases where the wing was again 4 on the field, it would fill up again.
Currently the script doesn't account for that, and only ever shows the three circles, even if there are four in the wing.

Issue 2. see attachment
Is this a debug text thing? The text seems to color along with the dot, but only for the first three fighters.

No worries, I appreciate the feedback! I think I see what you mean, and I have adjusted the script for Version 1.6 accordingly. You are correct, those are debug lines and I commented them out properly this time. Please let me know if that works more how you'd expect!

Version 1.6 (and now 1.7) is released, link on front page as usual  :)
Title: Re: Custom Wingmen HUD Gauge v1.6
Post by: Spoon on December 07, 2018, 01:57:38 pm
Doesn't quite work right yet.
https://www.dropbox.com/s/557cuaegk5p624z/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-07%2015-39-31-60.webm?dl=0
Title: Re: Custom Wingmen HUD Gauge v1.6
Post by: wookieejedi on December 07, 2018, 04:21:48 pm
Doesn't quite work right yet.
https://www.dropbox.com/s/557cuaegk5p624z/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-07%2015-39-31-60.webm?dl=0

Ah I see what you mean now. Once the second wave jumps in all four dots should be green. Will work on fixing that!
Title: Re: Custom Wingmen HUD Gauge v1.6
Post by: wookieejedi on December 07, 2018, 07:05:37 pm
Doesn't quite work right yet.
https://www.dropbox.com/s/557cuaegk5p624z/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-07%2015-39-31-60.webm?dl=0

Once the second wave jumps in all four dots should be green. Will work on fixing that!

I think I have fixed the issue in Version 1.8 which is now released. Let me know if it works as expected, thanks! 
Title: Re: Custom Wingmen HUD Gauge v1.8
Post by: Spoon on December 07, 2018, 10:13:03 pm
Onward to version 1.9
https://www.dropbox.com/s/ykm4dnud5sis46j/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-07%2023-53-43-09.webm?dl=0
Title: Re: Custom Wingmen HUD Gauge v1.8
Post by: wookieejedi on December 08, 2018, 05:31:57 pm
Onward to version 1.9
https://www.dropbox.com/s/ykm4dnud5sis46j/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-07%2023-53-43-09.webm?dl=0

Indeed! Version 1.9 is released, and hopefully it now works as expected. I replicated what I saw on your screen and I believe the new version works how you'd expect, but of course let me know if not.  :) Thanks again for testing so often, I very much appreciate it!
Title: Re: Custom Wingmen HUD Gauge v1.9
Post by: Spoon on December 08, 2018, 10:28:08 pm
Not quite there yet.
https://www.dropbox.com/s/xfoxcz21usq06a7/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-08%2023-55-01-74.webm?dl=0
I didn't see this happen with a wing of 5
Title: Re: Custom Wingmen HUD Gauge v1.9
Post by: wookieejedi on December 09, 2018, 03:29:08 am
Not quite there yet.
https://www.dropbox.com/s/xfoxcz21usq06a7/Fs2_open_Wings_of_Dawn-EX17-SSE%202018-12-08%2023-55-01-74.webm?dl=0
I didn't see this happen with a wing of 5

To me, the video seems to show the correct number of alive icons for the correct number of ships in mission for each wing at any time. But I might be thinking about it differently so just for my clarification, are you saying what is in the video is good, but it doesn't work with a wing of 5, or that what is in the video doesn't look good, but it does work with a wing of 5? Thanks!
Title: Re: Custom Wingmen HUD Gauge v1.9
Post by: Spoon on December 09, 2018, 01:03:47 pm
When the next wing arrives, it adds the new dot along side the empty dot. So that wing of 1 is now indicated as a wing of 2. That happens all the way up to a wing of 5.
That's not quite what I'd expect should happen, with the retail hud, the only time an empty extra icon would appear is with cases of threshold triggering. Otherwise it would just fill up the empty circle again with a new fresh one. Which makes sense to me.
Title: Re: Custom Wingmen HUD Gauge v1.9
Post by: wookieejedi on December 09, 2018, 08:35:53 pm
When the next wing arrives, it adds the new dot along side the empty dot. So that wing of 1 is now indicated as a wing of 2. That happens all the way up to a wing of 5.
That's not quite what I'd expect should happen, with the retail hud, the only time an empty extra icon would appear is with cases of threshold triggering. Otherwise it would just fill up the empty circle again with a new fresh one. Which makes sense to me.

Ah I see what you mean! I have now added some lines to account for that in Version 2.0. Now, unless there is threshold triggering, the wing dots will match the wing sizes for successive waves.

Version 2.0 is released on the front page. Let me know what you think. Thanks!
Title: Re: Custom Wingmen HUD Gauge v2.0
Post by: Spoon on December 09, 2018, 10:33:25 pm
It looks like V2.0 might be a winner! 
I'll put it under some more testing over the next days, but it looks promising  :yes:
Title: Re: Custom Wingmen HUD Gauge v2.0
Post by: wookieejedi on December 09, 2018, 10:36:27 pm
It looks like V2.0 might be a winner! 
I'll put it under some more testing over the next days, but it looks promising  :yes:

Great to hear! Thanks, sounds good!
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: wookieejedi on December 16, 2018, 03:46:10 am
New Version 2.1 released! This version 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!).

[attachment deleted by admin]
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: Spoon on December 16, 2018, 11:42:09 am
Colors definitely transition smoother and look nicer with the yellow added
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: wookieejedi on December 16, 2018, 02:24:03 pm
Colors definitely transition smoother and look nicer with the yellow added

Thanks, happy to hear it looks better! Is the gauge still behaving as expected for wave arrivals?
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: theperfectdrugsk on January 17, 2019, 02:57:19 pm
Just decided to play through Aftermath: Reboot again, and I got the following crash:

LUA ERROR: [string "cuswingmengag-sct.tbm - On Game Init"]:227: attempt to perform arithmetic on local 'endstr' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
------------------------------------------------------------------


------------------------------------------------------------------

stack traceback:
   [C]: ?
   [string "cuswingmengag-sct.tbm - On Game Init"]:227: in function 'DrawWingSection'
   [string "cuswingmengag-sct.tbm - On Game Init"]:399: in function 'Draw'
   [string "cuswingmengag-sct.tbm - On HUD Draw"]:464: in main chunk
------------------------------------------------------------------

------------------------------------------------------------------

It's on a mission where it's just you (alpha 1) and Beta 1, so separate wings with no wingmen.  The mission works fine without the wingmen script, and it worked fine for the first fiew missions of the campaign as well.  I'm guessing it's just got something to do with how Aftermath is assigning the wings for this particular mission but...I don't anything about scripting, so figured I'd post it anyway.
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: wookieejedi on January 17, 2019, 03:25:36 pm
Thanks for the update! That is strange, does it cause that crash at the beginning of the mission?
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: theperfectdrugsk on January 17, 2019, 03:28:32 pm
Yep, right after the briefing.  Although, I did actually just realize that I was running the mod under a nightly instead of a release build, so maybe that has something to do with it.  I'll have to play through a couple missions under the 3.8.0 to get to this point and see if it crashes again.
Title: Re: Custom Wingmen HUD Gauge v2.1
Post by: wookieejedi on January 17, 2019, 03:46:19 pm
Yep, right after the briefing.  Although, I did actually just realize that I was running the mod under a nightly instead of a release build, so maybe that has something to do with it.  I'll have to play through a couple missions under the 3.8.0 to get to this point and see if it crashes again.

Thanks for the quick reply! I always run the script with nightlies, so I am guessing that is not the cause. I have added a fix, so please feel freet to download the attachment, overwrite and let me know if it works. Do you have Discord, per chance? (Might make the debugging process easier if more steps are needed).

Ah I found the issue, that mission has a different capitalization between alpha 1 and wing name Alpha, I will add a fix for that in the script.
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: wookieejedi on January 17, 2019, 04:24:53 pm
V2.2 is now released and provides a fix to check for capitalization inconsistencies between default wing and ship names within a given mission file (thanks for the catch theperfectdrugsk!). Also attached below.


[attachment eaten by a Shivan]
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: theperfectdrugsk on January 18, 2019, 12:05:19 pm
Sweet, works perfectly.

I kinda wish there was a way to fold nifty scripts like this into a knossos download.  It'd certainly be easier for users to keep updated and easier for users to find (I bet a lot of people haven't started using this just because it's in the "scripting releases" forum and scripting = scary).
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: wookieejedi on January 18, 2019, 12:30:08 pm
Sweet, works perfectly.

I kinda wish there was a way to fold nifty scripts like this into a knossos download.  It'd certainly be easier for users to keep updated and easier for users to find (I bet a lot of people haven't started using this just because it's in the "scripting releases" forum and scripting = scary).

Great, glad to hear it! That's a good idea! Though I think the way that Knossos works might make it difficult because Knossos can't really overlap mods/run more then one mod together, and this script would ideally be used with many mods at once. Spoon is using the script in Wings of Dawn, so at least people see it there!  :)
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: Nightmare on January 18, 2019, 01:12:35 pm
Axem has a script collection on github. I suggested it could be turned into a more general resource, but so far nothing came out of it than a general idea.
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: wookieejedi on January 18, 2019, 01:51:18 pm
Axem has a script collection on github. I suggested it could be turned into a more general resource, but so far nothing came out of it than a general idea.

Ah I remember seeing that github collection. A collection of solid scripts that have wide use in one spot with a downloadable link on Knossos and updated on GitHub could be very cool. The tricky part is having someone having the time to run it, as many of these widely useable scripts are part of larger projects that also take up a lot of time. But I would be down for collaborating with folks who are interested in that sort of thing!
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: AdmiralRalwood on January 21, 2019, 12:58:17 pm
Sweet, works perfectly.

I kinda wish there was a way to fold nifty scripts like this into a knossos download.  It'd certainly be easier for users to keep updated and easier for users to find (I bet a lot of people haven't started using this just because it's in the "scripting releases" forum and scripting = scary).

Great, glad to hear it! That's a good idea! Though I think the way that Knossos works might make it difficult because Knossos can't really overlap mods/run more then one mod together, and this script would ideally be used with many mods at once. Spoon is using the script in Wings of Dawn, so at least people see it there!  :)
This functionality is eventually supposed to exist in the form of "extension" mods, it just hasn't been implemented yet (AFAIK).
Title: Re: Custom Wingmen HUD Gauge v2.2
Post by: wookieejedi on February 13, 2019, 10:11:32 am
Sweet, works perfectly.

I kinda wish there was a way to fold nifty scripts like this into a knossos download.  It'd certainly be easier for users to keep updated and easier for users to find (I bet a lot of people haven't started using this just because it's in the "scripting releases" forum and scripting = scary).

Great, glad to hear it! That's a good idea! Though I think the way that Knossos works might make it difficult because Knossos can't really overlap mods/run more then one mod together, and this script would ideally be used with many mods at once. Spoon is using the script in Wings of Dawn, so at least people see it there!  :)
This functionality is eventually supposed to exist in the form of "extension" mods, it just hasn't been implemented yet (AFAIK).

Gothca. Maybe a Knossos mod with finished community scripts might be worthwhile in the meantime, though I am not sure who else might be interested.
Title: Re: Custom Wingmen HUD Gauge v2.5
Post by: wookieejedi on March 13, 2019, 01:43:05 pm
New update V2.3-2.7!

This version provides a new, optional grid view. It also 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 and works more like the retail gauge because it won't appear if the player all alone in the mission.

It also, allows modders to more easily 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'.

(https://i.ibb.co/ZdVMx4B/screen0113.png) (https://imgbb.com/)

Download: Custom Wingmen Script V2.7 Script (https://github.com/wookieejedi/FSO-Scripts/tree/master/Custom-Wingmen-Gauge)
Title: Re: Custom Wingmen HUD Gauge v2.7
Post by: themaddin on January 23, 2021, 06:25:46 am
I'm getting an error when simply including the tbm:

Code: [Select]
SEXP 'wingmen-gauge-set-wings' is not known to the SEXP system!

------------------------------------------------------------------

stack traceback:
[C]: ?
[C]: ?
[string "cuswingmengag-sct.tbm - On Game Init"]:857: in main chunk
------------------------------------------------------------------

1: Userdata [LuaSEXPs]
2: String [wingmen-gauge-set-wings]
------------------------------------------------------------------

It looks like the script doesn't register itself with the SEXP system properly?
But since I'm not using any SEXP to control it, everything seems fine when I simply comment out the affected block.
Title: Re: Custom Wingmen HUD Gauge v2.7
Post by: Iain Baker on January 23, 2021, 09:05:47 am
Going to sound like a right numbty but how do you download the bloody file from Github? I can't see a download button. 'Go to file' just brings up the list of hyperlinks. Clicking on the hyperlink brings up a wall of text. Am I supposed to copy n paste the text into notepad? If so, does it need all of it, because when I tied that I got error messages when trying to start a campaign. Halp pls  :confused:
Title: Re: Custom Wingmen HUD Gauge v2.7
Post by: m!m on January 23, 2021, 09:50:39 am
If you click on a file you will get a "Raw" button with which you can save the file directly. You can also go to the main page of the repo and under "Code" you will have the option of downloading a Zip of the entire Repo where you can then pick the file you need.
Title: Re: Custom Wingmen HUD Gauge v2.7
Post by: wookieejedi on January 23, 2021, 10:27:06 am
I'm getting an error when simply including the tbm:

It looks like the script doesn't register itself with the SEXP system properly?
But since I'm not using any SEXP to control it, everything seems fine when I simply comment out the affected block.

Ah yes, I recently added a sexp which allows the player to choose which wings they want displayed in the gauge. So you will also need to download the sexp file. Both of those files need to go in the same spot, and I've updated the install instructions to be more clear on that. My apologies for just realizing that now! :) Your shortcut of commenting out that sexp in the file though works too if you plan to not use the sexp.


m!m, thanks for the help in clarifying how to download and install!
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 23, 2021, 10:50:09 am
Worked like a charm! If all goes well I will be using this with every campaign :-) No more having to cycle through friendlies to work out which wings are the bombers. This really should have been part of FS since FS 1 retail, but at least we have it now, superb job :-)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 23, 2021, 11:24:40 am
Glad you enjoy it!
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Mobius on January 23, 2021, 11:26:53 am
Any way to trigger this on a per-mission basis, or depending on the combat spacecraft chosen by the player? I'd like to use this script but in specific circumstances, and I have no idea how to set it up that way. I'm looking for a dedicated SEXP, or the possibility to edit the script and get it to work if the mission filename matches any entry in a set of strings.
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 23, 2021, 11:27:45 am
I'm thinking of adding these files to the getting started thread. They are a fantastic accessibility aid that would prove useful to pretty much everyone :-)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 23, 2021, 11:29:49 am
I'm thinking of adding these files to the getting started thread. They are a fantastic accessibility aid that would prove useful to pretty much everyone :-)

Edit - if the player swaps ships around before the mission starts - for example swaps the bomber wing around with the fighter wing, does this take the change into account, or is it based on what the mission dev assigned each wing to be?

Cheers

Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 23, 2021, 03:05:12 pm
Any way to trigger this on a per-mission basis, or depending on the combat spacecraft chosen by the player? I'd like to use this script but in specific circumstances, and I have no idea how to set it up that way. I'm looking for a dedicated SEXP, or the possibility to edit the script and get it to work if the mission filename matches any entry in a set of strings.

Definitely possible to add any of those options. For your specific situations I can just show you how to do that over PM in Discord if that works?

I'm thinking of adding these files to the getting started thread. They are a fantastic accessibility aid that would prove useful to pretty much everyone :-)

Edit - if the player swaps ships around before the mission starts - for example swaps the bomber wing around with the fighter wing, does this take the change into account, or is it based on what the mission dev assigned each wing to be?

Cheers



Yes this script accounts for any changes to the ships in the loadout menu, and only assigns the shapes once the ship arrives in the mission.

Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 23, 2021, 04:02:59 pm
Yup, tested it out and it adapts accordingly :-)

Quick question - is there a way to alter its placement on the screen, and perhaps its orientation (to make it horizontal) as its position on my screen slightly overlaps the escort list.

PS - thank you again making this  :)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 23, 2021, 04:23:52 pm
Glad you like it! Pop open the script file in a text editor (I use notepad++), and the user options and what to do to change things are listed in the first part of the table. :)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 24, 2021, 05:07:56 am
Glad you like it! Pop open the script file in a text editor (I use notepad++), and the user options and what to do to change things are listed in the first part of the table. :)


Thanks for the heads up. I had a look at the instructions and my brain said   :confused::eek: :eek2: :nervous: (:lol:). I imagine the brain of someone even less au fait with FreeSpace coding, scripts etc would go  :confused: :shaking: :confused: :eek: :confused: :eek2: :confused: :nervous: :confused:. 

Could I ask for a favour then, please? Could you upload a version or versions tailored that are tweaked to do the following?

•   Multi-coloured. ‘Landscape’ orientation. Size the same as default wingman gauge. The top right corner of the screen – same as default wingman gauge. Different icons for bombers and fighters. Resolution suitable for 1080p displays.

•   A version with those settings but suitable for 4K displays might be worth creating too since 4K is seemingly becoming the new standard for some gamers.

•   A version with those setting but with larger icons and text would likely be useful as an accessibility aid for those with poor eyesight.

•   A version with those settings but using the default HUD icon colours would likely be useful for those suffering from colour-blindness

These would provide the main benefits of the custom gauge whilst also providing maximum compatibility, since they would be a straight swap for the default gauge, and thus should work without further modification for the majority of campaigns. This would likely be very useful for many players, newbies especially. I could then add links to these files on the getting started thread, under the accessibility section I am planning to add soon.

You could probably create these in 5 mins, whereas it would take me hours since I would have to figure it all out first. So, if you could do me a solid and create these, I would be very grateful, as would (I imagine) many other existing and future players.

Cheers
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 24, 2021, 11:09:08 am
Here's a few points about the logistics and reasoning of why I did things this way:

The typical practice of script conditions is to release one file that can be configured by the user. This is seen in all other large script releases (see Axem's scripts, and even the command line for FSO itself). Generally the default settings are good for many users, but if a user does want to change a setting they can edit a line in a text file, which is good practice and helps many folks get more comfortable with the idea of possibly trying out modding themselves. (Speaking from personal experience and things I've seen with many other folks). The user options within this script are setup similarly to editing a table file or the command line, so the idea was following the practice setup by this community :) If someone who wants to change a lighting setting in the command line is comfortable reading about that setting on the wiki and changing the value, the goal was to make it about the same experience as reading what the script settings do and changing that in the user options section of the file.

Having multiple iterations of the same release with one setting that is slightly different can lead to confusion, and it's much more difficult to keep things efficiently updated on the release logistics side of things. If each slight iteration had to be its own file, then that leads to many permutations of files (such as a grey scale that is 4k, grey scale that is 1080p, large text that is gray scale, large text that is 4k, etc). As an aside, I'm a teaching by nature and training, so I'd rather take the time to show someone how to change something then just give them a different file each time they want one setting changed :)

I'll also note that this script already scales by resolution. If the resolution is <1024, the script changes size and uses the smaller default text. If resolution is > 1024 but less then 3200 then it uses the default medium size text, and if resolution is higher, it uses the largest default text.

Regarding the landscape orientation to match the retail gauge style: the only two configurations I have coded in are the vertical and horizontal ones shown in the screenshot on the first page of the forum. These configurations allow for longer names to be displayed, whereas the landscape default of FS does not easily allow for that (hence why I went with those two options).

The accessibility option is something that I have thought about as well, and I definitely support the overall goal of making FSO more accessible!
Right now, the gauge can be set to use larger text and sizes in the options.
A grey scale version can also be used, and it was suggested to be during development of the script :) To use the grey scale version all the user has to do is find the line
'CustomWingGauge.isgrayscaled = false'
and change it to
'CustomWingGauge.isgrayscaled = true'

The tricky part about making this single gauge much larger at the 1080 resolution is that the rest of the gauges will still be the same size, and this will look strange and have a higher probability of overlapping. The larger goal would be to have a HUD that scales all the gauges up if someone wanted the HUD to be larger, but that is alas far beyond the goals of this script.


Perhaps that was more exposition then you might have been looking for :lol: I hope it helps explain my reasoning for things, and I very much appreciate your support and enthusiasm for the script! If you'd like I could make the default of the gauge to use the horizontal configuration, so it does not overlap any other lower gauges.
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Mobius on January 24, 2021, 12:35:09 pm
Any way to trigger this on a per-mission basis, or depending on the combat spacecraft chosen by the player? I'd like to use this script but in specific circumstances, and I have no idea how to set it up that way. I'm looking for a dedicated SEXP, or the possibility to edit the script and get it to work if the mission filename matches any entry in a set of strings.

Definitely possible to add any of those options. For your specific situations I can just show you how to do that over PM in Discord if that works?

We're addressing the topic in SerRes right now. At this point I think there's a tangible chance for this script to become a standard setting for all SR campaigns, even though it derails a little bit from the main FS1 interface. It's a derailment the kind of which we like.  :pimp:

I'll definitely let you know. :)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 24, 2021, 12:54:00 pm



Perhaps that was more exposition then you might have been looking for :lol: I hope it helps explain my reasoning for things, and I very much appreciate your support and enthusiasm for the script! If you'd like I could make the default of the gauge to use the horizontal configuration, so it does not overlap any other lower gauges.

Changing the default to either be horizontal, or simply moving the grid further up the screen so that its bottom doesn't overlap the top of the escort list would be very much appreciated. This would solve the problem for most campaigns, and would better use the 'screen real-estate' in the top right corner, which looks kinda odd being blank.


https://docs.google.com/document/d/1WucEZ2J8IXsiq3BRWVCq_CQdaaoY8rLlUu7W1xzTOwU/edit?usp=sharing

Campaigns that use custom HUD elements might run into some problems, but that would be up to the Mod dev themselves to sort. So long as new players are spared from having a heart attack due to being faced with the scary-wall-of-text-and-jargon I'm happy (speaking with my New Player Experience hat on  :pimp:)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 24, 2021, 01:34:15 pm
Any way to trigger this on a per-mission basis, or depending on the combat spacecraft chosen by the player? I'd like to use this script but in specific circumstances, and I have no idea how to set it up that way. I'm looking for a dedicated SEXP, or the possibility to edit the script and get it to work if the mission filename matches any entry in a set of strings.

Definitely possible to add any of those options. For your specific situations I can just show you how to do that over PM in Discord if that works?


We're addressing the topic in SerRes right now. At this point I think there's a tangible chance for this script to become a standard setting for all SR campaigns, even though it derails a little bit from the main FS1 interface. It's a derailment the kind of which we like.  :pimp:

I'll definitely let you know. :)


Sounds great!




Perhaps that was more exposition then you might have been looking for :lol: I hope it helps explain my reasoning for things, and I very much appreciate your support and enthusiasm for the script! If you'd like I could make the default of the gauge to use the horizontal configuration, so it does not overlap any other lower gauges.

Changing the default to either be horizontal, or simply moving the grid further up the screen so that its bottom doesn't overlap the top of the escort list would be very much appreciated. This would solve the problem for most campaigns, and would better use the 'screen real-estate' in the top right corner, which looks kinda odd being blank.


https://docs.google.com/document/d/1WucEZ2J8IXsiq3BRWVCq_CQdaaoY8rLlUu7W1xzTOwU/edit?usp=sharing

Campaigns that use custom HUD elements might run into some problems, but that would be up to the Mod dev themselves to sort. So long as new players are spared from having a heart attack due to being faced with the scary-wall-of-text-and-jargon I'm happy (speaking with my New Player Experience hat on  :pimp:)


Updated the file to use the horizontal configuration by default. The upper right corner of the screen should remain open because that's where the comms menu pops up at  :)
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 25, 2021, 06:59:37 am



Updated the file to use the horizontal configuration by default. The upper right corner of the screen should remain open because that's where the comms menu pops up at  :)


Awesome, thank you so much :-)

If I was being extra picky,  :p I would ask if the default position could move over to the right a little, so that its right edge lines up (more or less) with the right edge of the escort list box? It looks a little out of place in its current position. (Image from BP AoA)

https://drive.google.com/file/d/1-fHbjoDq-XE4SxT42byo8NLn6Qh7_tY2/view?usp=drivesdk

Would this be effected if the other HUD elements are different sizes? I ask as I notice the size of HUD elements tends to vary between campaigns. Compare the previous image to this one: (Image from The Aeos Affair)

https://drive.google.com/file/d/1fXTvsCoK-gXkplFxltIJ__uXqYARpog8/view?usp=drivesdk

Superb work BTW, this needs to become FSO standard  :cool:
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 25, 2021, 08:15:53 am
The tricky part about this gauge is that it will change sizes based on the string lengths of the wing names. Thus that's the reason it is a more to the left, to account for if a longer name comes along. A good solution to this would be to put the gauge at the left side of the screen, but then folks might not be expecting it there.

Different campaigns and mods may have different sizes of HUDs based on what the modder did. This scripted gauge will not be affected unless the modder changes options within the script.

Thanks again, I've thought about making this a FSO feature, though then that makes the accessibility a bit more involved because instead of just downloading a script file that does everything, it would be up to each modder to edit the hud gauge table with all the new proper options and setup new image files.
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: Iain Baker on January 25, 2021, 09:00:46 am
I thought that might be the case. Never mind, it works, that's the main thing.  :-)

Just a thought though - could the guage box be right justified, so that its right edge stays in the same screen location regardless of the length of the box, but the left edge expands leftwards towards the centreline of the screen to accommodate different name lengths?
Title: Re: Custom Wingmen HUD Gauge v3.0
Post by: wookieejedi on January 25, 2021, 09:37:27 am
I've actually had that thought as well. Unfortunately for folks who want to move the gauge like they would any other HUD gauge I wanted to use the same convention as the HUD table, which is where everything is left justified  :lol:

If you're okay with the gauge being on the left side of the screen instead of the right then all you have to do is find the line
CustomWingGauge.origin = {x=0.88, y=0.25}
and change it to
CustomWingGauge.origin = {x=0.02, y=0.25}
 :)