float GetZAt(x, y, angle, flags, pick_pointer);
Gets the floor z at x distance ahead and y distance to the side in relative form from the calling actor pointer. Flags are as follows (GZF_ prefix):
- CEILING: Returns the ceiling z instead of floor.
- ABSOLUTEPOS: x and y are absolute positions.
- ABSOLUTEANG: angle parameter does not add the pointer's angle to the angle parameter.
- 3DRESTRICT: Ignore midtextures and 3D floors whose floorz is above the actor's z.
- NOPORTALS: Don't check through portals.
- NO3DFLOORS: Ignore all 3D floors.
As it stands, I have in one of my projects a VERY unwieldy system that calls A_Warp to move an actor towards a location, grab the floorz, and head back to the origin. After a while, mounting the A_Warp calls slowly becomes a BIT expensive when relying on multiple actors to get the job done.
Cutting out the need to move at all can enhance this performance by removing the unneeded overhead. So I came up with this. It's basically GetSectorFloor/CeilingZ for DECORATE, but better and enhanced with the same genious relativity of A_SpawnItemEx.
A test sample:
Code: Select all
Actor Da
{
+NOINTERACTION
States
{
Spawn:
TNT1 A 35 NoDelay
{
A_Log("My FloorZ Is");
A_Warp(AAPTR_PLAYER1,x,y,z,0,WARPF_NOCHECKPOSITION|WARPF_ABSOLUTEPOSITION,"Null");
A_LogFloat(FloorZ);
A_LogFloat(GetZAt(0,0));
A_Log("50 Units From Me Is");
A_LogFloat(GetZAt(50,0));
}
Stop
}
}