Jump to content

Hudmessage tomfoolery


Recommended Posts

so here we have an acs script that displays a message when you kill an enemy...

 

Script "kmsg1" (void)
{
    Setfont("BIGFONT");
    HudMessagebold(s:"+KILL"; HUDMSG_FADEOUT|HUDMSG_LOG, 0, CR_WHITE, 1.0, 0.5, 0.5, 0.5);
}
 

 

Hudmessagebold works for the most part, but regular hudmessage does not (as in the message straight up doesn't appear.). I'll bet two dollars that hudmessage got deprecated to a degree and that's why it doesn't work (I'm using gzdoom 4.8.2 for anyone wondering) and hudmessagebold, however was spared and that's why hudmessage doesn't work but hudmessagebold works just fine... Is there anyone else having a similar issue, or is it just me?.

Share this post


Link to post

The difference is that hudmessages get attached to the script's owner, but hudmessagebolds get attached to all players.

Your kill script is most likely owned by the killed monster so the hudmessage will be skipped because monsters do not have a screen to attach a message to.

 

Share this post


Link to post

The same distinction also happens for the various other print functions: the "bold" variant is guaranteed to work because it shows to all players, while the non-bold variant only shows for its caller and is therefore useless if the caller is not a player.

Share this post


Link to post
20 hours ago, Graf Zahl said:

The difference is that hudmessages get attached to the script's owner, but hudmessagebolds get attached to all players.

Your kill script is most likely owned by the killed monster so the hudmessage will be skipped because monsters do not have a screen to attach a message to.

 

So in order for hudmessage to work, the script would need to be involved with the player in some way?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...