[Added] ZScript function for iterating through lumps

Moderator: GZDoom Developers

ZScript function for iterating through lumps

Postby Marisa Kirisame » Sun Nov 03, 2019 8:20 am

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.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: ZScript function for iterating through lumps

Postby _mental_ » Sun Nov 03, 2019 8:49 am

On C++ side it's usually done with GetNumLumps + GetLumpNamespace + GetLumpName.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: ZScript function for iterating through lumps

Postby Graf Zahl » Sun Nov 03, 2019 8:57 am

The only way on the C++ side is a simple loop iterating over the entire directory.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript function for iterating through lumps

Postby Nash » Sun Nov 03, 2019 1:54 pm

This would indeed be useful for crafting some kind of system where the user can drop in additional content. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript function for iterating through lumps

Postby _mental_ » Mon Nov 25, 2019 10:40 am

Exported all needed methods in 20d3752. A testing script is here.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: ZScript function for iterating through lumps

Postby Nash » Mon Nov 25, 2019 11:17 am

Very nice! Thanks for fast and amazing work, as usual, _mental_. :D
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript function for iterating through lumps

Postby Major Cooke » Mon Nov 25, 2019 11:21 am

Hell yeah, this is awesome. Thanks Mental!
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript function for iterating through lumps

Postby Marisa Kirisame » Mon Nov 25, 2019 11:27 am

Aw yeah, thanks!
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests