Failure with batch files

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
NeoHippo
Posts: 408
Joined: Tue Sep 13, 2005 0:47
Location: British Columbia Canada

Failure with batch files

Post by NeoHippo »

I haven't started GZDoom with a batch file for a long time.
The start process seemed to run okay
Spoiler:
But then I am got this message:
Spoiler:
I ran a batch file from the PWAD folder:

Code: Select all

H:\DOOM\ENGINES\GZDOOM\gzdoomr1402\gzdoom.exe -file Cheogsh.wad -warp map01
and from the GZDoom folder:

Code: Select all

gzdoom.exe -file H:\PWADs\PWADS_D2\Cheogsh\Cheogsh.wad -warp map01
with the same result.

Not just with r1402, I tried several SVN versions, including r1424

I tried to warp to different maps, and I tried different PWADs, with always the same result:
Could not find map MAP00

Every other method of running PWADs works okay, just not from a batch file.
User avatar
NeuralStunner
Posts: 253
Joined: Tue Dec 29, 2009 3:46
Location: IN SPACE
Contact:

Re: Failure with batch files

Post by NeuralStunner »

-Warp takes numbers, not a map name. That would be -map map01.
Dean Koontz wrote:Human beings can always be relied upon to exert, with vigor, their God-given right to be stupid.
Spoiler: System Specs
User avatar
NeoHippo
Posts: 408
Joined: Tue Sep 13, 2005 0:47
Location: British Columbia Canada

Re: Failure with batch files

Post by NeoHippo »

I'm sure that in the days of olde I used -warp E1M1 or -warp MAP01, depending on the IWAD.

So I tried your suggestion

Code: Select all

gzdoom.exe -file H:\PWADs\PWADS_D2\Cheogsh\Cheogsh.wad -map map01
and it works. Thank you.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Failure with batch files

Post by Enjay »

I thought the map argument had to be "+map", not "-map" because it's actually a console command and not a command line argument. :?:
User avatar
NeoHippo
Posts: 408
Joined: Tue Sep 13, 2005 0:47
Location: British Columbia Canada

Re: Failure with batch files

Post by NeoHippo »

You're right. Reading the WIKI it says +map.
I tried both, +map and -map, and both work.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Failure with batch files

Post by Gez »

It's kinda odd. When +map is used on a command line, it is not actually used as a console command. But I don't see code that'd make -map work here.

Code: Select all

	p = Args->CheckParm ("-warp");
	if (p && p < Args->NumArgs() - 1)
	{
		int ep, map;

		if (gameinfo.flags & GI_MAPxx)
		{
			ep = 1;
			map = atoi (Args->GetArg(p+1));
		}
		else 
		{
			ep = atoi (Args->GetArg(p+1));
			map = p < Args->NumArgs() - 2 ? atoi (Args->GetArg(p+2)) : 10;
			if (map < 1 || map > 9)
			{
				map = ep;
				ep = 1;
			}
		}

		startmap = CalcMapName (ep, map);
		autostart = true;
	}

	// [RH] Hack to handle +map. The standard console command line handler
	// won't be able to handle it, so we take it out of the command line and set
	// it up like -warp.
	FString mapvalue = Args->TakeValue("+map");
	if (mapvalue.IsNotEmpty())
	{
		if (!P_CheckMapData(mapvalue))
		{
			Printf ("Can't find map %s\n", mapvalue.GetChars());
		}
		else
		{
			startmap = mapvalue;
			autostart = true;
		}
	}
Locked

Return to “Closed Bugs”