Well, this would be my second post (I'm new here, though not to the ZDoom engine), and I'm having a great deal of difficulty getting what I thought would be a very simple script and trap to work. Essentially, it's an attempt at creating a trap which shoot plasma (or any projectiles) at the doomguy if he moves too fast. I'm not entirely sure what the speed (defined as "velocity") should be set at, but this is simply a test run, and I'm more concerned about getting it to work at all. It may be an error with the
GetActorProperty() function (because I'm using it to tag the player), but I really have no idea. The script itself works simply as a combination of two linedefs running script 1 and 2, and a map spot (or three) to shoot.
Anyway, here's the code:
Code: Select all
/*
This is an attempt at making a sector that shoots plasma at the player if he is moving too fast.
This script will only work if the player's TID is set to 740.
*/
#library "BHE.acs"
#include "zcommon.acs"
int toggle;
int velocity;
script 1 (void)
{
velocity = GetActorProperty(740, APROP_Speed);
print(s:"your speed is ", d:velocity); //I put this in so I could debug the script by checking my velocity int.
toggle = 1;
if(velocity > 32)
{
Thing_ProjectileIntercept(741, T_PLASMABOLT, 256, 740, 742);
delay(14);
restart;
}
else
{
delay(7);
restart;
}
}
script 2 (void)
{
if(toggle == 1)
{
ACS_Terminate(1,1);
toggle = 0;
}
else
{
ACS_Execute(1,1,0,0,0);
}
}
If anyone could help me with this little dilemma, that'd be great, as I'm supposed to be coding traps and other such crap for Deathsong's Strife: BHE mod. Thanks.