So yeah, here's a problem I tried fixing for the past 2 hours or so to no avail. Basically I have this flame actor fired by a weapon's altfire. The idea is that if the flame collides with a monster upon entering its Death state, it will "stick" to said monster, following its movements and slowly burning it to death. Problem is, I can't seem to get it to work as intended - I've tried several different checks to get it to enter the Afterburn state, but it never does. I did get it to enter the Afterburn state once, but even then, the flame was spawning at the location of a dead monster. And I can't rename the Afterburn state to Death either, because if I do, the flames will spawn at the player's location and burn them to death due to how the "target" pointer works for projectiles (which, BTW, is really fucking stupid).
At any rate, the code for the flame actor in its current state is below:
Code: Select all
class FlamethrowerFlameWallAfterburner : FlamethrowerFlameWall
{
bool collided;
Default
{
DamageFunction (1*8);
}
States
{
Spawn:
FLME AABBCCDDEEFFGGHHIIJJKKLLMMNN 1 BRIGHT { if(GetCVar("sgd_spawntrails") == 1) { A_SpawnItemEx("FlamethrowerFinisherFlameTrail"); }}
Loop;
Death:
TNT1 A 0
{
collided = CheckProximity("SGDMonster",15.0,1,CPXF_SETTARGET); // The mod has "custom" monsters that all inherit from a base class named SGDMonster, in case you're wondering why this is here.
if(collided)
{
SetStateLabel("Afterburn");
}
}
Stop;
Afterburn:
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(5,32,XF_NOTMISSILE);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(5,32,XF_NOTMISSILE);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(5,32,XF_NOTMISSILE);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(5,32,XF_NOTMISSILE);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(4,32,XF_NOTMISSILE);
A_FadeOut(0.018);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2
{
SetOrigin(target.pos,true);
A_Explode(3,32,XF_NOTMISSILE);
A_FadeOut(0.018);
}
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2 A_FadeOut(0.018);
FLME A 0 A_PlaySound("fx/fireburn");
FLME ABCDEFGHIJKLMN 2 A_FadeOut(0.018);
Stop;
}
}