Custom weapon causes crashes no matter what

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
User avatar
DELTAtheDboi005
Posts: 108
Joined: Tue Apr 05, 2022 3:43 am

Custom weapon causes crashes no matter what

Post by DELTAtheDboi005 »

Actor UltraShotgun : Weapon 15000

{
Weapon.AmmoUse 90
Weapon.Ammogive 450
Weapon.SlotNumber 3
Weapon.SelectionOrder 400
Weapon.AmmoType "Cell"
Inventory.PickupMessage "You got the ultra shotgun! oh fuck yeah!"
Obituary "o% was FUCKING ATOMISED by k%"
States
{
Ready:
ULSH A 0 A_WeaponReady
Loop
Deselect:
ULSH A 0 A_Lower
Loop
Select:
ULSH A 0 A_Raise
Loop
Fire:
ULSH A 1 Bright
ULSH B 0 A_PlaySound ("Ultra/Fire")
ULSH B 0 A_Recoil (100)
ULSH C 2 A_FireBullets (10, 10, 50, 100, "UltraBullet")
ULSH D 2 Bright
ULSH E 2 Bright
ULSH F 2 Bright
ULSH G 2 Bright
ULSH H 2 Bright
ULSH I 2 Bright
ULSH J 2 Bright
ULSH K 4 A_CheckReload
ULSH L 4 A_PlaySound ("Ultra/Open")
ULSH M 4
ULSH N 4
ULSH O 4
ULSH P 4
ULSH Q 4
ULSH R 4
ULSH S 4 A_PlaySound ("Ultra/Close")
ULSH T 4
ULSH U 4
ULSH V 4
ULST A 4
ULST B 4
ULST C 4 A_ReFire
Goto Ready
Spawn:
ULGN A -1
Stop
}
}

Actor UltraBullet

{
Radius 30
Height 30
Damage 100
ExplosionDamage 100
Explosionradius 128
+NOBLOCKMAP
+NOGRAVITY
+ACTIVATEIMPACT
+ACTIVATEPCROSS
+NOTELEPORT
+PUFFONACTORS
+FORCERADIUSDMG
States
{
Spawn:
ULEX A 5 A_Explode (100, 128, 1)
ULEX B 5
ULEX C 5
ULEX B 5
ULEX A 5
Stop
}
}


Some help would be greatly appreciated. :(
User avatar
wildweasel
Moderator Team Lead
Posts: 21590
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Win10 22H2, Win11 22H2, macOS 11.7
Graphics Processor: nVidia with Vulkan support

Re: Custom weapon causes crashes no matter what

Post by wildweasel »

Your Ready state has a duration of 0 tics, which causes an infinite busy-loop that ultimately kills GZDoom because it cannot process anything else. I recommend setting that to 1 tic.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48537
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Custom weapon causes crashes no matter what

Post by Graf Zahl »

Same for Select and Deselect. While these will eventually terminate, this isn't safe.
Gez
 
 
Posts: 17728
Joined: Fri Jul 06, 2007 3:22 pm

Re: Custom weapon causes crashes no matter what

Post by Gez »

Note that there really isn't any reason to call A_WeaponReady several times per tic. For A_Lower and A_Raise, I can see an use; even if there are better ways to achieve the same effect; but A_WeaponReady will not do anything special he second or third or fourth (etc.) time it's called in a given tic.
User avatar
DELTAtheDboi005
Posts: 108
Joined: Tue Apr 05, 2022 3:43 am

Re: Custom weapon causes crashes no matter what

Post by DELTAtheDboi005 »

Thanks WildWeasel, Great honor to meet you guys!. :D

Return to “Technical Issues”