Is it possible to load specific level from zscript without hacks?
I know how do so using hack, change nextlevel field in level locals to desired and then instantly finish current level, but like I said that a hack.
Load specific level from zscript
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!)
- Caligari87
- Admin
- Posts: 6174
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Load specific level from zscript
Why do you say that's a hack? I'm happy to be corrected, but to me that sounds like a perfectly fine way of doing it. Not everything needs a dedicated function.
Re: Load specific level from zscript
But there already *is* a dedicated internal function to do this... It's just not exposed to ZScript, so there's just no clean and easy way to do the equivalent of the ACS [wiki]ChangeLevel[/wiki] function from ZScript right now.
- 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: Load specific level from zscript
I'm with Cali on this one, "set next, finish this" just seems fairly normal as far as these things go.
Re: Load specific level from zscript
Yes, not everything require its own function. But next level is not a simple integer or some struct, which can be harmlessly accessed and changed directly, without specific function.
It can break hub levels, as example.
It can break hub levels, as example.
Re: Load specific level from zscript
AFADoomer has also suggested another idea implicitly. You can call an ACS script from ZScript, and the ACS script called uses ChangeLevel accordingly, to cleanly change the level. In any case, that provides a good case to make a feature suggestion to expose ChangeLevel to ZScript...
- Player701
-
- Posts: 1640
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Load specific level from zscript
To anyone who's going to search for how to change to a specific map from ZScript: there is no need to use ACS anymore, newer devbuilds and the next release (don't ask me when) will have this method available in LevelLocals for direct use. (Hope this was not a useless bump)