Listmaps-style list of loaded maps for ZScript

Moderator: GZDoom Developers

User avatar
Kinsie
Posts: 7364
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33

Listmaps-style list of loaded maps for ZScript

Post by Kinsie »

The "listmaps" console command, for those unaware, prints a list to console of all loaded maps - their lumps, map names, and the wad they come from.
Image

I feel like exposing this information to ZScript - either as an array of map lump names or a set of arrays to also cover other related info, ala AllClasses/AllActorClasses - would be fairly useful for a number of purposes. For example, a level select menu, or a map shuffler ala Dan Gaskill's Duke3D mods War of Attrition and Alien Armageddon. As things stand, doing such things either requires making big assumptions of what the user has loaded ("This is only ever gonna be used with standard Doom 2 mapsets with MAP01 through MAP32!") or writing a MAPINFO parser in ZScript, which sounds like both a pretty painful task (especially once you factor in #includes!) and a duplication of effort.

I think Marisa has some ideas about how to do this, but I'll leave it to her to explain those.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Listmaps-style list of loaded maps for ZScript

Post by Marisa the Magician »

My idea is to finally expose the level_info_t struct (along with cluster_info_t for the sake of extra information people may need), along with functions to look them up by map name and level number / cluster number.

Obviously all the data, due to its ephemeral nature, will be read-only.

Edit: I think I'm confident enough in this PR. In the end, I decided to not export cluster_info_t because, honestly, I couldn't see any real need for it from a modding sense (others may correct me if I'm wrong later).
User avatar
Kinsie
Posts: 7364
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33

Re: Listmaps-style list of loaded maps for ZScript

Post by Kinsie »

Marisa Kirisame wrote:Edit: I think I'm confident enough in this PR. In the end, I decided to not export cluster_info_t because, honestly, I couldn't see any real need for it from a modding sense (others may correct me if I'm wrong later).
This PR appears to have been merged, so this Feature Suggestion can be considered a roaring success. Thanks Marisa!
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Listmaps-style list of loaded maps for ZScript

Post by Marisa the Magician »

Always happy to add fancy new scripting features.

Return to “Closed Feature Suggestions [GZDoom]”