Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
meapineapple

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

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
  • 0

ZScript things are given editor numbers through ZMAPINFO exclusively.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×