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

an awkward problem with Doombuilder 2

Recommended Posts

Hi to everybody, it is a pleasure to see how many Doom modders still exist out there.

returning to the problem, i was trying to use (like quite everybody here) a simple Hudmessage; this is the code:

-----------------------------------------------------------------
#include "zcommon.acs"

int health;

[...]

script 4 (void)
{
SetFont ("SMALLFONT");
while (GetActorProperty (30, APROP_Health) > 1)
{
health = GetActorProperty (30, APROP_HEALTH);
HudMessageBold (s:"\crGory : " ,d:health;
HUDMSG_PLAIN, 1, CR_RED, -0.8, 0.8, 0);
delay (1);

}
}
-------------------------------------------------------------------

maybe you will ask, so where is the problem? well, Doombuilder 2 script editor recognise the semicolon after "d:health" as an end of line and omit the rest of the code.
i may also use this alternative code listed below, but is the ugliest i ever seen.

-------------------------------------------------------------------
#include "zcommon.acs"

int health;

script 4 (void)
{
while (GetActorProperty (30, APROP_Health) > 1)
{
health = GetActorProperty (30, APROP_HEALTH);
Printbold (s:"\crGory : ",d:health);
Delay (1);
}
}
--------------------------------------------------------------------

the question is, can i still use the script builder in Doombuilder 2, or i must use another program like Deepsea or ACC115 to do this? if i can still use DB 2, where i missed something? thak you all.

Share this post


Link to post

My mistake - I should have acquainted myself with the HudMessage syntax before replying. This worked for me in GZDoom after a bit of trial and error.


#include "zcommon.acs"

[...]

script 4 ENTER
{
SetFont ("SMALLFONT");
while (GetActorProperty (0, APROP_Health) > 1)
{
int health = GetActorProperty (0, APROP_HEALTH);
HudMessageBold (s:"\crGory : ", d:health;
HUDMSG_PLAIN, 1, CR_RED, -0.8, 0.8, 0);
delay (1);
}
}


Changed the script type to ENTER so it will run automatically instead of having to be puked from the console, set the "GetActorProperty" TID to 0 (the activator) and changed how the health integer is defined. Now I'll just sit back and wait for someone to tell me I've done it all wrong.

Share this post


Link to post

thank you for your effort, finally i found what gave me the error. the first one is how the integer was defined (i don't know why it doesen't work previus), and second, the x,y coordinates: -8,8 are too big numbers and they simply went outside my screen. i changed that with -0.02,0.05 and now it fits perfectly. thank you again for your support.

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
×