Is it possible to check how a player exits a map?

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
Ershantik
Posts: 19
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Is it possible to check how a player exits a map?

Post by Ershantik »

I want to know if there's any way to check if a player exits a map using the regular exit, as opposed to something like the changemap console command or level.ChangeLevel().

I'm experimenting with a level select menu and stats recorder, but I only want stats to be recorded if you beat the level legitimately, not if you leave with the level select.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Is it possible to check how a player exits a map?

Post by Gez »

I think you can use ZScript to have the exit lines, instead of using pre-existing exit specials, call a special function you'd write that would mark the exit as legit according to your system and then exit.
Ershantik
Posts: 19
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Re: Is it possible to check how a player exits a map?

Post by Ershantik »

That's basically what I ended up doing. The level data is stored on a new inventory item placed on the player, which normally records the data during its PreTraveled override. The level select calls an event handler to switch levels, which also changes a variable on the stats tracker item that prevents it from recording data. This variable then gets changed back in the Traveled override.

I'm not 100% satisfied with it, but it does what it needs to. It still shows the text screen whenever you warp to a different cluster, though.
Post Reply

Return to “Scripting”