Posted by
ArpyClarkson on
Nov 03, 2012; 10:18pm
URL: http://kodabar-dayz-daizy-single-player-forum.163.s1.nabble.com/Construction-Manager-Script-tp841.html
Hello,
I have spent a good portion of a week trying to get this thing to work, and finally i have figured it out- so, i would like to share this so that others can use it and improve on it.
First thing first, you need this:
http://forums.bistudio.com/showthread.php?73356-Debug-Console-for-ARMA-2then, in your Arma 2 root you need to create a folder called "scripts"
now you need to make two files in that folder, coininit.sqf and coinvars.sqf
put the following in coininit.sqf (everything inside the ########s)
##########################################################
Side_MyCOIN = createCenter west;
null = [] spawn
{
deleteVehicle MyCOIN;
sleep 5;
deleteGroup group_MyCOIN;
sleep 5;
group_MyCOIN = createGroup west;
"ConstructionManager" createUnit [getPos player, group_MyCOIN, "MyCOIN = this;"];
MyCOIN synchronizeObjectsAdd [player];
null = [MyCOIN,player] execVM "\scripts\coinvars.sqf";
};
##########################################################
next place all this is coinvars.sqf (everything inside the ###########s)
##########################################################
//credit to Moach Mayhem for code and layout. I added line descriptions and items to make
//basic Base Construction and allow other to build more into this.
//Place Construction Interface(COIN) Module on Map. In its init
//put _naught = [this, player] execVM "coinvars.sqf"
//then synchronize each player to the COIN module placed on map
fieldSupplies = 5000; //set to 0 and make cost below 0 for all free
_builder = _this select 1; //player
_module = _this select 0; //this
_module setVariable ["BIS_COIN_name", "Construction"];
_module setVariable ["BIS_COIN_funds", "fieldSupplies"];
_module setVariable ["BIS_COIN_fundsdescription", "$"]; // you can use any symbol $, Euro
// your list of categories you want player to see
_module setVariable ["BIS_COIN_categories", ["Base Assets","Barriers","Light Vehicles", "Armour","Static Weapons"]];
_module setVariable ["BIS_COIN_areaSize", [100, 50]]; //distance radius around construction zone
_gearArray = [];
//Base Assets
//"CLASS","Categories","Cost","Your Desciption" ** Cost 0 = free
_gearArray set [0, ["USMC_WarfareBBarracks","Base Assets",0,"Barracks"]];
_gearArray set [1, ["Land_fortified_nest_big","Base Assets",0,"Fortified Nest"]];
_gearArray set [2, ["Land_Fortified_nest_small","Base Assets",0,"Sandbag Nest"]];
_gearArray set [3, ["MASH","Base Assets",0,"Mash Tent"]];
_gearArray set [4, ["USMC_WarfareBMGNest_M240","Base Assets",0,"MG Nest"]];
//Barriers
_gearArray set [5, ["Land_Fort_Watchtower","Barriers",0,"Fort Tower"]];
_gearArray set [6, ["Hhedgehog_concrete","Barriers",0,"Concrete Tank Barriers"]];
_gearArray set [7, ["Land_fort_bagfence_round","Barriers",0,"Sandbag Circle"]];
_gearArray set [8, ["smallbase","Barriers",0,"Small Compound"]]; //doesn't work
_gearArray set [9, ["tankDitch2_cdf","Barriers",0,"Tank Compound"]]; //doesn't work
//Armour
_gearArray set [10, ["M1A2_Tusk_MG","Armour",0,"M1A2 Tusk"]];
_gearArray set [11, ["MLRS","Armour",0,"MLRS Rocket Tank"]];
_gearArray set [12, ["M6_EP1","Armour",0,"M6 Tank"]];
_gearArray set [13, ["M2A3_EP1","Armour",0,"M2A3 TOW"]];
//Light Vehicles
_gearArray set [14, ["LAV25","Light Vehicles",0,"LAV25"]];
_gearArray set [15, ["M1126_ICV_M2_EP1","Light Vehicles",0,"Stryker M2"]];
_gearArray set [16, ["HMMWV_M2","Light Vehicles",0,"HMMWV M2"]];
_gearArray set [17, ["HMMWV_MK19","Light Vehicles",0,"HMMWV MK19"]];
//Static Weapons
_gearArray set [18, ["M119","Static Weapons",0,"M119 Canon"]];
_gearArray set [19, ["MK19_Tripod","Static Weapons",0,"MK19 Grenade Gun"]];
_gearArray set [20, ["2b14_82mm","Static Weapons",0,"82mm Mortors"]];
_module setVariable ["BIS_COIN_items", _gearArray];
#############################################################
alright, now in game use the debug menu and type the following into an exec line:
coin = [] execVM "\scripts\coininit.sqf";
wait 30 seconds and there ya go, construction.
Someone please improve on this and make this tutorial easier~