Listmaps-style list of loaded maps for ZScript

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Listmaps-style list of loaded maps for ZScript

Re: Listmaps-style list of loaded maps for ZScript

by Marisa the Magician » Sun Apr 25, 2021 3:09 am

Always happy to add fancy new scripting features.

Re: Listmaps-style list of loaded maps for ZScript

by Kinsie » Sat Apr 24, 2021 10:35 pm

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!

Re: Listmaps-style list of loaded maps for ZScript

by Marisa the Magician » Wed Apr 21, 2021 4:43 am

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).

Listmaps-style list of loaded maps for ZScript

by Kinsie » Wed Apr 21, 2021 4:20 am

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.

Top