[r376] Problems with -dir switch

Bugs that have been resolved.

Moderator: Graf Zahl

User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

[r376] Problems with -dir switch

Post by MartinHowe »

Command line (split onto single lines for clarity):

Code: Select all

"D:\Documents\My Projects\References\DoomEngine\Svn\GZDoom.exe"
-iwad "D:\Documents\My Projects\References\DoomEngine\Common\Doom2.wad"
-dir "D:\Documents\My Projects\GoodGuyz\Working"
-file "D:\Documents\My Projects\GoodGuyz\Example.pk3"
+logfile "D:\Documents\My Projects\GoodGuyz\Output\run.log"
+playerclass "S.O.E. Commando"
Expected result:
The order of loading is preserved; that is, directory "D:\Documents\My Projects\GoodGuyz\Working" loaded first as if it were a PK3,
THEN file "D:\Documents\My Projects\GoodGuyz\Example.pk3".

Actual result:
The directory Working is loaded last, so the classes it defines are missing when Example.pk3 is loaded and DECORATE errors result.

Note also:
If both arguments are supplied as directories, even with -dir prefixing each individually on the command line, only the first is loaded.
If both arguments are supplied as PK3s or if Working is a PK3 and Example is a directory, it works fine.

Run log:

Code: Select all

Log started: Sun Jul 05 14:26:07 2009

W_Init: Init WADfiles.
 adding D:/Documents/My Projects/References/DoomEngine/Svn/gzdoom.pk3, 402 lumps
 adding D:/Documents/My Projects/References/DoomEngine/Common/Doom2.wad, 2919 lumps
 adding D:/Documents/My Projects/GoodGuyz/Example.pk3, 2109 lumps
 adding D:\Documents\My Projects\GoodGuyz\Working, 1410 lumps
I_Init: Setting up machine state.
CPU Speed: 1729 MHz
CPU Vendor ID: GenuineIntel
  Name: Intel(R) Core(TM)2 CPU T5300 @ 1.73GHz
  Family 6, Model 15, Stepping 2
  Features: MMX SSE SSE2 SSE3 SSSE3
I_InitSound: Initializing FMOD
FMOD Sound System, copyright © Firelight Technologies Pty, Ltd., 1994-2009.
V_Init: allocate screen.
S_Init: Setting up sound.
ST_Init: Init startup screen.
P_Init: Checking cmd-line parameters...
G_ParseMapInfo: Load map definitions.
S_InitData: Load sound definitions.
Texman.Init: Init texture manager.
ParseTeamInfo: Load team definitions.
LoadActors: Load actor definitions.
Script error, "Example.pk3:decorate.txt" line 4069:
Parent type 'RadiationSuit' not found in SuitOfSafety
Script error, "Example.pk3:decorate.txt" line 4106:
"inventory.pickupsound" requires an actor of type "Inventory"
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: [r376] Problems with -dir switch

Post by Graf Zahl »

Sorry, can't be done. I had to add the -dir switch to circumvent all the stuff going on in the WAD loading code. As a result the -dir is always processed last and can only be set once.
User avatar
MartinHowe
Posts: 154
Joined: Tue Aug 30, 2005 22:07
Location: East Suffolk (UK)

Re: [r376] Problems with -dir switch

Post by MartinHowe »

Hmm; pity, but it isn't the end of the world, I guess.

However, I am curious about the phrase "circumvent" the WAD loading code? Does that mean that we're (end users/wad developers) not supposed to be using -dir anyway? (I mean in the sense of it being only meant to be used during ZDoom's development and might disappear at any time)
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: [r376] Problems with -dir switch

Post by Graf Zahl »

The problem with the WAD loading code is that it contains lots of checks that implicitly assume that a file is being loaded and when passing a directory it would just fail miserably.

The only option short of a complete rewrite was not to have the directory being specified through the checks and the only way to do that was to set it after all the WADs have been processed.

It's a perfectly fine feature but unfortunately suffers from a few limitations.

Return to “Closed Bugs”