Displaying and Hiding Images That Take Up the HUD

Discuss all aspects of editing for ZDoom.
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.

Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Sun Mar 18, 2012 9:54 pm

I already know how to use HudMessage, SetFont, SetHudSize and SetPlayerProperty to display an image and disallow the player from moving, but what I want to know how to do is allow the player to stop viewing the image at anytime, rather than having a set time. I'm almost there, but I'm just stumped on the part about allowing the player to leave right after they're done reading.
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011

Re: Displaying and Hiding Images That Take Up the HUD

Postby Kinsie » Mon Mar 19, 2012 5:02 am

You'd need to set up a script to detect the player hitting a button. Here's one from Reelism for you to use as a base.

To test it, run script 994 (puke 994 in console), then press the Use key to end the map.
Code: Select allExpand view
script 994 (void) // ending use button detection.
{
int buttons = GetPlayerInput(-1, INPUT_BUTTONS);

if (buttons == BT_USE)
{
    Exit_Normal(0);
}
delay(1);
Restart;
}
User avatar
Kinsie
So Reel
 
Joined: 22 Oct 2004
Location: MAP33

Re: Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Mon Mar 19, 2012 2:02 pm

It does work. I'm thinking maybe having use the backpedal button be the exit button because you need the use button in order to read the screen in the game. But I can't find these commands on zdoom wiki.
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011

Re: Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Mon Mar 19, 2012 9:09 pm

And the thing that kind of sucks too is that ACS_Terminate isn't doing anything.
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011

Re: Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Mon Apr 02, 2012 6:33 pm

I guess the best question is what ACS function hides an on-screen image.
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011

Re: Displaying and Hiding Images That Take Up the HUD

Postby Blue Shadow » Mon Apr 02, 2012 7:48 pm

There technically isn't a function made for that purpose, however, what you can do is the following:

Code: Select allExpand view
HudMessage(s:""; 0, ?, 0, 0, 0, 0);

Where ? is the id of the message. Make sure it's the same as the one of the message/image you're trying to hide.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

Re: Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Mon Apr 02, 2012 8:14 pm

It doesn't appear to be working. I also tried it with another image instead of no images and the image printed over the first image.
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011

Re: Displaying and Hiding Images That Take Up the HUD

Postby Blue Shadow » Tue Apr 03, 2012 9:03 am

Hmm, that's weird. It shouldn't display the new message over the old one. It should replace it.

At this point, I think seeing the code might be helpful.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

Re: Displaying and Hiding Images That Take Up the HUD

Postby ReedtheStrange » Tue Apr 03, 2012 7:23 pm

Fixed it. As I suspected, my ADD was the culprit. Everything is working now!
User avatar
ReedtheStrange
 
Joined: 11 Sep 2011


Return to Editing

Who is online

Users browsing this forum: KingShinra and 1 guest