Posted: . At: 10:47 AM. This was 6 years ago. Post ID: 12629
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Arma 3 scripting tricks and samples for making missions.


Detect if a player has the APEX DLC.

if (395180 in getDLCs 1) then {
	(_this select 0) ctrlsettext '\a3\Ui_f\Data\Logos\arma3apex_white_ca.paa';
};

Remove all NVG goggles and weapons from enemies.

{ if (side _x == east) then {
	_x unassignItem "NVGoggles";
	_x removeItem "NVGoggles";
	removeallweapons _x;
};
} foreach allunits;

Spawn a nice sandbagged area with a few static guns emplaced within. This is good for spawning a defense area in an enemy controlled zone.

ammoDump1 = [
	["Box_East_AmmoVeh_F",[-2.25195,-0.769531,0.00384521],0,1,0,[0,4.00412],"","",true,false], 
	["rhsgref_ins_d30_at",[2.61914,-1.96875,-0.0791016],103.55,1,0,[0,-0],"gun1","",true,false], 
	["LOP_ChDKZ_Kord_High",[-2.87695,-3.26563,-0.0471039],229.616,1,0,[0,0],"gun2","",true,false], 
	["LOP_ISTS_OPF_Static_M2",[-3.6582,2.3457,-0.032547],280.468,1,0,[0,0],"gun3","",true,false], 
	["rhs_casing_105mm_m14b1",[3.30664,3.91406,0.000259399],0,1,0,[0,4.00412],"","this enablesimulation false; this allowdamage false",true,false], 
	["rhs_casing_105mm_m14b1",[3.60156,3.72656,0.000259399],307.807,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_fort_bagfence_round",[-5.92383,2.40234,0.0745544],282.973,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false], 
	["rhs_casing_105mm_m14b1",[3.62891,4.00195,0.000259399],90.5116,1,0,[0,-0],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_fort_bagfence_round",[-4.76953,-4.42578,0.0652313],238.231,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_fort_bagfence_round",[-0.291016,6.91992,0.000549316],0,1,0,[0,4.00412],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_fort_bagfence_round",[6.14258,4.02344,-0.0526733],48.1463,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false], 
	["LOP_ChDKZ_Static_DSHKM",[1.01758,-7.18555,-0.0712433],190.637,1,0,[0,0],"gun4","",true,false], 
	["Land_fort_bagfence_round",[0.294922,-8.75391,0.0315399],203.912,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false]
];
 
_hqdef400 = [Loc, 95, 400, 10, 0, 0.5, 0] call BIS_fnc_findSafePos;
 
gunz = [_hqdef400, 59.016, ammoDump1 ] call BIS_fnc_objectsMapper;
 
_randPos333 = [Loc, 1, 60, 3, 0, 20, 0] call BIS_fnc_findSafePos;
_mgguys = [_hqdef400, EAST, (configfile >> "CfgGroups" >> "East" >> "LOP_AM_OPF" >> "Infantry" >> "LOP_AM_OPF_Fireteam")] call BIS_fnc_spawnGroup;
((units _mgguys) select 0) moveInGunner gun1;
((units _mgguys) select 1) moveInGunner gun2;
((units _mgguys) select 2) moveInGunner gun3;
((units _mgguys) select 3) moveInGunner gun4;
 
_mgguys enableDynamicSimulation true;

This code will spawn an ammo dump that players can find. A nice addition to any mission.

/*
Spawning an ammo dump for my mission.
*/
 
dump = [
	["rhs_gear_crate",[-0.294922,-1.72351,0.00012207],0,1,0,[0,1.14586],"","",true,false], 
	["rhs_spec_weapons_crate",[-2.00195,0.374512,0.000171661],0,1,0,[0,1.14586],"","",true,false], 
	["rhs_weapon_crate",[-2.13086,2.54956,0.000146866],0,1,0,[0,1.14586],"","",true,false], 
	["Land_Fort_Watchtower_EP1",[-4.29102,1.52875,0.015089],90,1,0,[-1.14586,-5.00938e-008],"TowerAM","this enablesimulation false; this allowdamage false",true,false], 
	["rhs_mags_crate",[-4.69922,-1.88733,0.00012207],0,1,0,[0,1.14586],"","",true,false], 
	["Land_HBarrier_5_F",[2.4043,5.63043,-0.044651],177.693,1,0,[-0.0461225,-1.14493],"","",true,false], 
	["Land_HBarrier_5_F",[-1.08594,-5.66327,0.0450687],357.499,1,0,[0.050009,1.14477],"","",true,false], 
	["rhs_7ya37_1_single",[-5.30664,2.74084,7.24792e-005],0,1,0,[0,1.14586],"","",true,false], 
	["ACE_Box_Misc",[-6.14063,1.65009,0.00012207],0,1,0,[0,1.14586],"","",true,false], 
	["rhs_3Ya40_1_single",[-6.26758,2.81146,2.47955e-005],0,1,0,[0,1.14586],"","",true,false], 
	["Land_Cargo_Patrol_V2_F",[4.96484,-2.63208,0],0,1,0,[0,0],"","this enablesimulation false; this allowdamage false",true,false], 
	["rhs_launcher_crate",[-6.98242,-2.1958,0.000171661],0,1,0,[0,1.14586],"","",true,false], 
	["Land_HBarrier_5_F",[-3.19141,5.40582,-0.0446529],177.693,1,0,[-0.0461225,-1.14493],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[7.8457,5.91754,-0.0446491],177.693,1,0,[-0.0461225,-1.14493],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[4.54688,-5.48285,0.0450687],357.499,1,0,[0.050009,1.14477],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[8.97266,-3.86713,0.00117302],271.404,1,0,[1.14552,0.0280716],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[-9.51563,-6.01923,0.0450687],357.499,1,0,[0.050009,1.14477],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[-9.35938,-4.67847,0.00117302],271.404,1,0,[1.14552,0.0280716],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[-9.16211,0.92981,0.00117302],271.404,1,0,[1.14552,0.0280716],"","this enablesimulation false; this allowdamage false",true,false], 
	["Land_HBarrier_5_F",[9.16992,1.74115,0.00117302],271.404,1,0,[1.14552,0.0280716],"","this enablesimulation false; this allowdamage false",true,false]
];
 
_mrk = "aoCircle";
_area = markerSize _mrk;
_nul = _area pushBack markerDir _mrk;
_nul = _area pushBack ( markerShape _mrk isEqualTo "Ellipse" );
_pos = [ _mrk, _area ] call BIS_fnc_randomPosTrigger;
_randPos123 = [_pos, 15, 30, 10, 0, 0.5, 0] call BIS_fnc_findSafePos;
 
sleep 1;
 
[_randPos123, 59.016, dump ] call BIS_fnc_objectsMapper;
 
"Sector2" setMarkerPos _randPos123;
"Sector2" setMarkerText "Ammo Dump.";
 
sleep 3;
 
_garrisonAmmo = [_randPos123,100] call KER_fnc_garrisonEAST;

How to add an option to the player`s ACE3 interaction menu to enable them to get help with ace features, or to run any other code.

// Adding an action to Ace3 to get help with ace features.
 
myaction = ['Help dialog','Mission Help','',{null = [] spawn KER_fnc_help;},{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], myaction] call ace_interact_menu_fnc_addActionToObject;

This is one very useful scripting sample, this would allow a player to run code that shows a help dialog, or anything you wish.

Put this code into the initServer.sqf file to make AAF forces enemies of BLUFOR.

Resistance setFriend [East, 1];
East setFriend [Resistance, 1];

Spawn some trees as simple objects in your mission.

//spawn coral in the editor.
_posnew14 = [11527.8,17800.4,0];
_sol15 = createSimpleObject ["a3\plants_f\Bush\bw_SetBig_Brains_F.p3d", _posnew14]; 
_sol15 setPos [_posnew14 select 0, _posnew14 select 1, 0.7];
 
// Spawn a tree.
_pos2 = [11642.7,17828.9,0]; 	//define a position, close to player
_tree2 = createSimpleObject ["a3\plants_f\Tree\t_BroussonetiaP1s_F.p3d", _pos2];
_tree2 setPos [_pos2 select 0, _pos2 select 1,7];	//trees spawn below ground, so we move it up by 8 m
 
// Spawn a tree.
_pos3 = [11638.9,17782.6,-3.05176e-005]; 	//define a position, close to player
_tree2 = createSimpleObject ["a3\plants_f\Tree\t_FraxinusAV2s_F.p3d", _pos3];
_tree2 setPos [_pos3 select 0, _pos3 select 1,7];	//trees spawn below ground, so we move it up by 8 m
 
_pos = [12168.7,17343.1,0]; 	//define a position, close to player
_tree = createSimpleObject ["a3\plants_f\Tree\t_QuercusIR2s_F.p3d", _pos]; 
_tree setPos [_pos select 0, _pos select 1,19];	//trees spawn below ground, so we move it up by 8 m

1 thought on “Arma 3 scripting tricks and samples for making missions.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.