Take On Helicopters CfgBase: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (R3vo moved page CfgBase to Take On Helicopters CfgBase: added TAG)
m (Text replacement - "pedia\.org\/([^w])" to "pedia.org/wiki/$1")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Take On Helicopters: Editing]]
{{TOC|side}}
 
== World ==
Every world is allowed to have one heliport. All settings are placed in CfgBase under classname matching those of CfgWorlds class (and returned value [[worldName]]).
Every world is allowed to have one heliport. All settings are placed in CfgBase under classname matching those of CfgWorlds class (and returned value [[worldName]]).


<code>class CfgBase
<syntaxhighlight lang="cpp">
class CfgBase
{
{
{{codecomment|//--- World name (matches CfgWorlds class)}}
//--- World name (matches CfgWorlds class)
class United_States_H
class United_States_H
{
{
{{codecomment|//--- Heliport name (visible in menus)}}
//--- Heliport name (visible in menus)
displayName = $STR_HSIM_CfgBase_United_States_H;
displayName = "$STR_HSIM_CfgBase_United_States_H";
{{codecomment|//--- Script executed every time heliport is loaded}}
//--- Script executed every time heliport is loaded
init = "\hsim\Modules_H\base\United_States_H\init.sqf";
init = "\hsim\Modules_H\base\United_States_H\init.sqf";
{{codecomment|//--- Starting date of heliport. Every completed mission adds one day}}
//--- Starting date of heliport. Every completed mission adds one day
initDate[] = {2013,8,5,10,0};
initDate[] = { 2013, 8, 5, 10, 0 };
{{codecomment|//--- Starting money}}
//--- Starting money
initMoney = 1985;
initMoney = 1985;
<br />
 
{{codecomment|//--- Subclasses (see below)}}
//--- Subclasses (see below)
class Mission
class Mission
{
{
{{codecomment|...}}
// ...
};
};
class Helicopters
class Helicopters
{
{
{{codecomment|...}}
// ...
};
};
{{codecomment|...etc...}}
 
// etc
};
};
};</code>
};
</syntaxhighlight>


Following params are shared for Missions, Helicopters (including components), Staff and Upgrades.
Following params are shared for Missions, Helicopters (including components), Staff and Upgrades.
{{Columns|3|
* scope
* scope
* show
* show
Line 41: Line 43:
* price
* price
* forced
* forced
}}


=== Mission ===


=== Mission ===
Includes mission.sqm of heliport mission. Used mainly dor debugging object positions in case the mission was not loaded previously.
Includes mission.sqm of heliport mission. Used mainly dor debugging object positions in case the mission wasn't loaded previously.
<syntaxhighlight lang="cpp">
class Mission
class Mission
{
{
#include "\hsim\Missions_H\campaign\missions\United_States_H.United_States_H\mission.sqm"
#include "\hsim\Missions_H\campaign\missions\United_States_H.United_States_H\mission.sqm"
};
};
</syntaxhighlight>


=== Missions ===
=== Missions ===
Procedural missions (Contracts).
Procedural missions (Contracts).


<code>class Missions
<syntaxhighlight lang="cpp">
class Missions
{
{
class Visit
class Visit
{
{
{{codecomment|//--- Name visible in mission list on heliport}}
//--- Name visible in mission list on heliport
displayName = $STR_HSIM_CfgBase_United_States_H_Missions_Visit;
displayName = "$STR_HSIM_CfgBase_United_States_H_Missions_Visit";
{{codecomment|//--- List of helicopter classes used as default. One of them is selected randomly.}}
//--- List of helicopter classes used as default. One of them is selected randomly.
helicoptersDefault[] = {MISSION_HELICOPTERS_LM};
helicoptersDefault[] = {MISSION_HELICOPTERS_LM};
{{codecomment|//--- When 1, replaying the mission will still earn player money}}
//--- When 1, replaying the mission will still earn player money
repeat = 1;
repeat = 1;
{{codecomment|//--- [[#Factions|faction]] ID}}
//--- Faction ID
faction = 2;
faction = 2;
{{codecomment|//--- Mission reward}}
//--- Mission reward
price = 15000;
price = 15000;
{{codecomment|//--- Classes of missions required before mission is displayed in menu}}
//--- Classes of missions required before mission is displayed in menu
requiredMissions[] = {
requiredMissions[] = {
US_C_01
"US_C_01"
};
};
{{codecomment|//--- Helicopter tags required for mission to be enabled in menu}}
//--- Helicopter tags required for mission to be enabled in menu
requiredHelicopters[] = {
requiredHelicopters[] = {
{light,medium}
{ "light", "medium" }
};
};
{{codecomment|//--- Helicopter component required for mission to be enabled in menu}}
//--- Helicopter component required for mission to be enabled in menu
requiredHelicopterUpgrades[] = {
requiredHelicopterUpgrades[] = {
doors
"doors"
};
};
{{codecomment|//--- Company logo displayed in heliport menu}}
//--- Company logo displayed in heliport menu
overviewLogo = "hsim\ui_h\data\logos\logo_larkin_ca.paa";
overviewLogo = "hsim\ui_h\data\logos\logo_larkin_ca.paa";
};
};
};</code>
};
</syntaxhighlight>


=== Helicopters ===
=== Helicopters ===
class HeliLight
 
{
<syntaxhighlight lang="cpp">
{{codecomment|//--- Helicopter vehicle class (from CfgVehicles)}}
class HeliLight
vehicle = "Heli_Light01_H";
{
{{codecomment|//--- Name displayed in heliportmenu}}
//--- Helicopter vehicle class (from CfgVehicles)
displayName = $STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_H0;
vehicle = "Heli_Light01_H";
{{codecomment|//--- Description displayed in heliport menu}}
//--- Name displayed in heliportmenu
libTextDesc = $STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_ARMORY;
displayName = "$STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_H0";
{{codecomment|//--- Purchase price (negative value means amount is removed)}}
//--- Description displayed in heliport menu
price = -320000;
libTextDesc = "$STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_ARMORY";
{{codecomment|//--- Condition for showing the helicopter in menu (default is "true")}}
//--- Purchase price (negative value means amount is removed)
show = "[[random]] 1 > 0.5";
price = -320000;
{{codecomment|//--- Condition for enabling the helicopter in menu (it can be visible, but not purchasable) (default is "true")}}
//--- Condition for showing the helicopter in menu (default is "true")
enable = "[[daytime]] > 12";
show = "random 1 > 0.5";
{{codecomment|//--- Text displayed in case enable returns false}}
//--- Condition for enabling the helicopter in menu (it can be visible, but not purchasable) (default is "true")
enableText = "Helicopters before noon are so ungentlemanlike.";
enable = "daytime > 12";
{{codecomment|//--- When 1, helicopter is added automatically once show and enable conditions are met}}
//--- Text displayed in case enable returns false
forced = 1;
enableText = "Helicopters before noon are so ungentlemanlike.";
{{codecomment|//--- Tags}}
//--- When 1, helicopter is added automatically once show and enable conditions are met
types[] = {"light"};
forced = 1;
//--- Tags
{{codecomment|//--- Component category class}}
types[] = { "light" };
class Exterior
 
{
//--- Component category class
{{codecomment|//--- Category name displayed in menu}}
class Exterior
displayName = $STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior;
{
{{codecomment|//--- Component class}}
//--- Category name displayed in menu
class Doors
displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior";
{
//--- Component class
{{codecomment|//--- Component name displayed in menu}}
class Doors
displayName = $STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors;
{
{{codecomment|//--- Component description displayed in menu}}
//--- Component name displayed in menu
libTextDesc = $STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors_desc;
displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors";
{{codecomment|//--- Model selections which component enables}}
//--- Component description displayed in menu
components[] = {"AddDoors"};
libTextDesc = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors_desc";
{{codecomment|//--- Component purchase price}}
//--- Model selections which component enables
price = -1000;
components[] = { "AddDoors" };
{{codecomment|//--- Tags which component enables}}
//--- Component purchase price
types[] = {"doors"};
price = -1000;
{{codecomment|//--- Weight added to total helicopter weight}}
//--- Tags which component enables
weight = 10;
types[] = { "doors" };
};
//--- Weight added to total helicopter weight
};
weight = 10;
};
class Init  
};
{
 
displayName = "Init";
class Init  
{{codecomment|//--- Private scope - category is not displayed in menu}}
{
scope = 1;
displayName = "Init";
//--- Private scope - category is not displayed in menu
class CargoHook
scope = 1;
{
displayName = $STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook;
class CargoHook
libTextDesc = $STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook;
{
components[] = {};
displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook";
{{codecomment|//--- Component is added automatically}}
libTextDesc = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook";
forced = 1;
components[] = {};
{{codecomment|//--- Condition for removing the component from owned ones}}
//--- Component is added automatically
hide = "myCounter > 42";
forced = 1;
types[] = {"cargoHook"};
//--- Condition for removing the component from owned ones
};
hide = "myCounter > 42";
};
types[] = { "cargoHook" };
};
};
Component tags are unique, only on of the can be enabled at the same time. That means that if two component has for example tag "camera", enabling one of them will disable the other one. Only tags defined in ''class [[#Tags|Tags]]'' are displayed in requirements, which mean you can use virtual tags to handle correct technical exclusion
};
};
</syntaxhighlight>
 
Component tags are unique, only on of the can be enabled at the same time. That means that if two component has for example tag "camera", enabling one of them will disable the other one.
Only tags defined in ''class [[#Tags|Tags]]'' are displayed in requirements, which mean you can use virtual tags to handle correct technical exclusion.


'''Example:'''
'''Example:'''
<code>class Benches
<syntaxhighlight lang="cpp">
class Benches
{
{
types[] = {"benches","posSide"};
types[] = { "benches", "posSide" };
};
};
class Camera
class Camera
{
{
types[] = {"camera","posSide","posFrame"};
types[] = { "camera", "posSide", "posFrame" };
};</code>
};
''benches'' and ''camera'' are defined in class Tags and are displayed in mission requirements. However, ''posSide'' is virtual tag and makes sure that camera cannot be enabled at the same time as benches (as both occupy similar position).
</syntaxhighlight>
''benches'' and ''camera'' are defined in class Tags and are displayed in mission requirements.
However, ''posSide'' is virtual tag and makes sure that camera cannot be enabled at the same time as benches (as both occupy similar position).


=== Tags ===


=== Tags ===
Every helicopter or component is marked with tags, and missions can require helicopters or components with such tags to be owned by player before they can be played.
Every helicopter or component is marked with tags, and missions can require helicopters or components with such tags to be owned by player before they can be played. Otherwise "Show Requirements" button is active instead of "Play" in heliport mission selection. Clicking on the button will display tag descriptions defined in this class.
Otherwise "Show Requirements" button is active instead of "Play" in heliport mission selection. Clicking on the button will display tag descriptions defined in this class.


<code>class Tags
<syntaxhighlight lang="cpp">
class Tags
{
{
class Light
class Light
{
{
{{codecomment|//--- Name visible in 'Show Requirements' message box}}
//--- Name visible in 'Show Requirements' message box
displayName = $STR_HSIM_CfgBase_United_States_H_tags_Light;
displayName = "$STR_HSIM_CfgBase_United_States_H_tags_Light";
};
};
};</code>
};
</syntaxhighlight>


=== Factions ===


=== Factions ===
Factions serves as mission categories (e.g. Story, Government, Tutorials, ...).
Factions serves as mission categories (e.g. Story, Government, Tutorials, ...).
<code>class Factions
<syntaxhighlight lang="cpp">
class Factions
{
{
class CORE
class CORE
{
{
{{codecomment|//--- Name visible in Contracts menu}}
//--- Name visible in Contracts menu
displayName = $STR_HSIM_CfgBase_United_States_H_Factions_CORE;
displayName = "$STR_HSIM_CfgBase_United_States_H_Factions_CORE";
{{codecomment|//--- Unique faction id, used for mission categoriting (see [[#Missions|Missions]])}}
//--- Unique faction id, used for mission categoriting (see Missions paragraph above)
id = 0;
id = 0;
{{codecomment|//--- Listbox icon}}
//--- Listbox icon
image = "hsim\ui_h\data\igui_sidebriefing_civil_ca.paa";
image = "hsim\ui_h\data\igui_sidebriefing_civil_ca.paa";
};
};
};</code>
};
 
</syntaxhighlight>


=== Staff ===
=== Staff ===
Line 195: Line 215:


=== Upgrades ===
=== Upgrades ===
Heliport upgrades are compositions placed on heliport itself, like hangar, tools, tables etc. However, it can also include environment objects further away from heliport, like cargo ship wreck.
Heliport upgrades are compositions placed on heliport itself, like hangar, tools, tables etc. However, it can also include environment objects further away from heliport, like cargo ship wreck.


class Hangars
<syntaxhighlight lang="cpp">
{
class Hangars
displayName = "Hangars";
{
class Hangar_default
displayName = "Hangars";
  {
class Hangar_default
displayName = "Default Hangar";
{
libTextDesc = "Larkin Aviation offices";
displayName = "Default Hangar";
{{codecomment|//--- Composition class from CfgObjectCompositions}}
libTextDesc = "Larkin Aviation offices";
composition = "heliport_hangarDefault";
//--- Composition class from CfgObjectCompositions
{{codecomment|//--- Composition position}}
composition = "heliport_hangarDefault";
positions[] = {"hangar00"};
//--- Composition position
forced = 1;
positions[] = { "hangar00" };
};
forced = 1;
};
};
};
</syntaxhighlight>


=== NoFlyZones ===
=== NoFlyZones ===
No-fly zones created automatically by [[BIS_fnc_noFlyZonesCreate]].
No-fly zones created automatically by [[BIS_fnc_noFlyZonesCreate]].
<code>class Factions
<syntaxhighlight lang="cpp">
class Factions
{
{
class P51
class P51
{
{
{{codecomment|//--- Zone position}}
//--- Zone position
position[] = {2018.7,45494.7,0};
position[] = { 2018.7, 45494.7, 0 };
{{codecomment|//--- Zone area (matches [[triggerArea]] format))}}
//--- Zone area (matches triggerArea format))
area[] = {4500,3000,90,1};
area[] = { 4500, 3000, 90, 1 };
{{codecomment|//--- Zone type (see below)}}
//--- Zone type (see below)
type = 2;
type = 2;
};
};
};</code>
};
</syntaxhighlight>


Zone types (simplified representation of [http://en.wikipedia.org/wiki/Airspace_class airspace classes]):
Zone types (simplified representation of {{Link|https://en.wikipedia.org/wiki/Airspace_class|airspace classes}}):
* 0 - Airport (Class D Airspace)
* 0 - Airport (Class D Airspace)
* 1 - International Airport (Class B Airspace)
* 1 - International Airport (Class B Airspace)
* 2 - Restricted zone
* 2 - Restricted zone
[[Category:Take On Helicopters: Editing]]

Latest revision as of 22:13, 11 April 2023

Every world is allowed to have one heliport. All settings are placed in CfgBase under classname matching those of CfgWorlds class (and returned value worldName).

class CfgBase
{
	//--- World name (matches CfgWorlds class)
	class United_States_H
	{
		//--- Heliport name (visible in menus)
		displayName = "$STR_HSIM_CfgBase_United_States_H";
		//--- Script executed every time heliport is loaded
		init = "\hsim\Modules_H\base\United_States_H\init.sqf";
		//--- Starting date of heliport. Every completed mission adds one day
		initDate[] = { 2013, 8, 5, 10, 0 };
		//--- Starting money
		initMoney = 1985;

		//--- Subclasses (see below)
		class Mission
		{
			// ...
		};
		class Helicopters
		{
			// ...
		};

		// etc
	};
};

Following params are shared for Missions, Helicopters (including components), Staff and Upgrades.

  • scope
  • show
  • hide
  • enable
  • enableText
  • displayName
  • libTextDesc
  • price
  • forced

Mission

Includes mission.sqm of heliport mission. Used mainly dor debugging object positions in case the mission was not loaded previously.

class Mission
{
	#include "\hsim\Missions_H\campaign\missions\United_States_H.United_States_H\mission.sqm"
};

Missions

Procedural missions (Contracts).

class Missions
{
	class Visit
	{
		//--- Name visible in mission list on heliport
		displayName = "$STR_HSIM_CfgBase_United_States_H_Missions_Visit";
		//--- List of helicopter classes used as default. One of them is selected randomly.
		helicoptersDefault[] = {MISSION_HELICOPTERS_LM};
		//--- When 1, replaying the mission will still earn player money
		repeat = 1;
		//--- Faction ID
		faction = 2;
		//--- Mission reward
		price = 15000;
		//--- Classes of missions required before mission is displayed in menu
		requiredMissions[] = {
			"US_C_01"
		};
		//--- Helicopter tags required for mission to be enabled in menu
		requiredHelicopters[] = {
			{ "light", "medium" }
		};
		//--- Helicopter component required for mission to be enabled in menu
		requiredHelicopterUpgrades[] = {
			"doors"
		};
		//--- Company logo displayed in heliport menu
		overviewLogo = "hsim\ui_h\data\logos\logo_larkin_ca.paa";
	};
};

Helicopters

class HeliLight
{
	//--- Helicopter vehicle class (from CfgVehicles)
	vehicle = "Heli_Light01_H";
	//--- Name displayed in heliportmenu
	displayName = "$STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_H0";
	//--- Description displayed in heliport menu
	libTextDesc = "$STR_HSIM_CFGVEHICLES_HELI_LIGHT01_BASE_ARMORY";
	//--- Purchase price (negative value means amount is removed)
	price = -320000;
	//--- Condition for showing the helicopter in menu (default is "true")
	show = "random 1 > 0.5";
	//--- Condition for enabling the helicopter in menu (it can be visible, but not purchasable) (default is "true")
	enable = "daytime > 12";
	//--- Text displayed in case enable returns false
	enableText = "Helicopters before noon are so ungentlemanlike.";
	//--- When 1, helicopter is added automatically once show and enable conditions are met
	forced = 1;
	//--- Tags
	types[] = { "light" };

	//--- Component category class
	class Exterior
	{
		//--- Category name displayed in menu
		displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior";
		//--- Component class
		class Doors
		{
			//--- Component name displayed in menu
			displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors";
			//--- Component description displayed in menu
			libTextDesc = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliLight_Exterior_Doors_desc";
			//--- Model selections which component enables
			components[] = { "AddDoors" };
			//--- Component purchase price
			price = -1000;
			//--- Tags which component enables
			types[] = { "doors" };
			//--- Weight added to total helicopter weight
			weight = 10;
		};
	};

	class Init 
	{
		displayName = "Init";
		//--- Private scope - category is not displayed in menu
		scope = 1;
				
		class CargoHook
		{
			displayName = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook";
			libTextDesc = "$STR_HSIM_CfgBase_United_States_H_Helicopters_HeliHeavy_Exterior_CargoHook";
			components[] = {};
			//--- Component is added automatically
			forced = 1;
			//--- Condition for removing the component from owned ones
			hide = "myCounter > 42";
			types[] = { "cargoHook" };
		};
	};
};

Component tags are unique, only on of the can be enabled at the same time. That means that if two component has for example tag "camera", enabling one of them will disable the other one. Only tags defined in class Tags are displayed in requirements, which mean you can use virtual tags to handle correct technical exclusion.

Example:

class Benches
{
	types[] = { "benches", "posSide" };
};
class Camera
{
	types[] = { "camera", "posSide", "posFrame" };
};

benches and camera are defined in class Tags and are displayed in mission requirements. However, posSide is virtual tag and makes sure that camera cannot be enabled at the same time as benches (as both occupy similar position).

Tags

Every helicopter or component is marked with tags, and missions can require helicopters or components with such tags to be owned by player before they can be played. Otherwise "Show Requirements" button is active instead of "Play" in heliport mission selection. Clicking on the button will display tag descriptions defined in this class.

class Tags
{
	class Light
	{
		//--- Name visible in 'Show Requirements' message box
		displayName = "$STR_HSIM_CfgBase_United_States_H_tags_Light";
	};
};

Factions

Factions serves as mission categories (e.g. Story, Government, Tutorials, ...).

class Factions
{
	class CORE
	{
		//--- Name visible in Contracts menu
		displayName = "$STR_HSIM_CfgBase_United_States_H_Factions_CORE";
		//--- Unique faction id, used for mission categoriting (see Missions paragraph above)
		id = 0;
		//--- Listbox icon
		image = "hsim\ui_h\data\igui_sidebriefing_civil_ca.paa";
	};
};

Staff

TBA

Upgrades

Heliport upgrades are compositions placed on heliport itself, like hangar, tools, tables etc. However, it can also include environment objects further away from heliport, like cargo ship wreck.

class Hangars
{
	displayName = "Hangars";
	class Hangar_default
 	{
		displayName = "Default Hangar";
		libTextDesc = "Larkin Aviation offices";
		//--- Composition class from CfgObjectCompositions
		composition = "heliport_hangarDefault";
		//--- Composition position
		positions[] = { "hangar00" };
		forced = 1;
	};
};

NoFlyZones

No-fly zones created automatically by BIS_fnc_noFlyZonesCreate.

class Factions
{
	class P51
	{
		//--- Zone position
		position[] = { 2018.7, 45494.7, 0 };
		//--- Zone area (matches triggerArea format))
		area[] = { 4500, 3000, 90, 1 };
		//--- Zone type (see below)
		type = 2;
	};
};

Zone types (simplified representation of airspace classes):

  • 0 - Airport (Class D Airspace)
  • 1 - International Airport (Class B Airspace)
  • 2 - Restricted zone