ZScript function for iterating through lumps

Moderator: GZDoom Developers

Post Reply
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
Contact:

ZScript function for iterating through lumps

Post by Marisa the Magician »

We have them for searching lumps by a specific name, but what if I wanted to do something different like, say, building a list of all lumps in the music namespace for a playlist?

If there's already something for this on the C++ side I'd gladly just expose it myself.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: ZScript function for iterating through lumps

Post by _mental_ »

On C++ side it's usually done with GetNumLumps + GetLumpNamespace + GetLumpName.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript function for iterating through lumps

Post by Graf Zahl »

The only way on the C++ side is a simple loop iterating over the entire directory.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: ZScript function for iterating through lumps

Post by Nash »

This would indeed be useful for crafting some kind of system where the user can drop in additional content. :)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: ZScript function for iterating through lumps

Post by _mental_ »

Exported all needed methods in 20d3752. A testing script is here.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: ZScript function for iterating through lumps

Post by Nash »

Very nice! Thanks for fast and amazing work, as usual, _mental_. :D
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript function for iterating through lumps

Post by Major Cooke »

Hell yeah, this is awesome. Thanks Mental!
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
Contact:

Re: ZScript function for iterating through lumps

Post by Marisa the Magician »

Aw yeah, thanks!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”