Campaign Description.ext: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (pasted Description.ext weaponPool version)
m (update weaponPool parameter description because of campaign.weaponPool mistake)
Line 46: Line 46:
  class Campaign {{codecomment|// this is a reference class and the name '''cannot''' be customised}}
  class Campaign {{codecomment|// this is a reference class and the name '''cannot''' be customised}}
  {
  {
  '''firstBattle = Chapter1;''' {{codecomment|// which chapter should be loaded first. '''MUST''' be declared!}}
  '''firstBattle = Chapter1;''' {{codecomment|// which chapter should be loaded first. '''MUST''' be declared!}}
   
   
  name = "my great campaign"; {{codecomment|// before Arma 3}}
  name = "my great campaign"; {{codecomment|// before Arma 3}}
  briefingName = "my Arma 3 campaign"; {{codecomment|// Arma 3 - if undefined, an error popup will appear}}
  briefingName = "my Arma 3 campaign"; {{codecomment|// since Arma 3 - if undefined, an error popup will appear}}
  author = "Username"; {{codecomment|// Arma 3 - if undefined, "by unknown community author" will replace author's name}}
  author = "Username"; {{codecomment|// since Arma 3 - if undefined, "by unknown community author" will replace author's name}}
  overviewPicture = "overview.paa";
  overviewPicture = "overview.paa";
  overviewText = $STR_A3_StageAOverview;
  overviewText = $STR_A3_StageAOverview;
  disableMP = 1; {{codecomment|// Arma 2 - if set to 1, forces the campaign as SinglePlayer}}
  disableMP = 1; {{codecomment|// since Arma 2 - if set to 1, forces the campaign as SinglePlayer}}
  enableHub = 1; {{codecomment|// TBD - has to do with coming back to a "base"}}
  enableHub = 1; {{codecomment|// TBD - has to do with coming back to a "base"}}
  (…)
  (…)
Line 94: Line 94:




== Additional settings ==
== Additional parameters ==
{{Important|
Additional parameters '''MUST''' be placed '''OUTSIDE''' the Campaign class to be effective!}}


<div><div style="float: left; margin-right: 0.5em;">{{GVI|ofpr|1.75}}</div>
=== weaponPool ===
=== weaponPool ===
Allows equipment transferred from one campaign mission to the next to be available during the briefing in the gear menu.
</div>
A campaign automatically enables [[:Category:Command Group: Weapon Pool|weapon pool]].
This parameter allows equipment transferred from one campaign mission to the next to be available during the briefing in the gear menu.
  weaponPool = 1; {{codecomment|// 0: disabled - 1: enabled. Default: 0}}
  weaponPool = 1; {{codecomment|// 0: disabled - 1: enabled. Default: 0}}


Line 103: Line 108:
== Full example ==
== Full example ==
  {{codecomment|/*
  {{codecomment|/*
  '''MissionDefault''', '''NoEndings''' etc. are arbitrary. '''MissionDefault''' is an accepted de-facto standard name for missions to inherit.
  '''MissionDefault''', '''NoEndings''' etc. are arbitrary class names. '''MissionDefault''' is Bohemia standard name for missions parent class.
  Left to itself, simply inheriting the mission default means you will exit the game at the end of mission/chapter.
  Left to itself, simply inheriting the mission default means you will exit the game at the end of mission/chapter (and will be done on last(s) mission(s).
Indeed the last chapter (if any) last mission does exactly this.
  '''An end that is used but not defined (e.g "end6") will crash the game.'''
  But, almost all classes that inherit '''MissionDefault''' will modify some or most of those mission defaults.
  */}}
The intent is to stop tedious typing for every mission. '''An end that is used but not defined (e.g "end6") will crash the game.'''}}
  */
  class NoEndings
  class NoEndings
  {
  {
Line 124: Line 127:
  lives = -1; {{codecomment|// this sets your "lives" to none - old OFP setting where you would lose a "life" every time you retried the mission, never used}}
  lives = -1; {{codecomment|// this sets your "lives" to none - old OFP setting where you would lose a "life" every time you retried the mission, never used}}
  noAward =  1; {{codecomment|// TBD}}
  noAward =  1; {{codecomment|// TBD}}
  cutscene = ; {{codecomment|// mandatory definition}}
  cutscene = ;   {{codecomment|// mandatory definition}}
  };
  };
   
   
''weaponPool = 1;'' {{codecomment|// since OFP:R v1.75: allows weapon pool to be used in mission briefing}}
weaponPool = 1;
   
   
  class Campaign
  class Campaign
  {
  {
   name = "My Great Campaign"; {{codecomment|// < Arma 3}}
   name = "My Great Campaign"; {{codecomment|// before Arma 3}}
   briefingName = "My Great Campaign"; {{codecomment|// Arma 3}}
   briefingName = "My Great Campaign"; {{codecomment|// since Arma 3}}
  firstBattle = Chapter1;
  firstBattle = Chapter1;
   
   

Revision as of 15:39, 8 March 2018

Template:note

Description

A campaign description.ext is the entry point to load campaign informations. It must not be confused with mission Description.ext. The campaign title, author and overview picture, the missions tree, everything displayed from the Campaigns screen will be loaded from it.

It is important to be well written to ensure a good campaign experience. The flow of missions is defined in this file (aka which mission should be played on which ending).

A campaign file (myCampaign.pbo) should need no other file to work (beside base game files and required mods)!

A wrongly formatted Campaign Description.ext can crash your game!


Directory structure

A campaign structure is the following:

myCampaignMainDirectory
myCampaignMainDirectory\description.ext
myCampaignMainDirectory\missions
myCampaignMainDirectory\missions\mission01.VR
myCampaignMainDirectory\missions\mission02.VR
(…)

Other files may appear at the root of myCampaignMainDirectory for sharing resources between missions, or storing the campaign overview image for example. No files should appear in myCampaignMainDirectory\missions , only mission directories Missions name doesn't matter nor impact the missions flow. Zmission.VR will not load after Amission.VR – the order is, again, defined in description.ext.

Template:note

Missions flow

Missions flow structure is defined as follows:

  1. The parent class is Campaign, nothing else.
  2. Campaign is filled with chapters
  3. Chapters are filled with missions and defined endings
  4. Missions are filled with endings.
Campaign cannot contain missions directly!

A campaign contains one to many chapters, and must define a parameter named firstBattle pointing to its first chapter. A chapter contains one to many missions, and must define a parameter named firstMission pointing to its first mission. A mission must define its endings. A mission with an empty defined ending will follow its chapter ending.


Campaign

This is the main class for missions flow definition. It is defined as follows:

class Campaign // this is a reference class and the name cannot be customised
{
	firstBattle	= Chapter1;			// which chapter should be loaded first. MUST be declared!

	name		= "my great campaign";		// before Arma 3
	briefingName	= "my Arma 3 campaign";		// since Arma 3 - if undefined, an error popup will appear
	author		= "Username";			// since Arma 3 - if undefined, "by unknown community author" will replace author's name
	overviewPicture	= "overview.paa";
	overviewText	= $STR_A3_StageAOverview;
	disableMP	= 1;				// since Arma 2 - if set to 1, forces the campaign as SinglePlayer
	enableHub	= 1;				// TBD - has to do with coming back to a "base"
	(…)
};


Chapters

A chapter is defined inside Campaign block. Multiple chapters can exist inside Campaign block. A chapter is defined as follows:

class Chapter1 // name can be customised here - it will be used as reference, in firstBattle for example
{
	firstMission	= Mission1;		// which mission should be loaded first. MUST be declared!
	name		= "My first chapter";	// chapter name. Has no in-game impact
	cutscene	= Chapter1Cutscene.VR;	// missions sub-directory. A cutscene is of course optional but the parameter MUST be declared (cutscene = ;)
	end1		= ;
	(…)
};

There can be multiple chapters in a campaign, but this is optional. Campaign missions can very well be contained within a single chapter. Chapters are used for campaign organisation as well as adding some transition cutscenes.


Missions

A mission is defined inside a chapter and must target one of the missions sub-directories. Multiple missions can be inside a chapter. A Chapter is defined as follows:

class myMission1 // name, such as chapter one, can be customised
{
	end1 = myMission2;
	end2 = myMission3a;
	end3 = myMission3b;
	end4 = myMission2;
	end5 = ;
	end6 = ;
	lost = myMission1;

	template = myMissionDirectory.VR; // missions sub-directory
};

Template:note


Additional parameters

Additional parameters MUST be placed OUTSIDE the Campaign class to be effective!

weaponPool

A campaign automatically enables weapon pool. This parameter allows equipment transferred from one campaign mission to the next to be available during the briefing in the gear menu.

weaponPool = 1; // 0: disabled - 1: enabled. Default: 0


Full example

/*
	MissionDefault, NoEndings etc. are arbitrary class names. MissionDefault is Bohemia standard name for missions parent class.
	Left to itself, simply inheriting the mission default means you will exit the game at the end of mission/chapter (and will be done on last(s) mission(s).
	An end that is used but not defined (e.g "end6") will crash the game.
*/
class NoEndings
{
	end1 = ;
	end2 = ;
	end3 = ;
	end4 = ;
	end5 = ;
	end6 = ;
	lost = ;
};

class MissionDefault : NoEndings
{ 
	lives		= -1; // this sets your "lives" to none - old OFP setting where you would lose a "life" every time you retried the mission, never used
	noAward		=  1; // TBD
	cutscene	= ;   // mandatory definition
};

weaponPool = 1;

class Campaign
{
 	name		= "My Great Campaign"; // before Arma 3
 	briefingName	= "My Great Campaign"; // since Arma 3
	firstBattle	= Chapter1;

	class Chapter1 : NoEndings
	{
		firstMission = Chapter1_Mission1;
		end1 = Chapter2; // other endings are defined by inheritance from NoEndings

		class Chapter1_Mission1 : MissionDefault
		{
			end1 = Chapter1_Mission2; // other endings are defined by inheritance from MissionDefault, inheriting from NoEndings
			end2 = ; // end2 will end Chapter 1, therefore going to Chapter 2
			template = C1M1.VR;
		};
		class Chapter1_Mission2 : MissionDefault
		{
			end1 = ; // not defining the ending will use the Chapter ending corresponding to end1: Chapter2 here

			template = C1M2.VR;
		};
	};

	class Chapter2 : NoEndings
	{
		firstMission = Chapter2_Mission1;
		end1 = LastChapter;

		// this mission is named Chapter2_Mission1 for clarity purpose,
		// but both Chapter1_Mission1 and Chapter2_Mission1 could have been named Mission1 as game engine respects Chapter hierarchy.
		// do not, however, name two missions the same in the same chapter
		class Chapter2_Mission1 : MissionDefault
		{
			end1 = ; // not defining the ending will use the Chapter ending corresponding to end1: LastChapter here

			template = C2M1.VR;
		};
	};

	class LastChapter : NoEndings
	{
		firstMission = Chapter3_Mission1;
		// no endings provided: because of NoEndings inheritence this is the same as writing
		// end1 = ;
		// end2 = ;
		// end3 = ;
		// end4 = ;
		// end5 = ;
		// end6 = ;
		// lost = ;
		class Chapter3_Mission1
		{
			// not defining the ending will use the Chapter ending corresponding to end1: NOTHING here, closing the campaign
			template = C3M1.VR;
		};
	};
};


Recommendations

If you don't know for sure what you are doing, follow these advices:

  • try and make all the missions work stand-alone, then place them all in the Missions directory
  • don't force yourself to use many chapters. They are useful to organise properly a lot of missions, but if your campaign doesn't have many, don't oversplit it.
  • you can test your campaign structure by allowing file patching (in Arma 3 launcher, or arma3.exe -filePatching) and placing your campaign in the campaigns directory