Alternate Gameplay Setup

## Intro

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

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

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

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

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

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.