Game stops responding after spawning in a custom item?

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!)
Post Reply
User avatar
JtoTheB
Posts: 26
Joined: Sat Aug 09, 2025 9:46 am
Operating System Version (Optional): Windows 11
Location: New Jersey

Game stops responding after spawning in a custom item?

Post by JtoTheB »

So basically, in my mod I've made a custom health actor that are supposed to be used in one of my levels. As i tested out something, I realized that whenever you spawned it in the game would freeze immediately. Any fix for this?

Code: Select all

ACTOR Roti : Health 7869
{
Inventory.Amount 25
Inventory.PickupMessage "A sacred roti!"
Inventory.PickupSound "misc/eat"
States
	{
	Spawn:
	  ROT1 A 0
	  Loop
	}
}
User avatar
Enjay
 
 
Posts: 27060
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Game stops responding after spawning in a custom item?

Post by Enjay »

I suspect that the problem is that you have set the duration of the spawn state to 0 and then asked that to loop.

Either change the 0 to some positive value or change it to -1 and change "loop" to "stop". Given that it's only 1 frame with nothing special going on, the -1 and stop option makes sense.
User avatar
JtoTheB
Posts: 26
Joined: Sat Aug 09, 2025 9:46 am
Operating System Version (Optional): Windows 11
Location: New Jersey

Re: Game stops responding after spawning in a custom item?

Post by JtoTheB »

Yeah, what you said worked. Thanks again Enjay!
Post Reply

Return to “Scripting”