Does UnrealEd.exe accept command line parameters?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 2807
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Does UnrealEd.exe accept command line parameters?

Post by Barbie »

The subject is question enough: Does Unreal Tournaments' UnrealEd.exe accept command line parameters? I tried

Code: Select all

UnrealEd.exe Drive:\Path\To\Map.unr
and all combinations of

Code: Select all

UnrealEd.exe [/?|/help|-?|-help
but all without success.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Wormbo
Adept
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm
Contact:

Re: Does UnrealEd.exe accept command line parameters?

Post by Wormbo »

I don't think you can specify a map to open directly. However, like the game, the editor supports specifying an exec file via the command line and almost every feature of the editor is internally implemented as a console command.

You could try creating a batch file with something like:

Code: Select all

@echo off
echo MAP LOAD FILE="%1">%TMP%\LoadMap.txt
start UnrealEd.exe -exec=%TMP%\LoadMap.txt
First line just turns off showing commands while they are executed.
Second line creates a file called LoadMap.txt in the folder specified by the TMP variable, i.e. your system or user temp folder, and writes the console command (MAP LOAD FILE="whatever you passed as first parameter to the batch file") to be executed to it.
Last line uses the start.exe utility to run UnrealEd without keeping the batch file's console window open. It passes the just created exec file's name to the editor, which hopefully* attempts to load the map file you specified on the batch file's command line.

It should be possible to drag&drop a map file to the batch file (or on a link to it) or associate the batch file with the map file extension as a secondary context menu operation.

Apart from the -exec= parameter, UnrealEd.exe should also accept similar low-level parameters as the game itself, e.g. for specifying ini files or opening the log window from the start.

*Disclaimer: I didn't test this.
User avatar
Barbie
Godlike
Posts: 2807
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Does UnrealEd.exe accept command line parameters?

Post by Barbie »

Unfortunately that does not work, there just happens... nothing, even if I try it directly by command line:

Code: Select all

D:\Programme\UT\System\UnrealEd.exe -exec MAP LOAD FILE=P:\MHHouseOfPsychos\MH-HouseOfPsychos.unr
In all cases the command is logged in an early stage in Editor.log:
Editor.log wrote:Init: Command line: -exec MAP LOAD FILE=P:\MH-HouseOfPsychos\MH-HouseOfPsychos.unr
respectively
Editor.log wrote:Init: Command line: -exec MAP LOAD FILE=Drive:\Path\To\My\TmpDir\LoadMap.txt
If I start UnrealEd.exe without parameters and enter the above command MAP LOAD FILE=... into the command text control, the editor loads the map successful. But I noticed that the maximum file name length is even shorter than 78 here - maybe its now 78 - length("MAP LOAD FILE"), I didn't investigate that further.

All in all it would had been an nice feature to edit a map by Windows' context menu, but it seems I have to stay at (SHIFT+secondary mouse button/Copy Path/Start UnrealEd.exe/Menu File>Open/Paste).
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Wormbo
Adept
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm
Contact:

Re: Does UnrealEd.exe accept command line parameters?

Post by Wormbo »

You're supposed to create a file containing "MAP LOAD FILE=..." and then pass that file to the -exec=... parameter. The batch file combines those two steps for you.
If you do it correctly, your editor log file will say something like "Init: Command line: -exec=Drive:\Path\To\My\TmpDir\LoadMap.txt"
User avatar
Barbie
Godlike
Posts: 2807
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Does UnrealEd.exe accept command line parameters?

Post by Barbie »

Ups, sorry, copy & paste error. The second quote should be
Editor.log wrote:Init: Command line: -exec Drive:\Path\To\My\TmpDir\LoadMap.txt
<EDIT>
But there is no need to follow up on this for me: I've decided NOT to use opening Editor with instruction to load map, because of that even more limited path name length.
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply