It's a machine gun that will only keep the bipod deployed if you are holding crouch or have crouch toggled on, if the player uncrouches the weapon will automatically undeploy the bipod.
This is one part of the original UZDoom code, when the player is crouched it will jump to the Deploy state:
DECORATE
Code: Select all
TNT1 A 0 A_JumpIf(GetCrouchFactor == 0.5, "Deploy")Keep in mind I almost never use ACS and know next to nothing about it
ACS
Code: Select all
#libdefine PLAYER_VIEWHEIGHT 42
script "CheckPlayerCrouching" (void)
{
if(GetActorViewHeight(0) <= PLAYER_VIEWHEIGHT / 2 << 16)
{
GiveInventory("Deployed", 1);
}
delay(1);
}Code: Select all
TNT1 A 0 A_TakeInventory("Deployed", 0)
TNT1 A 0 ACS_NamedExecuteWithResult("CheckPlayerCrouching")
TNT1 A 0 A_JumpIfInventory("Deployed", 1, "Deploy")