Jump to content
  • 0

GZDoom: How to show a message upon using/activating a Thing?


meapineapple

Question

I have an actor representing a sign and I'd like to display some text for a short time after the player presses use while looking at the sign. How can I accomplish this with GZDoom?

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 0

Oh hold up I've answered my own question.

 

In my DECORATE lump:

actor Metal_Sign 10360
{
    Height 32
    Radius 32
	+SOLID
	+BUMPSPECIAL
	+USESPECIAL
	States
	{
	    Spawn:
		    SGN0 A -1
			Stop
	}
}

My SCRIPTS lump:

#include "zcommon.acs"

script "Sign_Route_101" ENTER {
	Print(s:"Route 101\nNorth to Mauville");
}

script "Sign_Seaside_Cycling" ENTER {
	Print(s:"Seaside Cycling Road");
}

My Thing properties:

 

image.png.741acf9a4650cb9c1722520f9ed66633.png

 

Works great. Bumping or using the sign Thing displays the message exactly as I was hoping for.

 

Share this post


Link to post
  • 0

Here is one way to do it:

class m8f_hn_Sign : Actor
{

  Default
  {
    Health 30;
    Height 10;
    Radius  3;
    +SOLID;
    +NOBLOOD;
    +NOTONAUTOMAP;
    +DONTTHRUST;
    Tag "Sign";
  }

  States
  {
    Spawn:
      HNWS B -1;
      Stop;
  }

  override bool Used(Actor user)
  {
    user.A_Print("Your text");
    return true;
  }

} // m8f_hn_Sign

This is the simplified sign from one of my mods.

This is a working sign mod. You can summon it with

summon m8f_hn_sign

console command.

 

sign.zip

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
Answer this question...

×   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...