Page 1 of 1

Failure with batch files

Posted: Thu Jul 19, 2012 20:18
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.

Re: Failure with batch files

Posted: Thu Jul 19, 2012 20:37
by NeuralStunner
-Warp takes numbers, not a map name. That would be -map map01.

Re: Failure with batch files

Posted: Thu Jul 19, 2012 21:18
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.

Re: Failure with batch files

Posted: Fri Jul 20, 2012 10:29
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. :?:

Re: Failure with batch files

Posted: Fri Jul 20, 2012 17:09
by NeoHippo
You're right. Reading the WIKI it says +map.
I tried both, +map and -map, and both work.

Re: Failure with batch files

Posted: Fri Jul 20, 2012 22:44
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;
		}
	}