GZDoom lump names detection

Moderator: GZDoom Developers

Post Reply
User avatar
Mere_Duke
Posts: 215
Joined: Sun Aug 28, 2016 3:35 pm
Location: Russia

GZDoom lump names detection

Post by Mere_Duke »

(Apologize if there is a reason behind the behavior I want to discuss.)
(Tested on GZDoom 3.7.1)

Without further ado, I have 'pk3' file. There are some lumps. GZDoom detects standard lump names (e.g. SNDINFO) and processes the file with that name like a sound definitions file. Also I can "extend" that file name and name it, say, SNDINFO.txt or SNDINFO.Enemies, and GZDoom will notice that SNDINFO.Enemies == SNDINFO lump. But if I name it, say, SNDINFO.Enemies.txt, it won't work. Unlike DECORATE files, that work even if named something like "DECORATE.Weapons.txt".

So, after some research, I've found that:

Code: Select all

MENUDEF.txt
SNDINFO.txt
MAPINFO.txt
will't be recognized, while:

Code: Select all

MENUDEF.Main.txt
SNDINFO.Blabs.txt
MAPINFO.Mymap.txt
won't be recognized.

And other lumps work fine, these all will be recognized by parser:

Code: Select all

DECORATE.New.Enemy.txt
Decaldef.Blood.Waterblood
GLDEFS.Sidekicks.gl
I wonder why such a restriction for that set of lumps, is it a "bug" or by intention?
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: GZDoom lump names detection

Post by Graf Zahl »

The rule is in general that the extension starts with the last '.' in the name, not the first.
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: GZDoom lump names detection

Post by Enjay »

And to add to that (Please correct me if I'm wrong) gzdoom is looking for up to 8 letter lump names an is ignoring the characters after 8. So, a name like gldefs.sidekicks.gl is being treated as s file with the extension .gl and the lump name is being truncated to gldefs.s and that's not a name gzdoom recognises.
User avatar
Mere_Duke
Posts: 215
Joined: Sun Aug 28, 2016 3:35 pm
Location: Russia

Re: GZDoom lump names detection

Post by Mere_Duke »

Enjay wrote:And to add to that (Please correct me if I'm wrong) gzdoom is looking for up to 8 letter lump names an is ignoring the characters after 8. So, a name like gldefs.sidekicks.gl is being treated as s file with the extension .gl and the lump name is being truncated to gldefs.s and that's not a name gzdoom recognises.
Seems so. I was wrong saying that "GLDEFS.Something.txt" will work, it will not; the mod I tested this on has "include" directive in "main" GLDEFS lump (but "GLDEFS.Something" will work). Actually, all lump names less than 8 chars (MENUDEF, SNDINFO, MAPINFO, ZSCRIPT, GLDEFS and probably some more I forgot) can't have long names like GLDEFS.MyMod.gl. It seems (correct me if I'm wrong) that parser finds extension (after the last '.'), truncates it and then if the remaining string is more than 8 chars, it truncates the string to 8 chars and tries to process this name as lump name (in above mentioned case it seems to be "GLDEFS.M").
So the feature I suggest is: if lump name was not recognized -> try to find a '.' in it and trunc in with everything to the right. So the "GLDEFS.M" will become "GLDEFS" and thus will work as planned.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: GZDoom lump names detection

Post by Gez »

Note that for MAPINFO, you can use the name ZMAPINFO to get an eight-char lump name. For GLDEFS, perhaps DOOMDEFS and co. still work. SNDINFO and MENUDEF, you're out of luck.


I will point out; however, that most text lumps do feature the ability to include other files. So you probably should be using that instead of relying on cumulative loading.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”