Integer value displaying

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
HellBlade64
Posts: 48
Joined: Tue May 13, 2014 3:00 pm

Integer value displaying

Post by HellBlade64 »

I'm working on a secret right now that relies on specific integer values to be met, and I am trying to figure out how to see what the integer values are while testing.
I have a passive display working via puke to display the values as HudMessage text, but I was wondering if there's a way to make it an active display that increments/decrements with the integer values.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Integer value displaying

Post by Sarah »

If you are working with ACS, then you could write a simple OPEN or ENTER script.

Example:

Code: Select all

script 1 OPEN
{
	SetHudSize(640, 480, true);
	HudMessage(s:"The integer value is: ",
		d:YOUR_VAR_NAME;
		HUDMSG_PLAIN, 1, CR_RED, 200.1, 300.1, 1.0);
	delay(1);
}
SetHudSize lets you set a screen size, in this example 640x480, and then your X and Y values for the location of the HudMessage become pixel coordinates. The .1 at the end of the XY positions tell the engine to use the upper left corner of the text as the point the text is anchored to.

This code should display a continuous message to the screen -- replace YOUR_VAR_NAME with the name of your variable.

Lastly the delay is necessary otherwise the script will be treated as runaway and terminated by the VM.


Lastly, lastly, if you are using ZScript -- that's a whole other ball game.
Post Reply

Return to “Scripting”