by JPL » Wed Jul 01, 2020 3:22 pm
I'd like to make a generic randomizer mod that, among other things, exits any level to a random level instead of the one defined by "next" / "secretnext" in MAPINFO. The actual level transition I think I can do with the ACS function ChangeLevel, but I don't think ZScript has a way of getting a list (dynarray of strings?) of all available levels, ie all levels in currently loaded IWADs and PWADs, sort of like what you get with the "listmaps" console command. Not sure if this would be part of the "Wads" ZScript function group or something else, that's an implementation decision.
Edit based on some discussion below: for this to be most useful, it would be good to have an optional bool argument to pass in to this function that specifies whether to return an array of all levels including ones defined in the IWAD, or just the levels that are defined in PWADs.
It'd also be nice to not have to involve any ACS, and have the equivalent of ACS ChangeLevel in ZScript, but I can file that as a separate request if need be.
I'd like to make a generic randomizer mod that, among other things, exits any level to a random level instead of the one defined by "next" / "secretnext" in MAPINFO. The actual level transition I think I can do with the ACS function ChangeLevel, but I don't think ZScript has a way of getting a list (dynarray of strings?) of all [i]available[/i] levels, ie all levels in currently loaded IWADs and PWADs, sort of like what you get with the "listmaps" console command. Not sure if this would be part of the "Wads" ZScript function group or something else, that's an implementation decision.
Edit based on some discussion below: for this to be most useful, it would be good to have an optional bool argument to pass in to this function that specifies whether to return an array of all levels including ones defined in the IWAD, or just the levels that are defined in PWADs.
It'd also be nice to not have to involve any ACS, and have the equivalent of ACS ChangeLevel in ZScript, but I can file that as a separate request if need be.