HudMessage doesn't work?!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Illdo
Posts: 80
Joined: Wed Sep 01, 2004 4:35 am
Location: Warsaw

HudMessage doesn't work?!

Post by Illdo »

Code: Select all

#include "zcommon.acs"

script 1 OPEN
{
	print(s:"test");
	delay(35);
	HudMessage(s:"Message text here"; HUDMSG_PLAIN, 0, CR_YELLOW, 1.5, 1.5, 4.0);
}
HudMessage simply does not display. Does not at all.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: HudMessage doesn't work?!

Post by Project Shadowcat »

Because it's way off the screen. Where it says 1.5, 1.5? Don't you mean 0.5, 0.5?
User avatar
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Re: HudMessage doesn't work?!

Post by JonayaRiley »

Kind of. x=1.5 means center of x, center each line.

y, however, takes only values from 0.0 to 1.0, or -1.0 to 0.0. 1.5 is off the bottom of the screen.

Illdo, change it to this:

Code: Select all

HudMessage(s:"Message text here"; HUDMSG_PLAIN, 0, CR_YELLOW, 1.5, 0.5, 4.0);
And then it should work the way you want it to.

Also, this should help you in the future: http://zdoom.org/wiki/HudMessage
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: HudMessage doesn't work?!

Post by Project Shadowcat »

JonnyFive wrote:Kind of. x=1.5 means center of x, center each line.
........ *makes a note of that*
User avatar
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Re: HudMessage doesn't work?!

Post by JonayaRiley »

Yeah, basically you add 1.0 to the x coordinates of the message and it centers the lines. Very useful.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: HudMessage doesn't work?!

Post by HotWax »

While that does fix part of the problem, the message still won't be drawn because he's also printing it out of an [wiki=Script_types#OPEN]OPEN[/wiki] script. :P

@Illdo: Change the script type to ENTER. Both [wiki]print[/wiki] and [wiki]HudMessage[/wiki] only display for the activator, and with an OPEN script, the activator is the world (not a valid player). Alternatively, you could use [wiki]printbold[/wiki] and [wiki]HudMessageBold[/wiki] to print the message to all players in the game. Both of those work regardless of script activator.
User avatar
Enjay
 
 
Posts: 26991
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: HudMessage doesn't work?!

Post by Enjay »

HotWax wrote:While that does fix part of the problem, the message still won't be drawn because he's also printing it out of an [wiki=Script_types#OPEN]OPEN[/wiki] script. :P
Actually, that's not true. I don't know why it's not true, but open scripts can put print and hudmessages on screen. Perhaps because it is something that existed waaaaay back with HeXen's original ACS? Anyway, the above (modified) script works perfectly as an open script.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: HudMessage doesn't work?!

Post by Project Shadowcat »

Enjay wrote:
HotWax wrote:While that does fix part of the problem, the message still won't be drawn because he's also printing it out of an [wiki=Script_types#OPEN]OPEN[/wiki] script. :P
Actually, that's not true. I don't know why it's not true, but open scripts can put print and hudmessages on screen. Perhaps because it is something that existed waaaaay back with HeXen's original ACS? Anyway, the above (modified) script works perfectly as an open script.
Confirmed. Back when I confused OPEN for ENTER I used OPEN scripts for opening it up with lines of text. They worked as intended -- without using the hudmessagebold modifier.
User avatar
Illdo
Posts: 80
Joined: Wed Sep 01, 2004 4:35 am
Location: Warsaw

Re: HudMessage doesn't work?!

Post by Illdo »

Okay, thanks. Turns out I've misread the wiki page.
Locked

Return to “Editing (Archive)”