Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
rabidrage

Overlay fails

Recommended Posts

Hey guys.  Just trying to make Rabid's Crap 5.0 and I'm running into a problem.  I've taken the code from PB 3.0 for Doomguy's legs.  It's tied to the weapons, and it works with all of them except the Plasma Rifle!  For some reason, only sometimes when I fire, his legs pop up next to the gun when I'm facing forward.  What's causing it?  Here's the code.

Actor 64PlasmaRifle : PlasmaRifle Replaces PlasmaRifle
{
	Scale 0.82
	States
	{
	Select:
		TNT1 A 0 A_Overlay(-10, "FirstPersonLegsStand")
		PLSF A 1 A_Raise
		loop
	Ready: 
		PLSG A 0 A_PlaySoundEx ("weapon/plasmaidle","WEAPON",1)
	  	PLSG ABC 2 A_WeaponReady
		loop
	Deselect:
		PLSF A 0 A_StopSoundEx ("WEAPON")
		PLSF A 1 A_Lower
		loop
	Fire:
		PLSG A 5 A_FirePlasma
		PLSG B 0 A_ReFire
		Goto Ready
	Flash:
		PLSF B 4 Bright
		Goto Lightdone
		
		FirstPersonLegsHide:
			TNT1 A 20
		FirstPersonLegsStand:
			TNT1 A 0 
			TNT1 A 0 A_JumpIf(momx > 0.8 || momx < -0.8 || momy > 0.8 || momy < -0.8, "FirstPersonLegsWalk1")
			TNT1 A 0 A_JumpIf(momZ != 0, "FirstPersonLegsJump")
			TNT1 A 0 A_JumpIf(Height < 54, "FirstPersonLegsCrouch")
			TNT1 A 0 A_JumpIfInventory("FPSLegChecker", 1, 2)
			STAN A 1 
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
			}
			Loop
			TNT1 A 0 
			TNT1 A 0 A_JumpIf(Height < 54, "FirstPersonLegsCrouch")
			TNT1 A 0 A_JumpIf(momZ != 0, "FirstPersonLegsJump")
			STAN M 1 
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
			}
			Loop
			
		FirstPersonLegsCrouch:
			TNT1 A 0 
			TNT1 A 0 A_PlaySound("IronSights", 0) //Sound when player crouches
			FirstPersonLegsCrouchContinue:
			TNT1 A 0 A_JumpIf(momZ != 0, "FirstPersonLegsJump")
			TNT1 A 0 A_JumpIf(momx > 0.8 || momx < -0.8 || momy > 0.8 || momy < -0.8, "FirstPersonLegsWalk1")
			TNT1 A 0 A_JumpIf(Height > 54, "FirstPersonLegsStand")
			STAN N 1 
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
			}
			Loop
			
		FirstPersonLegsWalk1:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("FPSLegChecker", 1, "FirstPersonLegsWalk2")
			TNT1 A 0 A_JumpIf(momZ != 0, "FirstPersonLegsJump")
			TNT1 A 0 A_GiveInventory("FPSLegChecker",1)
			STAN BCCDDEEFF 1
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
				A_JumpIf(momZ != 0, "FirstPersonLegsJump");
			}
			Goto FirstPersonLegsStand
			
		FirstPersonLegsWalk2:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momZ != 0, "FirstPersonLegsJump")
			TNT1 A 0 A_TakeInventory("FPSLegChecker",1)
			STAN GHHIIJJKLL 1 
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
				A_JumpIf(momZ != 0, "FirstPersonLegsJump");
			}
			Goto FirstPersonLegsStand
			
		FirstPersonLegsJump:
			TNT1 A 0 
			STAN I 1 
			{
				A_OverlayOffset(-10, 0, (-pitch*2)+200);
			}
			Goto FirstPersonLegsStand		
	}
}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×