Zscript: Event Handlers
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!)
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!)
Zscript: Event Handlers
Which part of event handlers run whenever you start a new level? I've tried WorldThingSpawned, PlayerRespawned, WorldLoaded, PlayerEntered, and OnRegister. My code might be faulty, but to pin it down I also need help on what runs when you start a new level.
- 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
- Contact:
Re: Zscript: Event Handlers
WorldLoaded should do the trick, but (and we have no idea without seeing the code) your particular usage might be an edge case it doesn't handle as expected. What exactly are you trying to do with this script?
Re: Zscript: Event Handlers
Yeah, it was world loaded. It was an error on my part. Was attaching a thinker to track game mechanics for a class on each level. I forgot it has an inventory item to stop repeated running.
Also was wrongly running it on staticeventhandler. Whoops.
Also was wrongly running it on staticeventhandler. Whoops.