Installing custom maps

Discussion in 'Custom Maps' started by aus.hsp, Feb 17, 2012.

  1. aus.hsp

    aus.hsp Private Tester

    2016 Update:

    If you have downloaded a custom map, simply place the contents in your missions folder (game/legions/data/missions) and select it from the Create Game menu. If you are a server owner:


    In the config.cs file (or live1 live2 etc.. on dedicated with more than one)

    addMapToRotation(missionname.mis,gamemode,minplayers,maxplayers);

    You will find the lines above. The order of these is the rotation of maps/modes on the server. Dropping maps in and loading them from the main screen or admin pannel should work without any additional file editing now. Mappers and Devs still have to be careful to only put the correct modes in their .mis file.


    The below information is old and outdated! See above for latest instructions.

    _______________________________________________________________________________________


    So quite a large number of people have been wondering how to do this and few posts have vaguely described the process.
    The following will show you how to be able to select your custom map from the 'Create a Server' menu in Public Test, after you have copied the three necessary map files into 'public-test/legions/data/missions'. Be sure to read the tutorial carefully to avoid careless errors.

    I will mention this again down below, as this is an important part of the process.
    Make a backup of the file you are going to edit, before you edit it and make a backup of the file after you have edited it!!!! We will be working with two files - config.cs and gameMenu.cs


    ------------------------------------------------------------------------------------------------------------------------------

    Step 1: Locate 'public-test/server/preferences/config.cs' and right-click the file and click properties and ensure the file is not 'read-only'.

    Step 2: Open config.cs - it should look like this:

    Code:
    $Host::Admins::Name[0] = "Owner";
    $Host::Admins::Level[0] = 5;
    $Host::Admins::Password[0] = "unlocked";
    
    $Host::Admins::Name[1] = "Admin";
    $Host::Admins::Level[1] = 1;
    $Host::Admins::Password[1] = "imspecial";
    
    $Host::Mission["BladeRun"] = 0;
    $Host::Mission["DesertMap01"] = 1;
    $Host::Mission["Elegiac"] = 2;
    $Host::Mission["Fallout"] = 3;
    $Host::Mission["Forgotten"] = 4;
    $Host::Mission["Gorge"] = 5;
    $Host::Mission["GrassMap01"] = 6;
    $Host::Mission["Mirage"] = 7;
    $Host::Mission["Sleepwalker"] = 8;
    $Host::Mission["SnowMap01"] = 9;
    $Host::Mission["SnowMap02"] = 10;
    $Host::Mission["Stygian"] = 11;
    $Host::Mission["TheCore"] = 12;
    
    
    %MissionPath = "legions/data/missions/";
    
    // A lot of these will be overrided by Server::create() in server.cs
    // if the options are selected using the GUI page gameMenu.cs
    $Host::Name = "A Dedicated Server";
    $Host::GameType = "CTF";
    $Host::MaxPlayers = 32;
    $Host::MaxObservers = 10;
    $Host::Type = "Multiplayer Web";
    $Host::MinimumStartPlayers = 1;
    $Host::BroadcastMaster = false;
    
    $Host::Maps::MissionFile[0] = %MissionPath @ "BladeRun.mis";
    $Host::Maps::Weight[0] = 1.0;
    $Host::Maps::MinPlayers[0] = 0;
    $Host::Maps::MaxPlayers[0] = 12;
    
    $Host::Maps::MissionFile[1] = %MissionPath @ "DesertMap01.mis";
    $Host::Maps::Weight[1] = 1.0;
    $Host::Maps::MinPlayers[1] = 0;
    $Host::Maps::MaxPlayers[1] = 12;
    
    $Host::Maps::MissionFile[2] = %MissionPath @ "Elegiac.mis";
    $Host::Maps::Weight[2] = 1.0;
    $Host::Maps::MinPlayers[2] = 0;
    $Host::Maps::MaxPlayers[2] = 12;
    
    $Host::Maps::MissionFile[3] = %MissionPath @ "Fallout.mis";
    $Host::Maps::Weight[3] = 1.0;
    $Host::Maps::MinPlayers[3] = 0;
    $Host::Maps::MaxPlayers[3] = 12;
    
    $Host::Maps::MissionFile[4] = %MissionPath @ "Forgotten.mis";
    $Host::Maps::Weight[4] = 1.0;
    $Host::Maps::MinPlayers[4] = 0;
    $Host::Maps::MaxPlayers[4] = 12;
    
    $Host::Maps::MissionFile[5] = %MissionPath @ "Gorge.mis";
    $Host::Maps::Weight[5] = 1.0;
    $Host::Maps::MinPlayers[5] = 0;
    $Host::Maps::MaxPlayers[5] = 12;
    
    $Host::Maps::MissionFile[6] = %MissionPath @ "GrassMap01.mis";
    $Host::Maps::Weight[6] = 1.0;
    $Host::Maps::MinPlayers[6] = 0;
    $Host::Maps::MaxPlayers[6] = 12;
    
    $Host::Maps::MissionFile[7] = %MissionPath @ "Mirage.mis";
    $Host::Maps::Weight[7] = 1.0;
    $Host::Maps::MinPlayers[7] = 0;
    $Host::Maps::MaxPlayers[7] = 12;
    
    $Host::Maps::MissionFile[8] = %MissionPath @ "Sleepwalker.mis";
    $Host::Maps::Weight[8] = 1.0;
    $Host::Maps::MinPlayers[8] = 0;
    $Host::Maps::MaxPlayers[8] = 12;
    
    $Host::Maps::MissionFile[9] = %MissionPath @ "SnowMap01.mis";
    $Host::Maps::Weight[9] = 1.0;
    $Host::Maps::MinPlayers[9] = 0;
    $Host::Maps::MaxPlayers[9] = 12;
    
    $Host::Maps::MissionFile[10] = %MissionPath @ "SnowMap02.mis";
    $Host::Maps::Weight[10] = 1.0;
    $Host::Maps::MinPlayers[10] = 0;
    $Host::Maps::MaxPlayers[10] = 12;
    
    $Host::Maps::MissionFile[11] = %MissionPath @ "Stygian.mis";
    $Host::Maps::Weight[11] = 1.0;
    $Host::Maps::MinPlayers[11] = 0;
    $Host::Maps::MaxPlayers[11] = 12;
    
    $Host::Maps::MissionFile[12] = %MissionPath @ "TheCore.mis";
    $Host::Maps::Weight[12] = 1.0;
    $Host::Maps::MinPlayers[12] = 0;
    $Host::Maps::MaxPlayers[12] = 12;
    Step 3: What you want to do now is add a few lines of code, like so [in italics are notes not to be typed as code in the file]:

    Code:
    $Host::Admins::Name[0] = "Owner";
    $Host::Admins::Level[0] = 5;
    $Host::Admins::Password[0] = "unlocked";
    
    $Host::Admins::Name[1] = "Admin";
    $Host::Admins::Level[1] = 1;
    $Host::Admins::Password[1] = "imspecial";
    
    $Host::Mission["BladeRun"] = 0;
    $Host::Mission["DesertMap01"] = 1;
    $Host::Mission["Elegiac"] = 2;
    $Host::Mission["Fallout"] = 3;
    $Host::Mission["Forgotten"] = 4;
    $Host::Mission["Gorge"] = 5;
    $Host::Mission["GrassMap01"] = 6;
    $Host::Mission["Mirage"] = 7;
    $Host::Mission["Sleepwalker"] = 8;
    $Host::Mission["SnowMap01"] = 9;
    $Host::Mission["SnowMap02"] = 10;
    $Host::Mission["Stygian"] = 11;
    $Host::Mission["TheCore"] = 12;
    $Host::Mission["<INSERT CUSTOM MAP NAME HERE>"] = 13;
    
    %MissionPath = "legions/data/missions/";
    
    // A lot of these will be overrided by Server::create() in server.cs
    // if the options are selected using the GUI page gameMenu.cs
    $Host::Name = "A Dedicated Server";
    $Host::GameType = "CTF";
    $Host::MaxPlayers = 32;
    $Host::MaxObservers = 10;
    $Host::Type = "Multiplayer Web";
    $Host::MinimumStartPlayers = 1;
    $Host::BroadcastMaster = false;
    
    $Host::Maps::MissionFile[0] = %MissionPath @ "BladeRun.mis";
    $Host::Maps::Weight[0] = 1.0;
    $Host::Maps::MinPlayers[0] = 0;
    $Host::Maps::MaxPlayers[0] = 12;
    
    $Host::Maps::MissionFile[1] = %MissionPath @ "DesertMap01.mis";
    $Host::Maps::Weight[1] = 1.0;
    $Host::Maps::MinPlayers[1] = 0;
    $Host::Maps::MaxPlayers[1] = 12;
    
    $Host::Maps::MissionFile[2] = %MissionPath @ "Elegiac.mis";
    $Host::Maps::Weight[2] = 1.0;
    $Host::Maps::MinPlayers[2] = 0;
    $Host::Maps::MaxPlayers[2] = 12;
    
    $Host::Maps::MissionFile[3] = %MissionPath @ "Fallout.mis";
    $Host::Maps::Weight[3] = 1.0;
    $Host::Maps::MinPlayers[3] = 0;
    $Host::Maps::MaxPlayers[3] = 12;
    
    $Host::Maps::MissionFile[4] = %MissionPath @ "Forgotten.mis";
    $Host::Maps::Weight[4] = 1.0;
    $Host::Maps::MinPlayers[4] = 0;
    $Host::Maps::MaxPlayers[4] = 12;
    
    $Host::Maps::MissionFile[5] = %MissionPath @ "Gorge.mis";
    $Host::Maps::Weight[5] = 1.0;
    $Host::Maps::MinPlayers[5] = 0;
    $Host::Maps::MaxPlayers[5] = 12;
    
    $Host::Maps::MissionFile[6] = %MissionPath @ "GrassMap01.mis";
    $Host::Maps::Weight[6] = 1.0;
    $Host::Maps::MinPlayers[6] = 0;
    $Host::Maps::MaxPlayers[6] = 12;
    
    $Host::Maps::MissionFile[7] = %MissionPath @ "Mirage.mis";
    $Host::Maps::Weight[7] = 1.0;
    $Host::Maps::MinPlayers[7] = 0;
    $Host::Maps::MaxPlayers[7] = 12;
    
    $Host::Maps::MissionFile[8] = %MissionPath @ "Sleepwalker.mis";
    $Host::Maps::Weight[8] = 1.0;
    $Host::Maps::MinPlayers[8] = 0;
    $Host::Maps::MaxPlayers[8] = 12;
    
    $Host::Maps::MissionFile[9] = %MissionPath @ "SnowMap01.mis";
    $Host::Maps::Weight[9] = 1.0;
    $Host::Maps::MinPlayers[9] = 0;
    $Host::Maps::MaxPlayers[9] = 12;
    
    $Host::Maps::MissionFile[10] = %MissionPath @ "SnowMap02.mis";
    $Host::Maps::Weight[10] = 1.0;
    $Host::Maps::MinPlayers[10] = 0;
    $Host::Maps::MaxPlayers[10] = 12;
    
    $Host::Maps::MissionFile[11] = %MissionPath @ "Stygian.mis";
    $Host::Maps::Weight[11] = 1.0;
    $Host::Maps::MinPlayers[11] = 0;
    $Host::Maps::MaxPlayers[11] = 12;
    
    $Host::Maps::MissionFile[12] = %MissionPath @ "TheCore.mis";
    $Host::Maps::Weight[12] = 1.0;
    $Host::Maps::MinPlayers[12] = 0;
    $Host::Maps::MaxPlayers[12] = 12;
    
    $Host::Maps::MissionFile = %MissionPath @ "<INSERT CUSTOM MAP NAME>.mis";
    $Host::Maps::Weight[13] = 1.0;
    $Host::Maps::MinPlayers[13] = 0;
    $Host::Maps::MaxPlayers[13] = 12;
    Note: If you add more custom maps then number consecutively following the last number, e.g. there are 12 normal maps therefore, use [13], then [14], etc.

    Important: Also, the <INSERT CUSTOM MAP NAME> occurs twice - you must type the exact file name of the .mis file of your custom map, or the code will not create a link to the map.

    Step 4: Save your file, right click it, select properties and set it to 'read-only'!!! If you don't do this, the next time you launch legions.exe, it will update the file and any changes you have made will be be reverted back to the original.

    Note: Make another backup of your updated file, so that if the files ARE updated in future updates you can make it not 'read-only', then simply, paste the code you wrote from your backup into the new file. Creating backups also apply to the file in the next step.
     
    Last edited by a moderator: Feb 19, 2016
    57thEnryu likes this.
  2. aus.hsp

    aus.hsp Private Tester

    Step 5: Locate 'public-test/client/gui/scripts/gameMenu.cs and again ensure that 'read-only' is unchecked as your changes will not be saved if it IS 'read-only'.


    Step 6: Locate these lines of code:


    Code:
    %mapList = "BladeRun" TAB "DesertMap01" TAB "Elegiac" TAB "Fallout" TAB "Forgotten" TAB "Gorge" TAB "GrassMap01" TAB "Mirage" TAB "Sleepwalker" TAB "SnowMap01" TAB "SnowMap02" TAB "Stygian" TAB "TheCore" TAB "Aftermath" TAB "Odysseus" TAB "Badlands";
     
      %this.addRow("Maps", %mapList, true, "", 0, 0, true);

    Step 7: Make it look like this!


    Code:
    %mapList = "BladeRun" TAB "DesertMap01" TAB "Elegiac" TAB "Fallout" TAB "Forgotten" TAB "Gorge" TAB "GrassMap01" TAB "Mirage" TAB "Sleepwalker" TAB "SnowMap01" TAB "SnowMap02" TAB "Stygian" TAB "TheCore" TAB "<INSERT CUSTOM MAP NAME>";
     
      %this.addRow("Maps", %mapList, true, "", 0, 0, true);

    Step 8: Save the changes you have made and check 'read-only'.

    Step 9: Open your Public Test, allow to update and voila! You now have your custom map in your map rotation!

    -----------------------------------------------------------------------------------------------------------

    If anyone is confused or needs assistance please feel free to post on this thread or PM me.

    Hope this helps!
    Your Australian Faithful,
    Pete.