Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: Axem on June 11, 2014, 08:13:34 pm

Title: Scripted Message Gauge v1.2
Post by: Axem on June 11, 2014, 08:13:34 pm
Yo, updates to this can now be found on my github! (https://www.hard-light.net/forums/index.php?topic=94909.0)

Hidden Text: Old Post • Show
Boy, look at me. I start something new and push stuff like the Journal and System viewer aside (that's still coming real soon!). How evil.

But anyway, something that always annoyed in FreeSpace was the messages. With all the fancy and awesome backgrounds we have these days, the messages gauge keeps getting washed out. Well, I've hopefully found a solution to those problems with this Scripted Message Gauge, made possible by awesome coder m!m!

Look and be amazed!


(Note I was playing around with the positioning here. That's the BP positions, the default in the download is more FS2 like. You're free to change it of course!)

Super easy to install into your mod, just extract the files and that's it. No special activation required! There's some neat stuff for FREDders too, like modifying the draw speed in FRED by adding !s or .s in the message name. See the wiki page for more details.

Thanks to mjn, Spoon, Darius, The E, and swashmebuckle for helping test this and for using it in your mods!

Grab this as part of my 2_HUD! https://www.hard-light.net/forums/index.php?topic=91197.0

I'm hoping in a future version, when more hud gauge info is available to lua, I can just grab things like the Font and Position from what is already defined instead of having to specify positions in different areas. Also maybe automatically assigned message beeps and terminations. Please let me know if you have any problems or issues! (I'm hoping I didn't forget anything stupid)
Title: Re: Scripted Message Gauge v1.0
Post by: General Battuta on June 11, 2014, 08:19:53 pm
FYI this owns
Title: Re: Scripted Message Gauge v1.0
Post by: Lorric on June 11, 2014, 08:26:25 pm
Yeah, this thing got put into BtA and I was blown away when I saw it. :nod:
Title: Re: Scripted Message Gauge v1.0
Post by: niffiwan on June 11, 2014, 09:15:29 pm
Impressive! Most Impressive :)
Title: Re: Scripted Message Gauge v1.0
Post by: procdrone on June 12, 2014, 06:52:30 am
I saw that on your YouTube channel for some time now, but it's released finally! Yay!
Title: Re: Scripted Message Gauge v1.0
Post by: fightermedic on June 14, 2014, 12:42:47 pm
full of ultra-awesome-supercoolnes
Title: Re: Scripted Message Gauge v1.0
Post by: General Battuta on June 18, 2014, 11:03:55 am
Hm. After some testing, Axem, I have some concerns:

There is no queue. When a message is cut off it vanishes. This leaves players unable to review messages except by hitting up the log.

In the BP HUD, the top line of the message overlaps the message sender ID.

Does the message script respect priority? (I suspect it probably does.)
Title: Re: Scripted Message Gauge v1.0
Post by: Axem on June 18, 2014, 11:10:41 am
Yes, there's no backlog. I'm unsure the best route to go with adding a backlog for messages while keeping things readable. Suggestions are welcome!

And also yes there was a change to how lua string are drawn in the nightlies, its a super simple fix that I will be updating very shortly.

Message priority is respected because the script doesn't handle that, the game still does.
Title: Re: Scripted Message Gauge v1.0
Post by: mjn.mixael on June 18, 2014, 11:48:48 am
My idea for the backlog was to try and recreate the default HUD gauge, but leave out the most recent message. So.. Using scripting to get and draw messages of a particular age. I haven't had time to actually fudge around to try and figure it out yet, though.
Title: Re: Scripted Message Gauge v1.0
Post by: Lorric on June 18, 2014, 12:10:09 pm
My idea for the backlog was to try and recreate the default HUD gauge, but leave out the most recent message. So.. Using scripting to get and draw messages of a particular age. I haven't had time to actually fudge around to try and figure it out yet, though.
Do you mean the latest message would appear in Axem's gauge, then when it was replaced by the next one, it would drop to the top of the screen in the same way normal messages display?
Title: Re: Scripted Message Gauge v1.0
Post by: mjn.mixael on June 18, 2014, 01:23:08 pm
Yes, that is my idea. Dunno yet if it's workable.
Title: Re: Scripted Message Gauge v1.0
Post by: Lorric on June 18, 2014, 01:56:14 pm
Yes, that is my idea. Dunno yet if it's workable.
Well I'm looking forward to seeing you find out. :)
Title: Re: Scripted Message Gauge v1.0
Post by: Axem on June 18, 2014, 03:09:40 pm
I'm thinking what I might do is make a toggle-able back log gauge that shows up at some place. Defaults to like last 2 messages or something. Press Alt-M or something, expands to screen height, press Alt-M again and it'll hide for good.

Anyway script is slightly updated due to mantis 2891 being fixed! See original post for the link.
Title: Re: Scripted Message Gauge v1.0
Post by: mjn.mixael on June 18, 2014, 03:21:23 pm
That would work. Alt-M would need to be customizable, and something somewhere near the messages should probably showhow hint that it should be pressed? I dunno.
Title: Re: Scripted Message Gauge v1.0
Post by: Axem on June 19, 2014, 10:40:49 pm
http://www.mediafire.com/download/d5nplmsz43d32ip/ScriptedMessagev1.2.rar

Now with a backlog and some other minor fixes (like actually hiding that old message gauge!). Documentation for the features will be on the wiki shortly.

Also note that the gauge does not scale like the rest of the hud, so I apologize if you have giant monitors and the text is still tiny. When TTF support goes in I hope to have some semi-intelligent scaling in that regard.
Title: Re: Scripted Message Gauge v1.0
Post by: FrikgFeek on June 20, 2014, 03:32:27 am
This is great for non-voiced campaigns. Just tried it out with Vassago's Dirge and it worked well. Though the version 1.2 I just downloaded doesn't actually hide the old message gauge. Unless I'm misreading something because the old gauge works well as a backlog. Messages don't time out, so I'm guessing this was intended.
Tried it with retail FS2 too just to be sure, same result.
Though it does keep the HUD colour scheme, so It doesn't ruin my artistic 15 colour HUD  :P.
Title: Re: Scripted Message Gauge v1.0
Post by: Axem on June 20, 2014, 08:28:18 am
The backlog looks and acts very similar to the old messages gauge, except messages won't appear on it until the text scrolling is finished, and the messages slowly fade out.
Title: Re: Scripted Message Gauge v1.2
Post by: General Battuta on June 20, 2014, 10:22:56 am
New version's great.
Title: Re: Scripted Message Gauge v1.2
Post by: mjn.mixael on June 20, 2014, 10:52:23 am
Yes, yes it is.
Title: Re: Scripted Message Gauge v1.2
Post by: Lepanto on March 21, 2016, 06:55:17 pm
Hey. Know it's been forever, but there's a long-running bug with the message script. We at Exile (and other campaigns too) could use a fix.

On longer messages, the message gauge cuts off before the message finishes. I cannot into LUA, so could you possibly extend the default time that a message remains on-screen?
Title: Re: Scripted Message Gauge v1.2
Post by: Axem on March 21, 2016, 07:56:06 pm
How long of a message exactly? How many characters?

The length of time a message stays up is dependent on the "Length" parameter in the config file included (axmessage.cfg). The exact equation is "length parameter * number of characters in message" or 2 seconds, whichever is larger. Looking at my own personal config files, I seem to have found the default of 0.07 too short and changed it to 0.12. Play with it I guess and see what works for you.

EDIT: I also have a slightly untested beta version for... 1.3 I guess. If you guys are interested. It's better at drawing in low fps conditions and things like empty secondary warnings now get displayed.
Title: Re: Scripted Message Gauge v1.2
Post by: Lepanto on March 21, 2016, 09:05:24 pm
Thanks. We'll fiddle with the current version for right now.
Title: Re: Scripted Message Gauge v1.2
Post by: Mobius on July 30, 2020, 02:28:09 pm
The length of time a message stays up is dependent on the "Length" parameter in the config file included (axmessage.cfg). The exact equation is "length parameter * number of characters in message" or 2 seconds, whichever is larger. Looking at my own personal config files, I seem to have found the default of 0.07 too short and changed it to 0.12. Play with it I guess and see what works for you.

I don't know if this is the right place where to post the following suggestion, so in case it isn't, just disregard this post and ignore my necrothreadaging.

We were having a discussion on the private FSCRP channel concerning this script. It's extremely useful, but seems to cut some of the longer messages. I wonder if there could be a way to adapt font size to message length, and do so dynamically, so that one liners would appear on a bigger font compared to long messages with lots of descriptions.

Judging from Axem's post, the game does in fact keep track of the number of characters per message, and does it for purposes other than the one I'm talking about. Could a dynamic font size be possible?
Title: Re: Scripted Message Gauge v1.2
Post by: Axem on July 31, 2020, 07:04:33 pm
Just an FYI here, my github (https://www.hard-light.net/forums/index.php?topic=94909.0) will have the latest up to date scripts, so treat this thread as an "archive" of the older version.

But to your question...

So the answer is... sort of. You can't have completely dynamic fonts, each font needs to have its own fonts table entry. That's why in version 1.3beta (in the github right now), it's set up for multiple resolution ranges with some specified font. So you could make something where it sees it has just one line and picks the "larger font".

Might be a good first project for someone to tinker with. :) gr.drawString will return the number of lines, so you could have the script start trying fonts and figure out how best they would fit.
Title: Re: Scripted Message Gauge v1.2
Post by: Nightmare on August 01, 2020, 06:38:06 am
Possibly you should put a very bright warning into the OP too then?