Would it be possible to extend the Wads struct with a function that can read the filename or path of the wad/pk3/directory that a lump is in?
This could be useful for operating upon a specific lump depending on what wad it comes from, or even help segregate lumps of matching names between multiple wads.
Filename/path function for Wads struct
Moderator: GZDoom Developers
-
- User Accounts Assistant
- Posts: 6001
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: Filename/path function for Wads struct
Getting the mod's filepath inside GZDoom is probably a big [No] for security reasons, as it can reveal details about the user's filesystem structure to a mod. Historically I've seen many requests denied on these grounds.
Getting the mod's filename inside GZDoom is a little more viable, but in my estimation probably still a [No] for practical reasons. Users rename their files all the time for various reasons, and it would be really bad if a mod broke because a user renamed the file The_Ivory_Tower.pk3 instead of IVRYTWR.pk3 (for example).

Getting the mod's filename inside GZDoom is a little more viable, but in my estimation probably still a [No] for practical reasons. Users rename their files all the time for various reasons, and it would be really bad if a mod broke because a user renamed the file The_Ivory_Tower.pk3 instead of IVRYTWR.pk3 (for example).

Re: Filename/path function for Wads struct
Ah. While disappointing, those are both excellent counterpoints.
-
- Lead GZDoom+Raze Developer
- Posts: 48598
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Filename/path function for Wads struct
The suggested use case is strongly discouraged because it runs the risk of breaking things as Caligari already stated. People indeed to frequently rename their things for various reasons so for content validation this is a huge no-no.
The only viable use case I can see is for implementing a directory browser.
The only viable use case I can see is for implementing a directory browser.
Re: Filename/path function for Wads struct
I fully understand the arguments against the use case for the feature.
My hope had been to exclude certain (thousands of) lumps from a loop I run to check every lump that can end up performing costly checks (mainly 3saster's MD5), but I'm certainly in favor of a smarter way to do that, especially if checking wad/dir name is infeasible.
My hope had been to exclude certain (thousands of) lumps from a loop I run to check every lump that can end up performing costly checks (mainly 3saster's MD5), but I'm certainly in favor of a smarter way to do that, especially if checking wad/dir name is infeasible.