Construction Interface (COIN) Presets

From F2 EN
Jump to: navigation, search

Description

ArmA2 includes a very powerful feature called the Construction Interface (COIN) which allows a player to purchase and place objects like sandbag walls, bunkers and other structures. The Construction Interface (COIN) Presets component is a simple way to provide this functionality to a player in a mission. You can associate a COIN with a (playable) unit and quickly determine the types of object s/he can place, as well as the amount of funds available to the player. This component will also ensure that the functionality of the COIN is available wherever the player moves in the mission - but you can also disable all COINs by changing a single global variable.

Required files

All the code associated with this component is found in:

  • init.sqf
  • f\common\f_COINpresets.sqf
  • f\common\f_keyPressed.sqf

How to activate

For normal ArmA2

No special activation steps are required, see 'How to use' section below.

For ACE2

Open the file f\common\f_COINpresents.sqf and find the line:

(findDisplay 46) displaySetEventHandler ["KeyDown", "_this call F_keyPressed"];

Change it to:

(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call F_keyPressed"];

How to use

Setting a COIN's presets

In the ArmA2 editor, place an instance of the COIN module and ensure it has a name in the Name: field (such as MyCOIN).

Next, make sure the (playable) unit that you want to use the COIN also has a unique entry in its Name: field (such as MyEngineer). Note that all units in the ShackTactical Platoons have values in their Name: fields already, which you can use.

Still in the editor, synchronise the COIN module and the unit.

Open the file init.sqf and look for the code segment entitled:

// F2 - Construction Interface (COIN) Presets

Edit the following line, removing the // at the start.

// f_COINstopped = false;

Now edit the following line, removing the // at the start, and replacing COINName with the name of the COIN you placed, and UnitName with the name of the unit you want to use that COIN.

// [COINName,"UnitName",0,2500] execVM "f\common\f_COINpresets.sqf";

In the same line, change value of 0 to reflect the desired preset (see COIN preset options below). Also in the same line, change the value of 2500 to reflect the amount of funds you want to make available to the player operating this COIN.

For example, to allow the unit MyEngineer to use the COIN named MyCOIN with preset 2 and 5000 in funds, change the line to:

[MyCOIN,"MyEngineer",2,5000] execVM "f\common\f_COINpresets.sqf";

Disabling all COINs

You may want to disable all COINs configured using this component. At any time in the mission simply set the global variable f_COINstopped to true, and ensure this is broadcast on all clients. A simple way to do this is via a trigger placed in the editor, which has the following code placed in its On Act. field:

f_COINstopped = true;

Available COIN presets

Option 0: Barriers, Sandbags, HESCO, Bunkers and Ramparts

CategoryObjectCost
BarriersFort_RazorWire300
BarriersHedgehog100
BarriersHhedgehog_concrete300
BarriersHhedgehog_concreteBig300
BarriersFort_Barricade500
SandbagsLand_BagFenceCorner100
SandbagsLand_BagFenceEnd100
SandbagsLand_BagFenceShort100
SandbagsLand_BagFenceLong300
SandbagsLand_BagFenceRound300
SandbagsLand_fort_bagfence_long300
SandbagsLand_fort_bagfence_corner300
SandbagsLand_fort_bagfence_round500
HESCOLand_HBarrier1100
HESCOLand_HBarrier3300
HESCOLand_HBarrier5500
HESCOLand_HBarrier_large1000
BunkersLand_fortified_nest_small500
BunkersLand_fortified_nest_big1000
BunkersLand_Fort_Watchtower1000
RampartsFort_EnvelopeSmall100
RampartsFort_EnvelopeBig300
RampartsLand_fort_rampart1000
RampartsLand_fort_artillery_nest1000

Option 1: USMC static weapons + option 0

Includes everything from option 0 plus:

CategoryObjectCost
WeaponsSearchLight1000
WeaponsM1191000
WeaponsM2HD_mini_TriPod1000
WeaponsM2StaticMG1000
WeaponsMK19_TriPod1000
WeaponsStinger_Pod1000
WeaponsTOW_TriPod1000

Option 2: CDF static weapons + option 0

Includes everything from option 0 plus:

CategoryObjectCost
WeaponsAGS_CDF1000
WeaponsD30_CDF1000
WeaponsDSHKM_CDF1000
WeaponsDSHkM_Mini_TriPod_CDF1000
WeaponsSPG9_CDF1000
WeaponsSearchLight_CDF1000
WeaponsZU23_CDF1000

Option 3: Russian static weapons + option 0

Includes everything from option 0 plus:

CategoryObjectCost
WeaponsAGS_RU1000
WeaponsD30_RU1000
WeaponsIgla_AA_pod_East1000
WeaponsKORD1000
WeaponsMetis1000
WeaponsSearchLight_RUS1000

Option 4: ChDKZ static weapons + option 0

Includes everything from option 0 plus:

CategoryObjectCost
WeaponsAGS_Ins1000
WeaponsD30_Ins1000
WeaponsDSHKM_Ins1000
WeaponsDSHkM_Mini_TriPod1000
WeaponsSPG9_Ins1000
WeaponsSearchLight_INS1000
WeaponsZU23_Ins1000

Option 5: NAPA static weapons + option 0

Includes everything from option 0 plus:

CategoryObjectCost
WeaponsDSHKM_Gue1000
WeaponsSPG9_Gue1000
WeaponsSearchLight_Gue1000
WeaponsZU23_Gue1000

Tips

  • This component is designed to work with one COIN per unit; however, you can have more than one COIN/unit pair per mission.
  • When using the COIN remember that some objects can damage units if they come into contact with them whilst being placed.
  • When using COIN at night or in low-light conditions, nightvision is automatically enabled; you can toggle it on/off by pressing the 'N' key.

Credits