Posted: . At: 4:49 PM. This was 1 year ago. Post ID: 17596
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.


How to have an arsenal easily on a crate in an Arma 3 RHS mission.


Having an arsenal on a crate in an RHS mission is very handy. This large script placed in the initPlayerLocal.sqf will add an arsenal to all crates of a certain type. This makes it easy to add an arsenal to a few crates around a base.

initPlayerLocal.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
	[_x, 0] call rhs_fnc_virtualAmmoBoxUSA;
	//_x setObjectTextureGlobal [1, "a3\Missions_F_Oldman\Data\img\decals\science_container_co.paa"];
 
	_miscshit = [
		"ItemWatch",
		"ItemCompass",
		"ItemGPS",
		"ItemRadio",
		"ItemMap",
		"MineDetector",
		"Binocular",
		"Rangefinder",
		"Laserdesignator",
		"Medikit",
		"ToolKit",
		"B_UavTerminal",
		"ChemicalDetector_01_watch_F",
		"muzzle_antenna_02_f",
		"Item_DeconKit_01_F",
		"ChemicalDetector_01_tan_F",
		"Item_SmartPhone",
		"Item_FlashDisk",
		"Item_Keys",
		"Item_Money_stack",
		"Item_AntimalaricumVaccine"
	];
 
	_gunz = [
	"arifle_RPK12_lush_arco_snds_pointer_F",
	"arifle_RPK12_F",
	"arifle_RPK12_arid_F",
	"arifle_RPK12_lush_arco_pointer_F",
	"arifle_AK12U_lush_holo_F",
	"arifle_TRG21_ARCO_pointer_F"
	];
 
	_availableBackpacks = [
		"rhsusf_assault_eagleaiii_coy",
		"B_Kitbag_mcamo",
		"B_Kitbag_rgr_AAR",
		"B_FieldPack_oucamo_AA"
	];
 
_availableVests = [
	"Vest_V_TacVestIR_blk"
];
 
	_magazines = [
		"1Rnd_HE_Grenade_shell",
		"HandGrenade",
		"MiniGrenade",
		"SmokeShell",
		"SmokeShellRed",
		"SmokeShellGreen",
		"SmokeShellBlue",
		"Chemlight_blue",
		"Chemlight_green",
		"Chemlight_red",
		"B_IR_Grenade",
		"SatchelCharge_Remote_Mag",
		"DemoCharge_Remote_Mag",
		"75rnd_762x39_AK12_Mag_F",
		"75rnd_762x39_AK12_Lush_Mag_F",
		"75rnd_762x39_AK12_Lush_Mag_Tracer_F",
		"30Rnd_762x39_AK12_Arid_Mag_F",
		"30Rnd_762x39_AK12_Lush_Mag_Tracer_F",
		"30Rnd_762x39_AK12_Arid_Mag_F",
		"30Rnd_762x39_AK12_Arid_Mag_Tracer_F"
	];
 
	//Populate with predefined items and whatever is already in the crate
	[_x ,((backpackCargo _x) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
	[_x ,((itemCargo _x) + _miscshit + _availableVests)] call BIS_fnc_addVirtualItemCargo;
	[_x,((weaponCargo _x) + _gunz)] call BIS_fnc_addVirtualWeaponCargo;
	[_x,(magazineCargo _x + _magazines)] call BIS_fnc_addVirtualMagazineCargo;
 
} forEach (allMissionObjects "Land_CargoBox_V1_F");

Place the Cargo Net Box (Land_CargoBox_V1_F) and then disable the simulation and damage. Then load the mission and the arsenal will work. This also adds a few more weapons and accessories to the arsenal. Just edit this if you wish to add more items to the US Army Arsenal.

Add this code below as well.

initPlayerLocal.sqf
1
2
3
4
5
6
7
8
[missionnamespace,"arsenalClosed", {
	[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
	titletext ["Arsenal loadout saved.", "PLAIN DOWN"];
}] call bis_fnc_addScriptedEventhandler;
 
[missionnamespace,"arsenalOpened", {
	cuttext [format ["Welcome %1, your role is: %2.",profileNameSteam ,getText(configFile >> "CfgVehicles" >> (typeOf player) >> "displayName")],"PLAIN DOWN", 1];
}] call bis_fnc_addScriptedEventhandler;

This code will welcome the player when they open the arsenal. And save their loadout when the arsenal is closed.

Use the code below to reload the player`s arsenal. Put this in the onPlayerRespawn.sqf file.

onPlayerRespawn.sqf
1
2
 
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;

This is very easy. The code below is in the initServer.sqf file, this will enable dynamic AI skill, depending upon how many players are on the server.

initServer.sqf
1
2
3
4
5
6
7
8
// AI Skill
[
	true,
	[
		[EAST, 		0.5, 0.2, 0.8, 0.3],
		[RESISTANCE, 	0.3, 0.1, 0.5, 0.2]
	]
] call BIS_fnc_exp_camp_dynamicAISkill;

This is a very simple mission tweak.

And finally, put this code in the init.sqf. This will hide the save and load options in the arsenal if you do not wish to use them.


Leave a Comment

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