Game Crashes when Killed while ADS

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

Game Crashes when Killed while ADS

#1

Post by Fabysk » Wed Dec 18, 2013 11:43 pm

Recently, I was able to implement the Black Ops 2 weapons into Project 115 with full success. But when I get killed while aiming down the sights, the game crashes :neutral: . I'm not sure what the problem is here , but if anyone can help, that would be great.

Code: Select all

ACTOR Type25 : Weapon 20006
{ 
	Spawnid 202
	Weapon.AmmoType "Type25Ammo" 
	Weapon.AmmoGive 999
	Weapon.AmmoUse 1
	Weapon.SlotNumber 5
	Inventory.PickupSound "misc/w_pkup" 
	AttackSound "weapons/TYPE25"
	Decal "BulletChip"
	+NOAUTOFIRE
	States 
	{ 
	Spawn: 
		MGU3 A -1 
		Loop 
	Ready: 
		TPH1 A 1 A_WeaponReady 
		Loop 
	Deselect: 
		TPH1 A 1 A_Lower 
		Loop 
	Select: 
		TPH1 A 1 A_Raise 
		Loop 
	Fire: 
		TPH1 A 0 A_SetPitch (pitch-2.0)
		TPH1 A 1 A_GunFlash
		TPH1 B 2 A_FireBullets(5, 1, 1, 2, 0, 1)
		TPH1 A 1 A_ReFire
		goto Ready
	AltFire:
		TPH1 B 0 A_GiveInventory("sightsType25")
		TPH1 B 0 A_SelectWeapon("sightsType25")
		TPH1 A 0 A_Lower 
		Loop
	}
} 
actor sightsType25 : Weapon 20007
{
	Decal "BulletChip"
	Weapon.AmmoType "Type25Ammo" 
	Weapon.AmmoGive 999
	Weapon.AmmoUse 1
	AttackSound "weapons/TYPE25"
	Weapon.AmmoGive 0
	States
	{
		Select:
		TPH1 C 0 A_ZoomFactor(1.5)
		TPH1 C 1 A_Raise
		Loop
	
		Ready:
		TPH1 C 1 A_WeaponReady
		Loop
		
		AltFire:
		TPH1 C 0 A_ZoomFactor(1.5)
		TPH1 C 0 A_Takeinventory("sightsType25")
		TPH1 C 1 A_SelectWeapon("Type25")
		Goto Deselect
		
		Deselect:
		TPH1 C 0 A_Lower
		Loop
		
		Fire:
		TPH1 C 0 A_SetPitch (pitch-1.4)
		TPH1 C 1 A_GunFlash
		TPH1 D 2 A_FireBullets(2, 1, 1, 2, 0, 1)
		TPH1 C 1 A_ReFire
		Goto Ready
	}
}
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: Game Crashes when Killed while ADS

#2

Post by Ænima » Wed Dec 18, 2013 11:44 pm

Code: Select all

        Deselect:
        TPH1 C 0 A_Lower
        Loop
Probably that.

http://en.wikipedia.org/wiki/Infinite_loop
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Game Crashes when Killed while ADS

#3

Post by Fabysk » Wed Dec 18, 2013 11:49 pm

Ænima wrote:

Code: Select all

        Deselect:
        TPH1 C 0 A_Lower
        Loop
Probably that.
No luck, that didn't work :(

EDIT: I figured out the problem. Thanks anyways Ænima
Last edited by Fabysk on Thu Dec 19, 2013 12:14 am, edited 1 time in total.
Image Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: Game Crashes when Killed while ADS

#4

Post by Ænima » Thu Dec 19, 2013 12:12 am

Fabysk wrote:
Ænima wrote:

Code: Select all

        Deselect:
        TPH1 C 0 A_Lower
        Loop
Probably that.
No luck, that didn't work :(
No I mean that's what's causing the crash. There has to be a state with at least 1 tic duration in a Deselect state somewhere. When you die, you don't switch to another weapon, but your current weapon loops its Deselect state. Since yours has zero delay, it causes a crash.
Last edited by Ænima on Thu Dec 19, 2013 12:13 am, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Game Crashes when Killed while ADS

#5

Post by Fabysk » Thu Dec 19, 2013 12:36 am

Ænima wrote: No I mean that's what's causing the crash. There has to be a state with at least 1 tic duration in a Deselect state somewhere. When you die, you don't switch to another weapon, but your current weapon loops its Deselect state. Since yours has zero delay, it causes a crash.
I just realized that; with a surprise seeing that it was supposed to be at 1. I'm getting better at DECORATE little by little. Thanks for the help :smile:
Image Image Image

Post Reply