Weapon freezes game. Help!

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Gunsym
Posts: 1
Joined: Thu Oct 19, 2017 12:10 pm

Weapon freezes game. Help!

Post by Gunsym »

So I've been working on a weapon and every time I test it out it freezes the game. It's every time that I try to equip it. If anyone knows anything about that let me know!

Thanks!
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: Weapon freezes game. Help!

Post by wildweasel »

Without being able to see your code, the one thing I can think of is your state durations. Does the Ready state have at least one tic of length?
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Re: Weapon freezes game. Help!

Post by Endie »

Maybe your rise/ready states are with 0 tics, this happened with me before
(example: TNT1 A 0 A_WeaponReady/A_Raise)
Try changing the rotations to 1 if so
(TNT1 A 1 A_WeaponReady/A_Raise)
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Weapon freezes game. Help!

Post by Matt »

A select state with a zero-length A_Raise loop should just instantly go to Ready, shouldn't it?

(but yeah, there's no way to solve a problem like this without seeing the actual code causing it - however obvious it is once seen, while unseen it could be anywhere)

Return to “Scripting”