Start editor in specific map through command line argument in VS?

I want to launch the editor with a specific map using command line arguments in VS, because

  1. I don’t want to override the project’s startup map for every user on my project
  2. I want to be able to select different maps from VS everytime I launch the editor, instead of having to load the startup map first, and then manually loading my map everytime.

Is there a way to do this ?

I tried using the URL parameter as explained here, but I’m not sure where the relative path should start, and no matter which path I put, even an absolute one, the editor always loads the startup map instead of the map I want.

Just send it as second parameter. UE4 Documentation

Template:
%UE4ExeEditorPath% %UProjectFilePath% %MapPath%

Example:
“C:/Program Files/Epic Games/UE_4.27/Engine/Binaries/Win64/UE4Editor.exe” “C:/MyProjects/MyAwesomeProject.uproject”
/Game/Maps/MyAwesomeLevel

3 Likes

I had missed this important detail :

Passing a URL is optional, but must immediately follow the executable name or any mode switch if one is present

I had another parameter placed in between the two.

Also, the relative path only works if I use backslashes (\). Slashes (/), as in the doc, don’t work strangely.

This works : \Content_GameData\GYMS\LVL_GYM_Pickups
But this doesn’t : /Content/_GameData/GYMS/LVL_GYM_Pickups

Thanks for the quick reply :slight_smile:

3 Likes