COAL HUD: Regular messages

Are you experiencing a problem? Maybe you can't get your scripts to do what you need, or are frustrated by a feature you just can't seem to get working? Let us know about it here and we will try our best to help you out!
Post Reply
User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

COAL HUD: Regular messages

Post by Marscaleb »

I'm trying to use a higher-resolution font, but the regular in-game messages (ie: You got the chainsaw! Find some meat!) are getting cut-off because they partially appear beyond the top of the screen.

I'm looking through coal_hud.ec but I can't find the function that displays regular messages. How do I change how those messages appear?

CeeJay
Posts: 224
Joined: Sat Jan 26, 2013 9:56 am

Re: COAL HUD: Regular messages

Post by CeeJay »

As far as I know there is no way of doing so. Due the hardcoded scaling, using custom fonts can be a little problematic.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: COAL HUD: Regular messages

Post by Marscaleb »

Dang it!

It wouldn't be so problematic if I could just change where its displayed.
...Although I guess I could try to redo the system using RTS, but I bet that would be more work than I think it is.

CeeJay
Posts: 224
Joined: Sat Jan 26, 2013 9:56 am

Re: COAL HUD: Regular messages

Post by CeeJay »

It is, I've experimented with messages via RTS and it's clunky and involves quite a bit of code. You'll need to select the string, color, alignment, time and if you want it to fade in/out. It will also need to be called for from THINGS.DDF.

User avatar
Corbachu
Site Admin
Posts: 778
Joined: Fri Jun 08, 2012 11:22 am
Gender:
Contact:

Re: COAL HUD: Regular messages

Post by Corbachu »

Weaving it through VM_coal is taking longer than it should, so I have added a scaling option as a CVAR, from 0.1f - 1.5f.

If desired I can also add whether the text is left, center-justified, or right-aligned.

Eventually though I want this to be a call at the top of coal_HUD.ec, along with vector access x., y., z., so the absolute position of the base HUD messages can be user-defined as well. :-)
\(סּںסּَ` )/ۜ

User avatar
Corbachu
Site Admin
Posts: 778
Joined: Fri Jun 08, 2012 11:22 am
Gender:
Contact:

Re: COAL HUD: Regular messages

Post by Corbachu »

Well, I went ahead and integrated this into vm_hud since I figure this would be pretty helpful for you guys.

Two new functions exist (in COAL_API):

hud.message_ticker (with this smashed in between a few function, you can set the scale directly)

hud.text_scale (with this, you can set the individual text scale of other text).

I thought about integrating this into DDFSTYLES, but that code still needs a lot of improvements, where COAL is pretty much ready to go. I
also tweaked the error message handling for COAL huds, so now it's a little more informative (instead of having to pop open the debug.txt, it
will tell you the basic error message and what line number to look for. I would have done more but, the message strings can get super long and
naturally gets truncated, since I_Error is only so long).

I'll have basic functionality ready soon =)
\(סּںסּَ` )/ۜ

User avatar
Corbachu
Site Admin
Posts: 778
Joined: Fri Jun 08, 2012 11:22 am
Gender:
Contact:

Re: COAL HUD: Regular messages

Post by Corbachu »

Here's a quick test EXE.

Before I weave it into a usable coal_hud function (you can see the starts of these new params in both the coal_api
and coal_hud), I have made simple CVARS to test out how this will actually work.

In this build, there are 3 new CVARS:

r_textscale : Scales the text (0.7 is the default scale)

r_text_xpos: Sets the 'X' coord of the start of text drawing (default is 160)

r_text_ypos: Sets the "Y" coord of the on-screen hud message (default is 3)


Play with those and let me know if they work okay, if they do -- I'll proceed with weaving them into a more mod-friendly
solution, via the coal_vm.
\(סּںסּَ` )/ۜ

User avatar
RUNSABER
Posts: 132
Joined: Sat Mar 14, 2015 3:10 pm

Re: COAL HUD: Regular messages

Post by RUNSABER »

I've used the HUD text feature quite extensively in my previous iteration of Astral Pathfinder. I was able to allow text to appear on screen after hitting switches, stepping on floor specials that activated other sectors on the map, even managed to script my own boss fight and make a health bar appear on screen. You can also assign text to appear via COAL but that forces a lot of other things to be worked around and may become meticulous for you to switch constantly between COALHUD & RSCRIPT just to test your function for 10 seconds. I can grab some code i've written and share to ya for reference!
Official 3DGE64 Project Portal - Public Repository for 3DGE 64.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: COAL HUD: Regular messages

Post by Marscaleb »

For this, I wasn't looking for anything fancy; just the basic message test.
Adjusting where it appears on the screen sounds like all I really need.

Although now it gets me thinking about other ways it might be improved...

The thing that comes to my mind is, when a message is defined in the languages file, could you also specify changes to its appearance for just that one message?

Thus, you could define a set of default properties for your messages. Where it appears, what size it is, what color, justification, font, how long it is displayed, fade out time, etc. Then when you define a particular string, you can also modify any of those properties. So if one particular message wants to be bigger, you could just add that one property. Like:
ShotgunMessage: "You got the shotgun!", size=1.2;
SecretMessage: "Found a secret!", xpos=160, ypos=100, justify=center;
(I don't recall the exact format, I'm just making that up.) The first message displays in a bigger text, and the second message displays in the center of the screen.

Maybe this is already what you've done, or what you are planning. I haven't looked at the changes you made, this is just what suddenly clicked in my head when I was reading about the changes you made.

The only other potential improvements I can think of would be for handling multiple messages. Instead of just having one message at a time, have messages displayed in a list. You'd need variables to designate how many lines can be displayed, which direction the new lines get displaced at, if new messages are pushed into the default spot or the first open spot, how much spacing there is between lines, and maybe set some sort of message priority (so picking up a health bonus doesn't erase a message saying that one player killed another.) Also if a message is given a new position or justification it shouldn't be part of that same list. Hmm, in that case maybe you'd define a "message list" and then designate messages to be in that list or not. So instead of designating a particular message to have a given location and such, you just define a second message group, and state that a given message is part of that group. Thus you could easily separate the messages that get displayed in the corner form the ones that appear in the middle of the screen, and also designate default properties for each group.

I don't know, I'm just spitting this out off the top of my head while I wait on the train.

Return to “Support and Help”