we got this version to work correctly on all heretic maps, with a variation for each colored key gizmo. This was being done mainly for Reikall's "Yet Another Voxel Project"

so the gizmos were one of the most pressing ones since they looked especially awkward when placed sideways. Hopefully when I learn zscript I'll have a more elegant solution, but for now it seems to be working pretty well

Code: Select all

```
ACTOR WallCheck
{
Radius 5
+MISSILE
+THRUACTORS
+NOGRAVITY
States
{
Spawn:
TNT1 A 3
TNT1 A 1 A_Remove(AAPTR_DEFAULT)
Stop
death:
TNT1 A 2
TNT1 A 1 A_Remove(AAPTR_DEFAULT)
Stop
}
}
ACTOR RV_KeyGizmoGreen : KeyGizmoGreen replaces KeyGizmoGreen
{
-FIXMAPTHINGPOS
States
{
Spawn:
KGZ1 A 0 NoDelay A_JumpIf(GetCVAR("sv_altkeygizmo") == 0, "Idle")
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",16)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,-20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",16)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",16)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,-20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",16)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",24)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,-20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",24)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",24)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,-20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",24)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",40)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,0,-20,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",40)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",40)
KGZ1 A 2 A_SpawnItemEX("WallCheck",0,0,32,-20,0,0,0,SXF_ISTARGET|SXF_ABSOLUTEVELOCITY)
KGZ1 A 0 A_CheckProximity("Turning","WallCheck",40)
KGZ1 A 0 A_SetAngle(270)
Goto Idle
Turning:
KGZ1 A 1 A_FaceTarget
KGZ1 A 1 A_SetAngle(180+Angle)
Goto Idle
Idle:
KGZ1 A 1
KGZ1 A 1 A_SpawnItemEx("KeyGizmoFloatGreen", 0, 0, 60)
KGZ1 A -1
Stop
}
}
```