Skip to content
Rey edited this page Feb 9, 2022 · 7 revisions

How to create a campaign that appears in the campaigns list

Basic steps

  • Browse to the folder Campaigns under your KaM Remake folder
  • Create a new folder with the name of your campaign, for example KaM Remake\Campaigns\My Campaign
  • Run CampaignBuilder.exe from the main KaM Remake folder
  • Enter a 3 letter short name for your campaign
  • Click Load Picture and select an image for the map background on the briefing screen
  • Set the map count
  • Select each mission and drag the flag to the correct location on the map. You can also add nodes which are shown as dots on the map, choose briefing text position.
  • Click Save and save it as info.cmp under your campaign folder, for example Campaigns\My Campaign\info.cmp. This will also save images.rxx which contains the map background image.
  • Create a file text.eng.libx under your campaign folder, for example Campaigns\My Campaign\text.eng.libx. Open it in a text editor and enter the required text (look at the original campaigns for the file format, 0 is the title, 1 is the mission shortcode, 10 and onwards is mission briefings)
  • For each mission of your campaign, create a folder under your campaign folder using your 3 letter short code and 2 digit mission number, for example Campaigns\My Campaign\MYC01.
  • In each mission folder put the .map and .dat files for your mission, for example Campaigns\My Campaign\MYC01\MYC01.map

If you are unsure look at the original campaigns and make sure you have the same folder structure.

Optional steps

Translations

Run TranslationManager.exe from the main KaM Remake folder and select your campaign text file, for example Campaigns\My Campaign\text.eng.libx. Enter translations for your campaign in the appropriate boxes and click save. Languages which do not have a translation will use English instead.

Audio

Place the mission briefing audio as MP3 files in each mission folder, for example Campaigns\My Campaign\MYC01\MYC01.eng.mp3. You can provide the audio in any language by using the appropriate language code instead of eng.

Shared audio files

In campaign mission you can play sounds via dynamic scripts. Campaigns allow you to use shared audio files. It will reduce overall campaign size if you use same sounds in the different campaign missions.

Shared sound files should be placed in the 'Sounds' subfolder of the main campaign folder, with XYZ campaign prefix in the file name (f.e. Campaigns\The Shattered Kingdom\Sounds\TSK.waterfall.ogg).

F.e. if you want to play sound via script command Actions.PlayOgg(0, 'waterfall', 1) called in the TSK01.script of the TSK01 mission, then script engine will try to play Campaigns\The Shattered Kingdom\TSK01\TSK01.waterfall.ogg audio file, and if it does not exist then it will try to play Campaigns\The Shattered Kingdom\Sounds\TSK.waterfall.ogg

Campaign texts

Campaign texts could be set in text.eng.libx, as said above. List of special IDs:

  • 0 - Campaign title
  • 1 - Mission short code
  • 2 - Campaign description
  • 3 - Campaign mission title template. Default template is Mission %d where instead of %d there will be mission number. You can customize this template on your own, f.e. Chapter %d Also you can make custom mission name, in the mission text file, f.e. TSK01.eng.libx with ID 200: If you set there f.e. Castle attack, then mission name will be Castle attack. Also if you have, f.e. in text.eng.libx: 3: Chapter %d %s and in TSK01.eng.libx: 200:- Castle attack then mission name will be Chapter 1 - Castle attack

Also its possible to customise players names. It could be done in mission text file, f.e. TSK01.eng.libx, with IDs 100,101,102...etc, where hand N name will be taken from (100 + N)'th text ID, where N starts from 0. For SP game human players name will be You (custom name)

F.e. if you set it like that:

100:Hero
101:Kind prince
102:Greedy King

when 1st hand is human player, and 2 others are AI's then in the game they will get names as

hand 1: You (Hero)
hand 2: Kind prince
hand 3: Greedy King

Campaign global script data

Campaign missions could use dynamic scripts, as an every other mission. But you can save some data, f.e. related to campaign progress, which will be accesible in the script of every mission.

More info read here: Global campaign data

Campaign shared scripts

Other usefull scripting feature is ability to use shared scripts, which is similar to shared sounds feature.

Mission script can include other scripts with {$INCLUDE other.script} directive (more info here: Advanced mission scripts features

You can place some utility or other often used script in the Campaigns\My Campaign name\Scripts\utils.script. Then you can include it in every campaign mission via {$INCLUDE utils.script} directive.

Scripts inside campaign mission folder override shared scripts with the same name in the Campaigns\My Campaign name\Scripts folder, so f.e. if you have Campaigns\My Campaign name\Scripts\utils.script and also Campaigns\My Campaign name\MCN01\utils.script then the latter will be included, if you add {$INCLUDE utils.script} line into the Campaigns\My Campaign name\MCN01\MCN01.script