Armory configuration: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added a page on configuring ArmA 2 for the Armory.)
 
m (Text replacement - "{{Feature | Informative | " to "{{Feature|informative|")
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=== Introduction ===
{{TOC|side}}
The [[Armory]] can have its parameters set in various configs. It's possible to change general settings like challenges, but also to override certain challenge parameters for one specific world. Each item in the game can also use a variety of parameters to be set up properly.
The [[Armory]] can have its parameters set in various configs.
It is possible to change general settings like challenges, but also to override certain challenge parameters for one specific world.
Each item in the game can also use a variety of parameters to be set up properly.


'''Note''': whenever a code sample shows ''...'', this means a full config will likely have more content, but this is not shown in these samples because it's not relevant to the Armory.
{{Feature|informative|Whenever a code sample shows {{hl|...}}, this means a full config will likely have more content, but this is not shown in these samples because it is not relevant to the Armory.}}




----
== CfgArmory ==


This is where you configure general settings for the Armory and more specifically challenges. Usually it is only necessary to work in this class when setting up the Armory for a new project or mod.


=== CfgArmory ===
=== Challenges ===
This is where you configure general settings for the Armory and more specifically challenges. Usually it's only necessary to work in this class when setting up the Armory for a new project or mod.


==== Challenges ====
Generally there are two base classes available (''Primary'' and ''Secondary'') which should ideally be used as base class for primary and secondary challenges.
Generally there are two base classes available (''Primary'' and ''Secondary'') which should ideally be used as base class for primary and secondary challenges.


  {{codecomment|//Main Armory configuration class.}}
<syntaxhighlight lang="cpp">
  class CfgArmory  
// Main Armory configuration class
  {
class CfgArmory
      ...
{
      {{codecomment|//Configure global challenge properties.}}
...
      class Challenges  
// Configure global challenge properties
      {
class Challenges
        {{codecomment|//Your challenge class.}}
{
        class Challenge1
// Your challenge class
        {
class Challenge1
            id = -1; {{codecomment|//Unique ID number}}
{
            title = ""; {{codecomment|//Title which is displayed}}
id = -1; // Unique ID number
            type = 0; {{codecomment|//0: primary, 1: secondary}}
title = ""; // Title which is displayed
            script = ""; {{codecomment|//Name of the script without path or extension}}
type = 0; // 0: primary, 1: secondary
            tidExclusions[] = {}; {{codecomment|//For which Type ID's is this challenge excluded?}}
script = ""; // Name of the script without path or extension
            configConditions[] = {}; {{codecomment|//What config conditions must the item satisfy?}}
tidExclusions[] = {}; // For which Type ID's is this challenge excluded?
            runtimeConditions[] = {}; {{codecomment|//What runtime conditions must the item satisfy?}}
configConditions[] = {}; // What config conditions must the item satisfy?
            {{codecomment|//Should a world explicitly enable this challenge or is it available by default?}}
runtimeConditions[] = {}; // What runtime conditions must the item satisfy?
            explicitEnable = 0;
// Should a world explicitly enable this challenge or is it available by default?
        };
explicitEnable = 0;
        ...
};
...
};
};
</syntaxhighlight>


 
==== Config conditions ====
===== Config conditions =====
The following conditions to test an item's static config against are available:
The following conditions to test an item's static config against are available:
* '''hasWeapon''': the item is armed with at least one weapon
* '''hasWeapon''': the item is armed with at least one weapon
Line 45: Line 48:
* '''isNotWoman''': the item is not a female
* '''isNotWoman''': the item is not a female


 
==== Runtime conditions ====
===== Runtime conditions =====
The following conditions to test an item's current state in the world against are available:
The following conditions to test an item's current state in the world against are available:
* '''flying''': the item is currently flying
* '''flying''': the item is currently flying ('''isFlying''' in the MP Armory)
* '''nearWater''': the item is currently near water (within 400 meters for TID 0 and 1, within 150 meters for all others)
* '''nearWater''': the item is currently near water (within 400 meters for TID 0 and 1, within 150 meters for all others)
* '''nearRoad''': the item is currently near any roads (within 300 meters)
* '''nearRoad''': the item is currently near any roads (within 300 meters)
* '''movingFast''': the item is currently moving fast (at least 50% of its maximum speed)
* '''movingFast''': the item is currently moving fast (at least 50% of its maximum speed) ('''isMovingFast''' in the MP Armory)
* '''isDriver''': the player is the driver of the item he is in (MP Armory only)
* '''isNight''': it is night (MP Armory only)
* '''notAlone''': there is more than one player (MP Armory only)
* '''notAloneAndOnFoot''': there is just one player and is he on foot (MP Armory only)
* '''vehicleForAll''': there ia at least one vehicle at ARMEX which can fit all players at once (MP Armory only)


 
==== Type IDs ====
===== Type ID's =====
Type IDs sort items into the major categories:
Type ID's sort items into the major categories:
* '''0''': Armored (Tracked in the MP Armory)
* '''0''': Armored
* '''1''': Soft (Wheeled in the MP Armory)
* '''1''': Soft
* '''2''': Static
* '''2''': Static
* '''3''': Helicopters
* '''3''': Helicopters
* '''4''': Airplanes
* '''4''': Airplanes
* '''5''': Ships
* '''5''': Ships (not currently supported in the MP Armory)
* '''6''': Rifles
* '''6''': Rifles
* '''7''': Machineguns
* '''7''': Machineguns
Line 67: Line 73:
* '''9''': Launchers
* '''9''': Launchers
* '''10''': Explosives
* '''10''': Explosives
* '''11''': Characters
* '''11''': Characters (not currently supported in the MP Armory)
* '''12''': Animals
* '''12''': Animals (not currently supported in the MP Armory)




----
== CfgWeapons / CfgVehicles ==


Each weapon and vehicle should define at least an Armory text description.
To configure this property, it is best to use class ''Armory'' within such item's class.
Class ''Library'' and its members are deprecated and while still supported, should no longer be added.


=== CfgWeapons / CfgVehicles ===
{{Feature|informative|The Armory relies heavily on an item's config properties, so please take care in defining them properly.
Each weapon and vehicle should define at least an Armory text description. To configure this property, it's best to use class ''Armory'' within such item's class. Class ''Library'' and its members are deprecated and while still supported, should no longer be added.
Some properties may seem insignificant and are inherited from a parent class, but will alter the way items are processed in challenges.}}


'''Note''': the Armory relies heavily on an item's config properties, so please take care in defining them properly. Some properties may seem insignificant and are inherited from a parent class, but will alter the way items are processed in challenges.
<syntaxhighlight lang="cpp">
class CfgVehicles
{
...
class SomeVehicle
{
...
class Armory
{
// The item's text description (one or several paragraphs).
// Equivalent of the deprecated libTextDesc member.
description = "My description ...";
// Specifically disable this item for the Armory.
// Default is 0 and therefore enabled.
// Equivalent of the deprecated libEnabled member.
disabled = 1;
// Override automatic categorization with this Type ID.
// Do not add unless absolutely necessary.
type = 12;
// Optionally set the author's name of this item.
author = "MyMod";
// These hints are randomly shown to players while using this item (Array of String).
// MP Armory only!
hints[] =
{
"My hint!"
};
...
};
};
};
</syntaxhighlight>


  class CfgVehicles
  {
      ...     
      class SomeVehicle
      {
        ...
        class Armory
        {
            {{codecomment|//The item's text description (one or several paragraphs).}}
            {{codecomment|//Equivalent of the deprecated libTextDesc member.}}
            description = "";
            {{codecomment|//Specifically disable this item for the Armory.}}
            {{codecomment|//Default is 0 and therefore enabled.}}
            {{codecomment|//Equivalent of the deprecated libEnabled member.}}
            disabled = 1;
            {{codecomment|//Override automatic categorization with this Type ID.}}
            {{codecomment|//Do not add unless absolutely necessary.}}
            type = 12;
            {{codecomment|//Optionally set the author's name of this item.}}
            author = "MyMod";
            ...


== CfgWorlds ==


----
=== CfgWorlds ===
The Armory can be configured for any world and this is where the bulk of the configuration takes place.
The Armory can be configured for any world and this is where the bulk of the configuration takes place.


=== Random positions ===


==== Random positions ====
The Armory and several other systems will often search the world for random positions. In order for this to work efficiently, two parameters should be set and fine-tuned in the world's main class.
The Armory and several other systems will often search the world for random positions. In order for this to work efficiently, two parameters should be set and fine-tuned in the world's main class.


  class CfgWorlds
<syntaxhighlight lang="cpp">
  {
class CfgWorlds
      ...
{
      class SomeWorld
...
      {
class SomeWorld
        {{codecomment|//The X and Y world coordinate for the center of a square in which random positions are searched.}}
{
        {{codecomment|//Usually this square should cover the main (and interesting) part of the world map.}}
// The X and Y world coordinate for the center of a square in which random positions are searched.
        {{codecomment|//Designers may find this square by placing a marker with the same dimensions and fine-tuning it.}}
// Usually this square should cover the main (and interesting) part of the world map.
        safePositionAnchor[] = {1, 1};
// Designers may find this square by placing a marker with the same dimensions and fine-tuning it.
        {{codecomment|//The distance in meters from the center of the same square.}}
safePositionAnchor[] = {1, 1};
        safePositionRadius = 5000;
// The distance in meters from the center of the same square.
        ...
safePositionRadius = 5000;
...
};
};
</syntaxhighlight>


=== World properties ===


==== World properties ====
Not all of the following positions are mandatory to define, but having them will make for better functionality.
Not all of the following positions are mandatory to define, but having them will make for better functionality.


  class CfgWorlds
<syntaxhighlight lang="cpp">
  {
class CfgWorlds
      ...
{
      class SomeWorld
...
      {
class SomeWorld
        class Armory
{
        {
class Armory
            {{codecomment|//A default position used to try out items.}}
{
            {{codecomment|//Usually such position is random, but in case nothing was found, the default is used.}}
// A default position used to try out items.
            {{codecomment|//If none is defined, the world's centerPosition is used instead.}}
// Usually such position is random, but in case nothing was found, the default is used.
            positionStart[] = {1, 1};
// If none is defined, the world's centerPosition is used instead.
 
positionStart[] = {1, 1};
            {{codecomment|//The same as above, but specifically for water vehicles.}}
 
            {{codecomment|//Obviously this should be inside a body of water (the larger the better).}}
// The same as above, but specifically for water vehicles.
            {{codecomment|//If none is defined, positionStart is used.}}
// Obviously this should be inside a body of water (the larger the better).
            positionStartWater[] = {1, 1};
// If none is defined, positionStart is used.
 
positionStartWater[] = {1, 1};
            {{codecomment|//The game requires a player character to be present in the world.}}
 
            {{codecomment|//Try to use a remote position, like a tiny island in the ocean.}}
// The game requires a player character to be present in the world.
            {{codecomment|//If none is defined, positionStart is used.}}
// Try to use a remote position, like a tiny island in the ocean.
            positionAdmin[] = {1, 1};
// If none is defined, positionStart is used.
 
positionAdmin[] = {1, 1};
            {{codecomment|//A list of blacklisted areas in which no positions may be used.}}
            {{codecomment|//Typically used for inaccessible mountains, small lakes, etc.}}
            {{codecomment|//Each element consists of two XY-coordinates.}}
            {{codecomment|//The top-left point and bottom-right point defining a square area.}}
            positionBlacklist[] =
            {
              {{1, 1}, {2, 2}},
              {{3, 3}, {4, 4}}
            };
 
            {{codecomment|//A list of XY-coordinates used for the Viewer mode.}}
            {{codecomment|//If none is defined, positionStart is used.}}
            positionsViewer[] =
            {
              {1, 1},
              {2, 2}
            };
 
            {{codecomment|//A list of XY-coordinates used for the Viewer mode for water vehicles.}}
            {{codecomment|//If none is defined, positionStartWater is used.}}
            positionsViewerWater[] =
            {
              {1, 1},
              {2, 2}
            };


// A list of blacklisted areas in which no positions may be used.
// Typically used for inaccessible mountains, small lakes, etc.
// Each element consists of two XY-coordinates.
// The top-left point and bottom-right point defining a square area.
positionBlacklist[] =
{
{{1, 1}, {2, 2}},
{{3, 3}, {4, 4}}
};


==== Challenges ====
// A list of XY-coordinates used for the Viewer mode.
Many challenges require special parameters to be defined to function correctly. Some challenges will simply never be started when they have not be configured for a world and not explicitly enabled (see ''CfgArmory.Challenges'').
// If none is defined, positionStart is used.
positionsViewer[] =
{
{1, 1},
{2, 2}
};
 
// A list of XY-coordinates used for the Viewer mode for water vehicles.
// If none is defined, positionStartWater is used.
positionsViewerWater[] =
{
{1, 1},
{2, 2}
};
...
};
};
};
</syntaxhighlight>
 
=== Challenges ===
 
Many challenges require special parameters to be defined to function correctly.
Some challenges will simply never be started when they have not be configured for a world and not explicitly enabled (see ''CfgArmory.Challenges'').


All of the following definitions are classes within ''CfgWorlds.SomeWorld.Challenges''.
All of the following definitions are classes within ''CfgWorlds.SomeWorld.Challenges''.


  class CfgWorlds
<syntaxhighlight lang="cpp">
  {
class CfgWorlds
      ...
{
      class SomeWorld
...
      {
class SomeWorld
        ...
{
        class Challenges
...
        {
class Challenges
            ...
{
 
...
};
};
};
</syntaxhighlight>


===== Disabling challenges =====
==== Disabling challenges ====
A challenge can be disabled explicitly for a certain world. This is only necessary for challenges which do not require explicit enabling.
A challenge can be disabled explicitly for a certain world. This is only necessary for challenges which do not require explicit enabling.


  class SomeChallenge
<syntaxhighlight lang="cpp">
  {
class SomeChallenge
      disabled = 1;
{
      ...
disabled = 1;
...
};
</syntaxhighlight>


==== CheckpointRace ====
Always enabled unless disabled


===== CheckpointRace =====
<syntaxhighlight lang="cpp">
Always enabled unless disabled
class CheckpointRace
{
// Defines a fixed race route as back-up to the dynamic route system.
// In case no dynamic route can be found, this one is used.
backUpRoute[] =
{
{1, 1}, // Waypoint 1
{2, 2} // Waypoint 2
};
};
</syntaxhighlight>


  class CheckpointRace
==== FiringRange ====
  {
Only enabled when explicitly enabled
      {{codecomment|//Defines a fixed race route as back-up to the dynamic route system.}}
      {{codecomment|//In case no dynamic route can be found, this one is used.}}
      backUpRoute[] =  
      {
        {1, 1}, {{codecomment|//Waypoint 1}}
        {2, 2} {{codecomment|//Waypoint 2}}
      };
  };


<syntaxhighlight lang="cpp">
class FiringRange
{
// One or more XY-coordinates for a Firing Range
// The Firing Range needs large and long open areas, like airstrips.
positionsStart[] = {{1, 1}};
directionsStart[] = {90};
// Corresponding azimuths for the above coordinates in degrees
// The first azimuth corresponds to the first coordinate set.
positionsStartWater[] = {{2, 2}}; // As above, but for water vehicles
directionsStartWater[] = {180}; // Idem
};
</syntaxhighlight>


===== FiringRange =====
==== FitnessTrack ====
Only enabled when explicitly enabled
Only enabled when explicitly enabled


  class FiringRange
{{Feature|informative|Each world may define one or more Fitness Tracks.
  {
All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.}}
      {{codecomment|//One or more XY-coordinates for a Firing Range}}
 
      {{codecomment|//The Firing Range needs large and long open areas, like airstrips.}}
<syntaxhighlight lang="cpp">
      positionsStart[] = &#123;{1, 1}};
class FitnessTrack
      directionsStart[] = {90};
{
      {{codecomment|//Corresponding azimuths for the above coordinates in degrees}}
positionStart[] = {{1, 1}}; // Player spawning positions
      {{codecomment|//The first azimuth corresponds to the first coordinate set.}}
directionStart[] = {90}; // Player spawning directions
      positionsStartWater[] = &#123;{2, 2}}; {{codecomment|//As above, but for water vehicles}}
      directionsStartWater[] = {180}; {{codecomment|//Idem}}
  };


// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
// These are the objects, such as climbing obstacles, flags, signs, etc.
objectSets[] = {"myDynoScript.sqf"};
positionAnchor[] = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)


===== FitnessTrack =====
// The lists of gameplay challenges of the Fitness Track
// Mainly defines what hints are shown, but does not place the actual obstacle object!
obstacleSets[] =
{
{
/*
Array format:
0 - challenge XY-coordinates - Array
1 - azimuth in degrees - Scalar
2 - completion trigger area width in meters - Scalar
3 - completion trigger area height in meters - Scalar
4 - challenge type ID - Scalar
0: Start
1: Zig-zag maze
2: Duckboard
3: Hole
4: Barbed wire
5: Climbing
6: Ladder
7: Concrete ramp
8: Buoy
9: Wooden ramp
10: Finish
11: Waypoint
12: Step over
5 - hint to override default - String
*/
{{1, 1}, 90, 3, 2, 0, ""}, // First challenge
{{2, 2}, 180, 4, 1.5, 10, "Hello world!"} // Second challenge
}
};
 
// XY-coordinates for live-firing machineguns used at the crawling obstacle
positionMachineguns[] =
{
{{1, 1}, {2, 2}}
};
 
// Azimuths in degrees for the above machineguns
directionMachineguns[] =
{
{90, 180}
};
 
// The following properties are exactly as above, but for the animal Fitness Track.
positionStartAnimal[] = {{1, 1}};
directionStartAnimal[] = {90};
 
objectSetsAnimal[] = {"myAnimalDynoScript.sqf"};
positionAnchorAnimal[] = {{1, 1}};
 
obstacleSetsAnimal[] =
{
{
{...},
{...}
}
};
...
};
</syntaxhighlight>
 
==== MobilityRange ====
Only enabled when explicitly enabled
Only enabled when explicitly enabled


'''Note''': each world may define one or more Fitness Tracks. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.
{{Feature|informative|Each world may define one or more Mobility Ranges.
All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.}}
 
<syntaxhighlight lang="cpp">
class MobilityRange
{
positionStart[] = {{1, 1}}; // Player spawning positions
directionStart[] = {90}; // Player spawning directions
 
// Like above, but for amphibious vehicles (optional)
positionStartAmphibious[] = {{2, 2}};
directionStartAmphibious[] = {180};
 
// Like above, but for water vehicles
positionStartWater[] = {{3, 3}};
directionStartWater[] = {270};
 
// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
// These are the objects, such as ramps, flags, signs, etc.
objectSets[] = {"myDynoScript.sqf"};
positionAnchor = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)
 
// Like above, but for water vehicles
objectSetsWater[] = {"myWaterDynoScript.sqf"};
positionAnchorWater[] = {{1, 1}};
 
// The lists of gameplay challenges of the Mobility Range
// Mainly defines what hints are shown, but does not place the actual obstacle object!
obstacleSets[] =
{
{
/*
Array format:
0 - challenge XY-coordinates - Array
1 - azimuth in degrees - Scalar
2 - completion trigger area width in meters - Scalar
3 - completion trigger area height in meters - Scalar
4 - challenge type ID - Scalar
0: Start
1: Small humps
2: Small alternating humps
3: Ramp
4: Checkpoint
5: Large humps
6: Large alternating humps
7: Waypoint
8: Mount
9: Finish
10: Chicane
11: Slalom
5 - hint to override default - String
*/
{{1, 1}, 90, 3, 2, 0, ""}, // First challenge
{{2, 2}, 180, 4, 1.5, 9, "Hello world!"} // Second challenge
}
};
 
// Like above, but for water vehicles
obstacleSetsWater[] =
{
{
{...},
{...}
}
};


  class FitnessTrack
// It's possible to have flaming, rolling barrels be triggered while clearing the range.
  {
positionRollingBarrels[] = {{1, 1}}; // XY-coordinate sets where the barrels start
      positionStart[] = &#123;{1, 1}}; {{codecomment|//Player spawning positions}}
directionRollingBarrels[] = {90}; // Azimuths in degrees used to push the barrels towards
      directionStart[] = {90}; {{codecomment|//Player spawning directions}}
positionTriggerRollingBarrels[] = {{2, 2}}; // XY-coordinate sets for the triggers for the barrels
 
radiusTriggerRollingBarrels[] = {10}; // Radii for the above triggers
      {{codecomment|//These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.}}
      {{codecomment|//These are the objects, such as climbing obstacles, flags, signs, etc.}}
      objectSets[] = {"myDynoScript.sqf"};
      positionAnchor[] = &#123;{1, 1}}; {{codecomment|//XY-coordinate sets where the DynO sets are spawned (using azimuth 0)}}
 
      {{codecomment|//The lists of gameplay challenges of the Fitness Track}}
      {{codecomment|//Mainly defines what hints are shown, but does not place the actual obstacle object!}}
      obstacleSets[] =  
      {
        {
            {{codecomment|/*Array format:}}
            {{codecomment|0 - challenge XY-coordinates - Array}}
            {{codecomment|1 - azimuth in degrees - Scalar}}
            {{codecomment|2 - completion trigger area width in meters - Scalar}}
            {{codecomment|3 - completion trigger area height in meters - Scalar}}
            {{codecomment|4 - challenge type ID - Scalar}}
            {{codecomment|  0: Start}}
            {{codecomment|  1: Zig-zag maze}}
            {{codecomment|  2: Duckboard}}
            {{codecomment|  3: Hole}}
            {{codecomment|  4: Barbed wire}}
            {{codecomment|  5: Climbing}}
            {{codecomment|  6: Ladder}}
            {{codecomment|  7: Concrete ramp}}
            {{codecomment|  8: Buoy}}
            {{codecomment|  9: Wooden ramp}}
            {{codecomment|  10: Finish}}
            {{codecomment|  11: Waypoint}}
            {{codecomment|  12: Step over}}
            {{codecomment|5 - hint to override default - String*/}}
            {{1, 1}, 90, 3, 2, 0, ""}, {{codecomment|//First challenge}}
            {{2, 2}, 180, 4, 1.5, 10, "Hello world!"} {{codecomment|//Second challenge}}
        }
      };
 
      {{codecomment|//XY-coordinates for live-firing machineguns used at the crawling obstacle}}
      positionMachineguns[] =  
      {
        {{1, 1}, {2, 2}}
      };
 
      {{codecomment|//Azimuths in degrees for the above machineguns}}
      directionMachineguns[] =  
      {
        {90, 180}
      };
 
      {{codecomment|//The following properties are exactly as above, but for the animal Fitness Track.}}
      positionStartAnimal[] = &#123;{1, 1}};
      directionStartAnimal[] = {90};
 
      objectSetsAnimal[] = {"myAnimalDynoScript.sqf"};
      positionAnchorAnimal[] = &#123;{1, 1}};
 
      obstacleSetsAnimal[] =
      {
        {
            {...},
            {...}
        }
      };


// You may enable oncoming traffic on the range, which create a moving obstacle.
positionOncomingTraffic[] = {{1, 1}}; // XY-coordinate sets where the vehicles are spawned
directionOncomingTraffic[] = {90}; // Azimuths in degrees of the spawned vehicles
// Sets of waypoints the vehicles will drive along
waypointsOncomingTraffic[] =
{
{
{1, 1},
{2, 2}
}
};
positionTriggerOncomingTraffic[] = {{2, 2}}; // XY-coordinate sets for the triggers for the traffic
radiusTriggerOncomingTraffic[] = {10}; // Radii for the above triggers
};
</syntaxhighlight>


===== MobilityRange =====
==== KillHouse ====
Only enabled when explicitly enabled
Only enabled when explicitly enabled


'''Note''': each world may define one or more Mobility Ranges. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.
{{Feature|informative|Each world may define one or more Kill Houses.
All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.}}
 
<syntaxhighlight lang="cpp">
class KillHouse
{
// Kill House properties for infantry with man-portable weapons
class Small
{
positionStart[] = {{1, 1}}; // Player spawn XY-coordinate sets
directionStart[] = {90}; // Player spawn azimuths in degrees
positionEnd[] = {{2, 2}}; // Final waypoint XY-coordinate sets
 
// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
// These are the extra objects, such as wrecks, barrels, crates, etc.
objectSet[] = {"myDynoScript.sqf"};
positionAnchor[] = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)
 
// Waypoint sets through the Kill House as XY-coordinate sets
waypoints[] =
{
{
{1, 1},
{2, 2}
}
};


  class MobilityRange
// Sets of targets placed throughout the Kill House
  {
class Targets
      positionStart[] = &#123;{1, 1}}; {{codecomment|//Player spawning positions}}
{
      directionStart[] = {90}; {{codecomment|//Player spawning directions}}
class TargetSet1
 
{
      {{codecomment|//Like above, but for amphibious vehicles (optional)}}
class Target1
      positionStartAmphibious[] = &#123;{2, 2}};
{
      directionStartAmphibious[] = {180};
// Target type:
 
// 0: static
      {{codecomment|//Like above, but for water vehicles}}
// 1: moving
      positionStartWater[] = &#123;{3, 3}};
type = 1;
      directionStartWater[] = {270};
position[] = {1, 1}; // Target position
 
direction = 90; // Target azimuth in degrees
      {{codecomment|//These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.}}
upTime = 4; // How long does the target remain popped up?
      {{codecomment|//These are the objects, such as ramps, flags, signs, etc.}}
positionMove[] = {2, 2}; // In case of a moving target: where to move to?
      objectSets[] = {"myDynoScript.sqf"};
moveTime = 8; // In case of a moving target: how long will it take to move in seconds?
      positionAnchor = &#123;{1, 1}}; {{codecomment|//XY-coordinate sets where the DynO sets are spawned (using azimuth 0)}}
// Target side:
 
// 0: enemy to the player
      {{codecomment|//Like above, but for water vehicles}}
// 1: civilian
      objectSetsWater[] = {"myWaterDynoScript.sqf"};
// 2: a 50% chance for one or the other
      positionAnchorWater[] = &#123;{1, 1}};
side = 0;
 
// Target size:
      {{codecomment|//The lists of gameplay challenges of the Mobility Range}}
// 0: small (infantry)
      {{codecomment|//Mainly defines what hints are shown, but does not place the actual obstacle object!}}
// 1: large (vehicle)
      obstacleSets[] =
size = 0;
      {
// Target spawn condition:
        {
// 0: always spawn
            {{codecomment|/*Array format:}}
// 1: a 50% chance to spawn
            {{codecomment|0 - challenge XY-coordinates - Array}}
spawn = 0;
            {{codecomment|1 - azimuth in degrees - Scalar}}
positionTrigger[] = {3, 3}; // XY-coordinate of the trigger to activate the target
            {{codecomment|2 - completion trigger area width in meters - Scalar}}
radiusTrigger = 10; // Radius of the above trigger
            {{codecomment|3 - completion trigger area height in meters - Scalar}}
};
            {{codecomment|4 - challenge type ID - Scalar}}
...
            {{codecomment|  0: Start}}
};
            {{codecomment|  1: Small humps}}
};
            {{codecomment|  2: Small alternating humps}}
};
            {{codecomment|  3: Ramp}}
            {{codecomment|  4: Checkpoint}}
            {{codecomment|  5: Large humps}}
            {{codecomment|  6: Large alternating humps}}
            {{codecomment|  7: Waypoint}}
            {{codecomment|  8: Mount}}
            {{codecomment|  9: Finish}}
            {{codecomment|  10: Chicane}}
            {{codecomment|  11: Slalom}}
            {{codecomment|5 - hint to override default - String*/}}
            {{1, 1}, 90, 3, 2, 0, ""}, {{codecomment|//First challenge}}
            {{2, 2}, 180, 4, 1.5, 9, "Hello world!"} {{codecomment|//Second challenge}}
        }
      };
 
      {{codecomment|//Like above, but for water vehicles}}
      obstacleSetsWater[] =  
      {
        {
            {...},
            {...}
        }
      };
 
      {{codecomment|//It's possible to have flaming, rolling barrels be triggered while clearing the range.}}
      positionRollingBarrels[] = &#123;{1, 1}}; {{codecomment|//XY-coordinate sets where the barrels start}}
      directionRollingBarrels[] = {90}; {{codecomment|//Azimuths in degrees used to push the barrels towards}}
      positionTriggerRollingBarrels[] = &#123;{2, 2}}; {{codecomment|//XY-coordinate sets for the triggers for the barrels}}
      radiusTriggerRollingBarrels[] = {10}; {{codecomment|//Radii for the above triggers}}
 
      {{codecomment|//You may enable oncoming traffic on the range, which create a moving obstacle.}}
      positionOncomingTraffic[] = &#123;{1, 1}}; {{codecomment|//XY-coordinate sets where the vehicles are spawned}}
      directionOncomingTraffic[] = {90}; {{codecomment|//Azimuths in degrees of the spawned vehicles}}
      {{codecomment|//Sets of waypoints the vehicles will drive along}}
      waypointsOncomingTraffic[] =
      {
        {
            {1, 1},
            {2, 2}
        }
      };
      positionTriggerOncomingTraffic[] = &#123;{2, 2}}; {{codecomment|//XY-coordinate sets for the triggers for the traffic}}
      radiusTriggerOncomingTraffic[] = {10}; {{codecomment|//Radii for the above triggers}}
  };


// Like above, but for vehicles
class Large
{
...
};


===== KillHouse =====
// Like above, but for water vehicles
Only enabled when explicitly enabled
class Water
{
...
};
};
</syntaxhighlight>


'''Note''': each world may define one or more Kill Houses. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.


  class KillHouse
{{GameCategory|arma1|Editing}}
  {
      {{codecomment|//Kill House properties for infantry with man-portable weapons}}
      class Small
      {
        positionStart[] = &#123;{1, 1}}; {{codecomment|//Player spawn XY-coordinate sets}}
        directionStart[] = {90}; {{codecomment|//Player spawn azimuths in degrees}}
        positionEnd[] = &#123;{2, 2}}; {{codecomment|//Final waypoint XY-coordinate sets}}
 
        {{codecomment|//These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.}}
        {{codecomment|//These are the extra objects, such as wrecks, barrels, crates, etc.}}
        objectSet[] = {"myDynoScript.sqf"};
        positionAnchor[] = &#123;{1, 1}}; {{codecomment|//XY-coordinate sets where the DynO sets are spawned (using azimuth 0)}}
 
        {{codecomment|//Waypoint sets through the Kill House as XY-coordinate sets}}
        waypoints[] =
        {
            {
              {1, 1},
              {2, 2}
            }
        };
 
        {{codecomment|//Sets of targets placed throughout the Kill House}}
        class Targets
        {
            class TargetSet1
            {
              class Target1
              {
                  {{codecomment|//Target type:}}
                  {{codecomment|//  0: static}}
                  {{codecomment|//  1: moving}}
                  type = 1;
                  position[] = {1, 1}; {{codecomment|//Target position}}
                  direction = 90; {{codecomment|//Target azimuth in degrees}}
                  upTime = 4; {{codecomment|//How long does the target remain popped up?}}
                  positionMove[] = {2, 2}; {{codecomment|//In case of a moving target: where to move to?}}
                  moveTime = 8; {{codecomment|//In case of a moving target: how long will it take to move in seconds?}}
                  {{codecomment|//Target side:}}
                  {{codecomment|//  0: enemy to the player}}
                  {{codecomment|//  1: civilian}}
                  {{codecomment|//  2: a 50% chance for one or the other}}
                  side = 0;
                  {{codecomment|//Target size:}}
                  {{codecomment|//  0: small (infantry)}}
                  {{codecomment|//  1: large (vehicle)}}
                  size = 0;
                  {{codecomment|//Target spawn condition:}}
                  {{codecomment|//  0: always spawn}}
                  {{codecomment|//  1: a 50% chance to spawn}}
                  spawn = 0;
                  positionTrigger[] = {3, 3}; {{codecomment|//XY-coordinate of the trigger to activate the target}}
                  radiusTrigger = 10; {{codecomment|//Radius of the above trigger}}
              };
              ...
            };
        };
      };
 
      {{codecomment|//Like above, but for vehicles}}
      class Large
      {
        ...
      };
 
      {{codecomment|//Like above, but for water vehicles}}
      class Water
      {
        ...
      };
  };

Latest revision as of 21:41, 16 May 2024

The Armory can have its parameters set in various configs. It is possible to change general settings like challenges, but also to override certain challenge parameters for one specific world. Each item in the game can also use a variety of parameters to be set up properly.

Whenever a code sample shows ..., this means a full config will likely have more content, but this is not shown in these samples because it is not relevant to the Armory.


CfgArmory

This is where you configure general settings for the Armory and more specifically challenges. Usually it is only necessary to work in this class when setting up the Armory for a new project or mod.

Challenges

Generally there are two base classes available (Primary and Secondary) which should ideally be used as base class for primary and secondary challenges.

// Main Armory configuration class
class CfgArmory
{
	...
	// Configure global challenge properties
	class Challenges
	{
		// Your challenge class
		class Challenge1
		{
			id = -1;		// Unique ID number
			title = "";		// Title which is displayed
			type = 0;		// 0: primary, 1: secondary
			script = "";	// Name of the script without path or extension
			tidExclusions[] = {};		// For which Type ID's is this challenge excluded?
			configConditions[] = {};	// What config conditions must the item satisfy?
			runtimeConditions[] = {};	// What runtime conditions must the item satisfy?
			// Should a world explicitly enable this challenge or is it available by default?
			explicitEnable = 0;
		};
		...
	};
};

Config conditions

The following conditions to test an item's static config against are available:

  • hasWeapon: the item is armed with at least one weapon
  • amphibious: the item is amphibious / can swim
  • hasTransport: the item can transport passengers
  • isNotWoman: the item is not a female

Runtime conditions

The following conditions to test an item's current state in the world against are available:

  • flying: the item is currently flying (isFlying in the MP Armory)
  • nearWater: the item is currently near water (within 400 meters for TID 0 and 1, within 150 meters for all others)
  • nearRoad: the item is currently near any roads (within 300 meters)
  • movingFast: the item is currently moving fast (at least 50% of its maximum speed) (isMovingFast in the MP Armory)
  • isDriver: the player is the driver of the item he is in (MP Armory only)
  • isNight: it is night (MP Armory only)
  • notAlone: there is more than one player (MP Armory only)
  • notAloneAndOnFoot: there is just one player and is he on foot (MP Armory only)
  • vehicleForAll: there ia at least one vehicle at ARMEX which can fit all players at once (MP Armory only)

Type IDs

Type IDs sort items into the major categories:

  • 0: Armored (Tracked in the MP Armory)
  • 1: Soft (Wheeled in the MP Armory)
  • 2: Static
  • 3: Helicopters
  • 4: Airplanes
  • 5: Ships (not currently supported in the MP Armory)
  • 6: Rifles
  • 7: Machineguns
  • 8: Sidearms
  • 9: Launchers
  • 10: Explosives
  • 11: Characters (not currently supported in the MP Armory)
  • 12: Animals (not currently supported in the MP Armory)


CfgWeapons / CfgVehicles

Each weapon and vehicle should define at least an Armory text description. To configure this property, it is best to use class Armory within such item's class. Class Library and its members are deprecated and while still supported, should no longer be added.

The Armory relies heavily on an item's config properties, so please take care in defining them properly. Some properties may seem insignificant and are inherited from a parent class, but will alter the way items are processed in challenges.
class CfgVehicles
{
	...
	class SomeVehicle
	{
		...
		class Armory
		{
			// The item's text description (one or several paragraphs).
			// Equivalent of the deprecated libTextDesc member.
			description = "My description ...";
			// Specifically disable this item for the Armory.
			// Default is 0 and therefore enabled.
			// Equivalent of the deprecated libEnabled member.
			disabled = 1;
			// Override automatic categorization with this Type ID.
			// Do not add unless absolutely necessary.
			type = 12;
			// Optionally set the author's name of this item.
			author = "MyMod";
			// These hints are randomly shown to players while using this item (Array of String).
			// MP Armory only!
			hints[] =
			{
				"My hint!"
			};
			...
		};
	};
};


CfgWorlds

The Armory can be configured for any world and this is where the bulk of the configuration takes place.

Random positions

The Armory and several other systems will often search the world for random positions. In order for this to work efficiently, two parameters should be set and fine-tuned in the world's main class.

class CfgWorlds
{
	...
	class SomeWorld
	{
		// The X and Y world coordinate for the center of a square in which random positions are searched.
		// Usually this square should cover the main (and interesting) part of the world map.
		// Designers may find this square by placing a marker with the same dimensions and fine-tuning it.
		safePositionAnchor[] = {1, 1};
		// The distance in meters from the center of the same square.
		safePositionRadius = 5000;
		...
	};
};

World properties

Not all of the following positions are mandatory to define, but having them will make for better functionality.

class CfgWorlds
{
	...
	class SomeWorld
	{
		class Armory
		{
			// A default position used to try out items.
			// Usually such position is random, but in case nothing was found, the default is used.
			// If none is defined, the world's centerPosition is used instead.
			positionStart[] = {1, 1};

			// The same as above, but specifically for water vehicles.
			// Obviously this should be inside a body of water (the larger the better).
			// If none is defined, positionStart is used.
			positionStartWater[] = {1, 1};

			// The game requires a player character to be present in the world.
			// Try to use a remote position, like a tiny island in the ocean.
			// If none is defined, positionStart is used.
			positionAdmin[] = {1, 1};

			// A list of blacklisted areas in which no positions may be used.
			// Typically used for inaccessible mountains, small lakes, etc.
			// Each element consists of two XY-coordinates.
			// The top-left point and bottom-right point defining a square area.
			positionBlacklist[] =
			{
				{{1, 1}, {2, 2}},
				{{3, 3}, {4, 4}}
			};

			// A list of XY-coordinates used for the Viewer mode.
			// If none is defined, positionStart is used.
			positionsViewer[] =
			{
				{1, 1},
				{2, 2}
			};

			// A list of XY-coordinates used for the Viewer mode for water vehicles.
			// If none is defined, positionStartWater is used.
			positionsViewerWater[] =
			{
				{1, 1},
				{2, 2}
			};
			...
		};
	};
};

Challenges

Many challenges require special parameters to be defined to function correctly. Some challenges will simply never be started when they have not be configured for a world and not explicitly enabled (see CfgArmory.Challenges).

All of the following definitions are classes within CfgWorlds.SomeWorld.Challenges.

class CfgWorlds
{
	...
	class SomeWorld
	{
		...
		class Challenges
		{
			...
		};
	};
};

Disabling challenges

A challenge can be disabled explicitly for a certain world. This is only necessary for challenges which do not require explicit enabling.

class SomeChallenge
{
	disabled = 1;
	...
};

CheckpointRace

Always enabled unless disabled

class CheckpointRace
{
	// Defines a fixed race route as back-up to the dynamic route system.
	// In case no dynamic route can be found, this one is used.
	backUpRoute[] =
	{
		{1, 1}, // Waypoint 1
		{2, 2} // Waypoint 2
	};
};

FiringRange

Only enabled when explicitly enabled

class FiringRange
{
	// One or more XY-coordinates for a Firing Range
	// The Firing Range needs large and long open areas, like airstrips.
	positionsStart[] = {{1, 1}};
	directionsStart[] = {90};
	// Corresponding azimuths for the above coordinates in degrees
	// The first azimuth corresponds to the first coordinate set.
	positionsStartWater[] = {{2, 2}}; // As above, but for water vehicles
	directionsStartWater[] = {180}; // Idem
};

FitnessTrack

Only enabled when explicitly enabled

Each world may define one or more Fitness Tracks. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.
class FitnessTrack
{
	positionStart[] = {{1, 1}}; // Player spawning positions
	directionStart[] = {90}; // Player spawning directions

	// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
	// These are the objects, such as climbing obstacles, flags, signs, etc.
	objectSets[] = {"myDynoScript.sqf"};
	positionAnchor[] = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)

	// The lists of gameplay challenges of the Fitness Track
	// Mainly defines what hints are shown, but does not place the actual obstacle object!
	obstacleSets[] =
	{
		{
			/*
				Array format:
				0 - challenge XY-coordinates - Array
				1 - azimuth in degrees - Scalar
				2 - completion trigger area width in meters - Scalar
				3 - completion trigger area height in meters - Scalar
				4 - challenge type ID - Scalar
					0: Start
					1: Zig-zag maze
					2: Duckboard
					3: Hole
					4: Barbed wire
					5: Climbing
					6: Ladder
					7: Concrete ramp
					8: Buoy
					9: Wooden ramp
					10: Finish
					11: Waypoint
					12: Step over
				5 - hint to override default - String
			*/
			{{1, 1}, 90, 3, 2, 0, ""}, // First challenge
			{{2, 2}, 180, 4, 1.5, 10, "Hello world!"} // Second challenge
		}
	};

	// XY-coordinates for live-firing machineguns used at the crawling obstacle
	positionMachineguns[] =
	{
		{{1, 1}, {2, 2}}
	};

	// Azimuths in degrees for the above machineguns
	directionMachineguns[] =
	{
		{90, 180}
	};

	// The following properties are exactly as above, but for the animal Fitness Track.
	positionStartAnimal[] = {{1, 1}};
	directionStartAnimal[] = {90};

	objectSetsAnimal[] = {"myAnimalDynoScript.sqf"};
	positionAnchorAnimal[] = {{1, 1}};

	obstacleSetsAnimal[] =
	{
		{
			{...},
			{...}
		}
	};
	...
};

MobilityRange

Only enabled when explicitly enabled

Each world may define one or more Mobility Ranges. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.
class MobilityRange
{
	positionStart[] = {{1, 1}}; // Player spawning positions
	directionStart[] = {90}; // Player spawning directions

	// Like above, but for amphibious vehicles (optional)
	positionStartAmphibious[] = {{2, 2}};
	directionStartAmphibious[] = {180};

	// Like above, but for water vehicles
	positionStartWater[] = {{3, 3}};
	directionStartWater[] = {270};

	// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
	// These are the objects, such as ramps, flags, signs, etc.
	objectSets[] = {"myDynoScript.sqf"};
	positionAnchor = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)

	// Like above, but for water vehicles
	objectSetsWater[] = {"myWaterDynoScript.sqf"};
	positionAnchorWater[] = {{1, 1}};

	// The lists of gameplay challenges of the Mobility Range
	// Mainly defines what hints are shown, but does not place the actual obstacle object!
	obstacleSets[] =
	{
		{
			/*
				Array format:
				0 - challenge XY-coordinates - Array
				1 - azimuth in degrees - Scalar
				2 - completion trigger area width in meters - Scalar
				3 - completion trigger area height in meters - Scalar
				4 - challenge type ID - Scalar
					0: Start
					1: Small humps
					2: Small alternating humps
					3: Ramp
					4: Checkpoint
					5: Large humps
					6: Large alternating humps
					7: Waypoint
					8: Mount
					9: Finish
					10: Chicane
					11: Slalom
				5 - hint to override default - String
			*/
			{{1, 1}, 90, 3, 2, 0, ""}, // First challenge
			{{2, 2}, 180, 4, 1.5, 9, "Hello world!"} // Second challenge
		}
	};

	// Like above, but for water vehicles
	obstacleSetsWater[] =
	{
		{
			{...},
			{...}
		}
	};

	// It's possible to have flaming, rolling barrels be triggered while clearing the range.
	positionRollingBarrels[] = {{1, 1}}; // XY-coordinate sets where the barrels start
	directionRollingBarrels[] = {90}; // Azimuths in degrees used to push the barrels towards
	positionTriggerRollingBarrels[] = {{2, 2}}; // XY-coordinate sets for the triggers for the barrels
	radiusTriggerRollingBarrels[] = {10}; // Radii for the above triggers

	// You may enable oncoming traffic on the range, which create a moving obstacle.
	positionOncomingTraffic[] = {{1, 1}}; // XY-coordinate sets where the vehicles are spawned
	directionOncomingTraffic[] = {90}; // Azimuths in degrees of the spawned vehicles
	// Sets of waypoints the vehicles will drive along
	waypointsOncomingTraffic[] =
	{
		{
			{1, 1},
			{2, 2}
		}
	};
	positionTriggerOncomingTraffic[] = {{2, 2}}; // XY-coordinate sets for the triggers for the traffic
	radiusTriggerOncomingTraffic[] = {10}; // Radii for the above triggers
};

KillHouse

Only enabled when explicitly enabled

Each world may define one or more Kill Houses. All properties defined as first element in the Arrays correspond to other properties defined as first element in those Arrays.
class KillHouse
{
	// Kill House properties for infantry with man-portable weapons
	class Small
	{
		positionStart[] = {{1, 1}}; // Player spawn XY-coordinate sets
		directionStart[] = {90}; // Player spawn azimuths in degrees
		positionEnd[] = {{2, 2}}; // Final waypoint XY-coordinate sets

		// These scripts are called as function and should return an Array with a [[Dynamic_Object_Compositions|DynO]] object composition.
		// These are the extra objects, such as wrecks, barrels, crates, etc.
		objectSet[] = {"myDynoScript.sqf"};
		positionAnchor[] = {{1, 1}}; // XY-coordinate sets where the DynO sets are spawned (using azimuth 0)

		// Waypoint sets through the Kill House as XY-coordinate sets
		waypoints[] =
		{
			{
				{1, 1},
				{2, 2}
			}
		};

		// Sets of targets placed throughout the Kill House
		class Targets
		{
			class TargetSet1
			{
				class Target1
				{
					// Target type:
					// 	0: static
					// 	1: moving
					type = 1;
					position[] = {1, 1}; // Target position
					direction = 90; // Target azimuth in degrees
					upTime = 4; // How long does the target remain popped up?
					positionMove[] = {2, 2}; // In case of a moving target: where to move to?
					moveTime = 8; // In case of a moving target: how long will it take to move in seconds?
					// Target side:
					// 	0: enemy to the player
					// 	1: civilian
					// 	2: a 50% chance for one or the other
					side = 0;
					// Target size:
					// 	0: small (infantry)
					// 	1: large (vehicle)
					size = 0;
					// Target spawn condition:
					// 	0: always spawn
					// 	1: a 50% chance to spawn
					spawn = 0;
					positionTrigger[] = {3, 3}; // XY-coordinate of the trigger to activate the target
					radiusTrigger = 10; // Radius of the above trigger
				};
				...
			};
		};
	};

	// Like above, but for vehicles
	class Large
	{
		...
	};

	// Like above, but for water vehicles
	class Water
	{
		...
	};
};