Page 1 of 1

Text-script triggered but doesn't work

Posted: Tue Feb 11, 2025 4:31 am
by IgnyteZero
Ok, so in my map when one moster dies, another monster teleports (activated) to a certain point. As it arrives there it triggers several linedefs related to three different scripts. One of them is a text-script supposed to give a headsup to the player of what's going on. Now all three linedefs trigger correctly, this I've checked, but the text one still doesn't print the text for the players to read. This confuses me a lot. As I've said, I've checked so that it actually triggers by deliberately having the linedef refer to a non-existent script, which gives me an error message ingame when it occurs. Any other text message scripted in the same way works correctly. Does the Print or Hudmessage commands have a proximity limit? Is that my issue? How would I go about to solve that? Or do anyone have a better solution that works?

Anyway, I first tried using Print, using the following code:

Code: Select all

script 1 (void){					//Level 8 Text
		Print(s:"\cfWhatever text");
}
Then, having no result with that I tried Hudmessage:

Code: Select all

script 1 (void){					//Level 8 Text
		Hudmessage(s:"Whatever text"; HUDMSG_PLAIN, 1, CR_GOLD, 0.5, 0.5, 4.0);
}

Re: Text-script triggered but doesn't work

Posted: Wed Feb 12, 2025 8:00 pm
by SPZ1
Try using PrintBold or HUDMessageBold. If a monster is triggering a script, the message would be only printed to the activator which in this case is the monster.

Re: Text-script triggered but doesn't work

Posted: Thu Feb 13, 2025 5:49 am
by IgnyteZero
SPZ1 wrote: Wed Feb 12, 2025 8:00 pm Try using PrintBold or HUDMessageBold. If a monster is triggering a script, the message would be only printed to the activator which in this case is the monster.
Ah, thanks. That explains it. I'll try that.

Re: Text-script triggered but doesn't work

Posted: Thu Feb 13, 2025 10:13 am
by IgnyteZero
Works perfect now! Superthanks!

Re: Text-script triggered but doesn't work

Posted: Wed Feb 19, 2025 3:10 pm
by IgnyteZero
Ok, so using HudMessageBold worked great. But I suddenly ran into another problem with HudMessage on another map level.

I get these weird errors in UDB's script-editor:

* hudmsg_plain: Identifer has not been detected

or

* Unknown cast type in print statement
* Missing colon

The script looks like this. It's the exact script copypasted. I cannot perceive anything wrong with it.

Code: Select all

script 7 (void){					//Test
			//void HudMessage (text; int type, int id, int color, fixed x, fixed y, fixed holdTime [, fixed alpha]);
		HudMessage("AAAAAAAAAAAAA"; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.5, 4);
}

Re: Text-script triggered but doesn't work

Posted: Wed Feb 19, 2025 6:32 pm
by Heisanevilgenius
You forgot the "s:"

Code: Select all

HudMessage(s:"AAAAAAAAAAAAA"; HUDMSG_PLAIN, 0, CR_GOLD, 0.5, 0.5, 4);

Re: Text-script triggered but doesn't work

Posted: Wed Feb 19, 2025 6:42 pm
by IgnyteZero
Ahhh... such a simple mistake... I got snowblind apparently

Re: Text-script triggered but doesn't work

Posted: Tue Mar 04, 2025 10:04 am
by IgnyteZero
Okey, still adding the missing "s:" I get the "* hudmsg_plain: Identifer has not been detected" error. The strangest thing is it works on another level in my wad, but not on this specific level. I have copied it, rewritten it, everything, a thousand times. Still get that error.

It's no biggie, as the print command works fine, but I want to add a few more seconds of uptime for the message. So it's quite annoying I can't get it to work. Maybe it's an UDB issue? I don't know.

Re: Text-script triggered but doesn't work

Posted: Tue Mar 04, 2025 1:00 pm
by Enjay
I assume that it is there is other things are working but, just to check, do you have:
#include "zcommon.acs"
at the top of your scripts lump?

If it's not, then add it.

If it is there, post your whole scripts lump and it should be possible to figure out what the problem is.

Re: Text-script triggered but doesn't work

Posted: Wed Mar 05, 2025 9:11 pm
by IgnyteZero
Enjay wrote: Tue Mar 04, 2025 1:00 pm I assume that it is there is other things are working but, just to check, do you have:
#include "zcommon.acs"
at the top of your scripts lump?

If it's not, then add it.

If it is there, post your whole scripts lump and it should be possible to figure out what the problem is.
Ah, that was it. Somehow I had omitted that in just that lump for that level.

I don't have that many scripts on my levels, mostly Print commands, and they seem to work without it.

Awesome! Thanks.