Construction Interface (COIN) Presets
Contents |
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
| Category | Object | Cost |
|---|---|---|
| Barriers | Fort_RazorWire | 300 |
| Barriers | Hedgehog | 100 |
| Barriers | Hhedgehog_concrete | 300 |
| Barriers | Hhedgehog_concreteBig | 300 |
| Barriers | Fort_Barricade | 500 |
| Sandbags | Land_BagFenceCorner | 100 |
| Sandbags | Land_BagFenceEnd | 100 |
| Sandbags | Land_BagFenceShort | 100 |
| Sandbags | Land_BagFenceLong | 300 |
| Sandbags | Land_BagFenceRound | 300 |
| Sandbags | Land_fort_bagfence_long | 300 |
| Sandbags | Land_fort_bagfence_corner | 300 |
| Sandbags | Land_fort_bagfence_round | 500 |
| HESCO | Land_HBarrier1 | 100 |
| HESCO | Land_HBarrier3 | 300 |
| HESCO | Land_HBarrier5 | 500 |
| HESCO | Land_HBarrier_large | 1000 |
| Bunkers | Land_fortified_nest_small | 500 |
| Bunkers | Land_fortified_nest_big | 1000 |
| Bunkers | Land_Fort_Watchtower | 1000 |
| Ramparts | Fort_EnvelopeSmall | 100 |
| Ramparts | Fort_EnvelopeBig | 300 |
| Ramparts | Land_fort_rampart | 1000 |
| Ramparts | Land_fort_artillery_nest | 1000 |
Option 1: USMC static weapons + option 0
Includes everything from option 0 plus:
| Category | Object | Cost |
|---|---|---|
| Weapons | SearchLight | 1000 |
| Weapons | M119 | 1000 |
| Weapons | M2HD_mini_TriPod | 1000 |
| Weapons | M2StaticMG | 1000 |
| Weapons | MK19_TriPod | 1000 |
| Weapons | Stinger_Pod | 1000 |
| Weapons | TOW_TriPod | 1000 |
Option 2: CDF static weapons + option 0
Includes everything from option 0 plus:
| Category | Object | Cost |
|---|---|---|
| Weapons | AGS_CDF | 1000 |
| Weapons | D30_CDF | 1000 |
| Weapons | DSHKM_CDF | 1000 |
| Weapons | DSHkM_Mini_TriPod_CDF | 1000 |
| Weapons | SPG9_CDF | 1000 |
| Weapons | SearchLight_CDF | 1000 |
| Weapons | ZU23_CDF | 1000 |
Option 3: Russian static weapons + option 0
Includes everything from option 0 plus:
| Category | Object | Cost |
|---|---|---|
| Weapons | AGS_RU | 1000 |
| Weapons | D30_RU | 1000 |
| Weapons | Igla_AA_pod_East | 1000 |
| Weapons | KORD | 1000 |
| Weapons | Metis | 1000 |
| Weapons | SearchLight_RUS | 1000 |
Option 4: ChDKZ static weapons + option 0
Includes everything from option 0 plus:
| Category | Object | Cost |
|---|---|---|
| Weapons | AGS_Ins | 1000 |
| Weapons | D30_Ins | 1000 |
| Weapons | DSHKM_Ins | 1000 |
| Weapons | DSHkM_Mini_TriPod | 1000 |
| Weapons | SPG9_Ins | 1000 |
| Weapons | SearchLight_INS | 1000 |
| Weapons | ZU23_Ins | 1000 |
Option 5: NAPA static weapons + option 0
Includes everything from option 0 plus:
| Category | Object | Cost |
|---|---|---|
| Weapons | DSHKM_Gue | 1000 |
| Weapons | SPG9_Gue | 1000 |
| Weapons | SearchLight_Gue | 1000 |
| Weapons | ZU23_Gue | 1000 |
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
- ViperMaul
- Norrin
- Strango
- Fer
- Special thanks to Armatec/Armaholic for their excellent illustrated library of ArmA 2 objects.
- Special thanks to MattXR for the ACE2 activation tip