Intro[edit | edit source]

This tutorial will teach you how to load alternate files, with different settings for different gameplay layers without needing to clone the map. The main uses include loading different teams, different statics and different sky settings.

It works by making the gameplay layer in question load an init.con file, which tells the PR to then load other files including your changes.

If you have trouble understanding how to set out or format the files try checking out how they are done in existing PR maps, eg Operation Marlin, Kokan, Ramiel and Al Basrah.

Using alternate teams[edit | edit source]

Inside your map folder, create a new text document using notepad and insert the following lines of codes.

Code:

run ../../Factions/faction_init.con 1 "opfor"

run ../../Factions/faction_init.con 2 "blufor"

Change the team names to the teams that you actually want to be featured. Even if you want to modify only one faction, make sure you add both teams in the init. A full list of team names and some more info on init setting can be found in this thread: [0957] Init System.

Once that is done save it as Init_X.con. Replace the X with either the name of the faction being changed, the name of the layer or gamemode that it effected by the change. Eg. Init_canada.con, Init_32.con, Init_skirmish.con. Note you can also use this init to load other alternate files, see step 2.

NOTE: If you use alternate teams, they will use the same voices as the normal teams. So if team 2 is USA normally all team 2 teams for that map will have USA voices and you would be restricted to only using alternate teams that use that voice, eg USMC and Canada.

Altering other files[edit | edit source]

This method can also be used for making alternate Sounds settings, alternate AmbientObjects, alternate Triggerables and alternate SoundDistances.

First of all, create a backup copy of your existing sky.con and water.con, then go into the editor and tweak the lighting and water settings that you would like for your alternate sky.con and save.

Now rename your new sky.con to sky_X.con. Replace the X with either the name of sky setting, the name of the layer or gamemode that it effected by the change. Eg. sky_night.con, sky_cloudy.con, sky_32.con, sky_skirmish.con. Do the same for the water.con file and rename your backups of these files we created earlier to their original names.

NOTE: You can only have one set of lightmaps so sun/moon positions should not differ to much between the different sky settings. Sometimes (not always) it's also necessary to change the water settings to match the different lighting conditions.

Using additional Static Objects[edit | edit source]

NOTE: You cannot use an alternate staticobjects.con file to remove objects that are in the normal staticobjects.con, you can only use this to ADD objects.

Make a backup copy of your normal staticobjects.con file. Now go into the editor, make your edits and save. You can also lightmap these additional objects.

Now go into your new staticobjects.con file and remove everything expect for the objects that you just added. The newly added objects should be at the bottom of the document. A good example of this is in the insurgency.con in Operation Marlin's server.zip.

At the top of the document you will see a series of lines showing the directory of the .con files for the static objects being loaded. It will look something like this:

Code:

if v_arg1 == BF2Editor

console.allowMultipleFileLoad 0

run /objects/staticobjects/common/object.con

console.allowMultipleFileLoad 1

endIf

Only alternate objects that have not been loaded into the normal staticobjects.con need to be in this set of lines.

Save and rename the file to staticobjects_X.con. Replace the X with either the name of the layer or gamemode that it effected by the change. Eg. staticobjects_32.con, staticobjects_skirmish.con, staticobjects_insurgency.con. Rename the backup of the original staticobjects.con to its normal name.

Making an alternate Init.con[edit | edit source]

The alternate init file is used to load all the alternate files. Some edits may only require an alternate init file with only a few lines of code, eg alternate teams, different texture suffixes and different before spawn camera positions. You only have to include the lines of code that you have changed.


Create a new text document and include the following lines:

Code:

if v_arg1 == BF2Editor

run StaticObjects_X.con BF2Editor

run Sounds_X.con

run Sky_X.con BF2Editor

run AmbientObjects_X.con BF2Editor

run Water_X.con

run TriggerableTemplates_X.con BF2Editor

else

run Sky_X.con v_arg2

run Sounds_X.con

run SoundDistances_X.con

run AmbientObjects_X.con

run Water_X.con

run TriggerableTemplates_X.con

endIf

rem ------------------------------- LevelSettings -------------------------------

rem -----------------------------------------------------------------------------

run ../../Factions/faction_init.con 1 "opfor"

run ../../Factions/faction_init.con 2 "blufor"

rem -----------------------------------------------------------------------------

gameLogic.setBeforeSpawnCamera -300/33/139 86/-1/0

if v_arg1 == BF2Editor

LevelSettings.CustomTextureSuffix "marlin"

else

texturemanager.customTextureSuffix "marlin"

endIf

rem -----------------------------------------------------------------------------

GameLogic.MaximumLevelViewDistance 600

rem -----------------------------------------------------------------------------

Remove the lines in GREEN that do not apply to your edits (eg if you only made an alternate Static Objects file then remove everything but the lines for the staticobjects_X.con). If you want you can also remove the lines that start with "rem" as they're not needed. Replace the 'X's with the same names you gave to the other files. Save it as init_X.con. Replace the X with the same name you used for the files it contains.

Loading alternate Init.con with a gameplayobjects.con[edit | edit source]

Now that the alternate init is done and saved, go into the gameplayobjects.con of the gameplay layer that you want to be affected by this change. In the gameplayobjects.con go into the first line, press enter a couple times to create two blanks lines and insert the following code into the first line:

Code:

run ../../../Init_X.con

Replace the X with what you named the init file earlier and save.


Now the first 3 lines should look something like this:

Code:

run ../../../Init_X.con

rem ********** Object Spawner **********

You can have several different alternate files and inits being loaded on different gameplay layers, just rename the files and lines of code accordingly.

Community content is available under CC-BY-SA unless otherwise noted.