Code: Select all
version "3.3"
Class PuffChecker : Actor replaces Bulletpuff
{
Default {
+NOBLOCKMAP
+NOGRAVITY
-ALLOWPARTICLES
+DONTSPLASH
+PUFFGETSOWNER
}
states
{
Spawn:
TNT1 A 1 NoDelay {
if (target) {
angle = target.angle;
pitch = target.pitch;
}
string hittex;
FLineTraceData linedata;
LineTrace(angle,radius+8,pitch,TRF_THRUACTORS|TRF_NOSKY,0,0,0,linedata);
if (linedata.HitType == TRACE_HitFloor)
hittex = texman.GetName(floorpic);
else if (linedata.HitType == TRACE_HitCeiling)
hittex = texman.GetName(ceilingpic);
else
hittex = texman.GetName(linedata.HitTexture);
Console.PrintF("%s",hittex);
}
stop;
}
}
Class RocketChecker : DoomImpBall replaces Rocket
{
states
{
Death:
TNT1 A 0 A_SpawnItemEx("PuffChecker");
goto super::death;
}
}
If you try to shoot the projectile, which spawns the puff, which does the linetrace, you'll be able to receive wall texture names but not floor or ceiling texture names, i.e. linetrace will consider that it didn't hit either. If you add NOINTERACTION to the puff, linetrace will be able to hit the ceiling but still not the floor.
If you instead just fire a hitscan attack that spawns the same puff, you'll still be able to receive wall texture names, but with ceilings and floors — only sometimes.
There are also some other variables involved, but overall this behavior seems really weird to me. It looks like, to get a solid result I should make the distance of the check pitch-dependent, but I'm not sure. I'd appreciate any advice.