[Solved]HudMessage multiple strings + variable problem

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

[Solved]HudMessage multiple strings + variable problem

Post by Collegia Titanica »

So I wanted to print text and the variable value like "N Factor: numvalue" but it only prints N, I followed the wiki example, don't see why it only prints the N value but not the text. I could always use 2 prints and coordinate them but I shouldn't have to.

Code: Select all

HudMessage(s:"N Factor: ", d:N ; HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP, 0, CR_GRAY, 0.2, 0.3, 0);
Last edited by Collegia Titanica on Sun Sep 16, 2018 7:48 pm, edited 1 time in total.
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: HudMessage multiple strings + variable problem

Post by kodi »

You're not using INDEXFONT as your font right? Or some other custom one that only has numbers.
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: HudMessage multiple strings + variable problem

Post by Collegia Titanica »

Holy shit! That was the problem ! Only numbers in the current font.I never would have guessed, thanks
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Solved]HudMessage multiple strings + variable problem

Post by Enjay »

Glad you got it sorted but this is a perfect example of why it is important to provide more than a tiny snippet of code. Had it not been for kodi's insight, we could have been guessing for ages. I had tried to figure out the problem myself but without the important information that a font other than the standard smallfont was being used, I was stumped.
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: [Solved]HudMessage multiple strings + variable problem

Post by Collegia Titanica »

I see your point.
Post Reply

Return to “Scripting”