How to stop GZDOOM offering episode selection for NERVE.WAD

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
MartinHowe
Posts: 2047
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

How to stop GZDOOM offering episode selection for NERVE.WAD

Post by MartinHowe »

I am trying to load NERVE.WAD as a regular PWAD. However, if I start the game without -warp and select "New Game", GZDoom insists on offering me episode selection for Hell on Earth or No rest for the Living. I understand why this is done; however, I have never been happy with engines that do things behind my back. I really would prefer engines that respond only to the command line, generated by my launcher script, and obey it strictly.

That said, this seems to be done in the MAPINFO lump in gzdoom.pk3. I have created a MAPINFO lump for this which displays the bizarre effect of replacing the music tracks correctly, but plays MAP01 from the DOOM2 IWAD instead of the ones in NERVE.WAD. Since NERVE.WAD is loaded after DOOM2.WAD, surely its map lumps should replace the ones in DOOM2.WAD?

Code: Select all

clearepisodes
episode map01
{
	name = "No Rest for the Living"
}

map MAP01 lookup "NHUSTR_1"
{
	titlepatch = "NWILV00"
	next = "MAP02"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 75
	music = "$MUSIC_MESSAG"
}

map MAP02 lookup "NHUSTR_2"
{
	titlepatch = "NWILV01"
	next = "MAP03"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 105
	music = "$MUSIC_DDTBLU"
}

map MAP03 lookup "NHUSTR_3"
{
	titlepatch = "NWILV02"
	next = "MAP04"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 120
	music = "$MUSIC_DOOM"
}

map MAP04 lookup "NHUSTR_4"
{
	titlepatch = "NWILV03"
	next = "MAP05"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 105
	music = "$MUSIC_SHAWN"
}

map MAP05 lookup "NHUSTR_5"
{
	titlepatch = "NWILV04"
	next = "MAP06"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 210
	music = "$MUSIC_IN_CIT"
}

map MAP06 lookup "NHUSTR_6"
{
	titlepatch = "NWILV05"
	next = "MAP07"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 105
	sucktime = 1
	music = "$MUSIC_THE_DA"
}

map MAP07 lookup "NHUSTR_7"
{
	titlepatch = "NWILV06"
	next = "MAP08"
	secretnext = "MAP09"
	sky1 = "SKY1"
	cluster = 11
	par = 165
	map07special
	music = "$MUSIC_IN_CIT"
}

map MAP08 lookup "NHUSTR_8"
{
	titlepatch = "NWILV07"
	next = "EndGameC"
	secretnext = "EndGameC"
	sky1 = "SKY1"
	cluster = 11
	par = 105
	music = "$MUSIC_SHAWN"
}

map MAP09 lookup "NHUSTR_9"
{
	titlepatch = "NWILV08"
	next = "MAP05"
	secretnext = "MAP05"
	sky1 = "SKY1"
	cluster = 11
	par = 135
	music = "$MUSIC_DDTBLU"
}

cluster 11
{
	flat = "SLIME16"
	exittext = lookup, "NERVETEXT"
}
The command line is gzdoom.exe -iwad doom2 -file nerve.wad nerve where nerve is a directory containing the MAPINFO text file above.

I am surely doing something wrong here - can anyone tell me what?
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: How to stop GZDOOM offering episode selection for NERVE.

Post by Rachael »

The problem here is GZDoom does this to NERVE.WAD in order to have Doom 2 BFG compatibility. It silently renames the levels from MAP## to LEVEL## in the background so that it works with its own internal mapinfo.

The trick is to just add a lump to NERVE.WAD and name the lump something silly - doesn't really matter what it is, just as long as it breaks the wad's checksum - and then it won't recognize it anymore. It'll act like a normal PWAD then.
User avatar
MartinHowe
Posts: 2047
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: How to stop GZDOOM offering episode selection for NERVE.

Post by MartinHowe »

Thanks @Rachael

During the night I figured out that, as you say, this must be a HEAD -> LICH situation; it seemed odd that the gzdoom MAPINFO had LEVEL01 etc., in it; wish I'd thought of it earlier. Rather than add a dummy entry at the end or change a byte in slack space in a data structure I created a MAPINFO that takes the renames into account and just clears all episodes than HoE.

For the curious, the original motivation was to have the wad loaded with just a changed TITLEPIC (based on the NERVE DMENUPIC, as others have done) and go straight into the game from the main menu.

In case anyone's interested I've attached the PK3 of the result - feel free to mess with it if you want.
nerve.pk3
You do not have the required permissions to view the files attached to this post.
sacarias
Posts: 50
Joined: Wed Oct 02, 2019 9:39 am

Re: How to stop GZDOOM offering episode selection for NERVE.WAD

Post by sacarias »

I know this is very old thread, but I think it's still on-topic...

In my case, I'd like to make nerve.wad to behave like this: when loaded, keep original level numbering MAP##, but renumbering nerve's levels to MAP33-MAP41, so that they work with -warp and also idclev##.

OP's solution works to be able to play nerve.wad more "appropriately", but still -warp and idclev## don't work: they'll only load Hell on Earth levels.

After reading the docs about lumps, pk3, mapinfo, etc (because I'm beginner at this), I tried an idea of adding "aliases" to nerve levels, by adding lines "levelnum = ##" to OP's suggested mapinfo.txt, where ## was 33, 34, 35, etc.
Result: a console crash saying "LEVEL01 not found".

Do you think it's possible in (g)zdoom to "make aliases" to levels so that they work with -warp and idclev and without modifying original mapinfos nor wads?

Also, for the suggestion of "adding a nonsense lump to nerve.wad so checksum changes", I thought a more direct approach would be possibly just appending null characters just at the end of the file (NO other characters such as spaces or newlines, but immediate null characters). I think this was called "zero padding" for binaries, or something like that.

On Linux command line (typically Bash), this could be done like this:

Code: Select all

printf "%b" '\0' >> NERVE.WAD
I don't know how it would be done on Windows command line though...
I tried it and it worked, at least just like how it was described in OP.
What would you think?

Thanks.

Return to “Assets (and other stuff)”