ARMA 3 - MISSION EDITING & SCRIPTING Arma 3 Loadout - addaction
Arma 3 Loadout - addaction
Quelle: Gametwitter.de Forum | views: 1744

Es gibt mehrere Arten, wie man Spielern das gewünschte Loadout zukommen lassen kann. Eine Variante ist, zb. über eine Ammobox, einem Spieler die Auswahl zu lassen wäre per "addaction".

Zunächst kann/sollte man den Boxinhalt, welcher in der Regel standardmäßig vorhanden ist, entfernen.

Daher kommt in die "Init" Zeile der Box folgende Befehlsreihe :

clearweaponcargoGlobal this;
clearmagazinecargoGlobal this;
clearitemcargoGlobal this;
clearBackpackCargoGlobal this;

Gefolgt von dem eigentlichem Auswahlmenu:

"this distance cursortarget < 5" - diese Zeile ist die Eingrenzung der Zugriffsreichweite zur Box. Dh. der Spieler muss unter 5m an der Box sein, bevor der Zugriff auf das Menu erfolgen kann.

this addaction ["<t color='#ff6600'>Grenadier</t>","US_Grenadier.sqf", "", 0, true, true, "", "this distance cursortarget < 5"];

this addaction ["t color='#ff6600'>Breacher</t>","US_Breacher.sqf", "", 0, true, true, "", "_this distance cursortarget < 5"];

this addaction ["<t color='#ff6600'>Medic</t>","US_Medic.sqf", "", 0, true, true, "", "_this distance cursortarget < 5"];

this addaction ["<t color='#ff6600'>Pionier</t>","US_Pionier.sqf", "", 0, true, true, "", "_this distance cursortarget < 5"];

this addaction ["<t color='#ff6600'>Rifleman</t>","US_Rifleman.sqf", "", 0, true, true, "", "_this distance cursortarget < 5"];

Der Inhalt der US_Grenadier.sqf kann zb so aussehen:

(Der hier aufgezeigte Inhalt entspricht einem Export aus dem Arsenal. Hier muss nur das "this" durch Player ersetzt werden. Fertig :) )

comment "Remove existing items";

removeAllWeapons player;

removeAllItems player;

removeAllAssignedItems player;

removeUniform player;

removeVest player;

removeBackpack player;

removeHeadgear player;

removeGoggles player;

comment "Add containers";

player forceAddUniform "U_mas_usl_B_CombatUniform_aor1";

player addItemToUniform "ACE_MapTools";

for "_i" from 1 to 5 do {player addItemToUniform "rhs_mag_30Rnd_556x45_M855A1_Stanag";};

for "_i" from 1 to 2 do {player addItemToUniform "HandGrenade";};

for "_i" from 1 to 2 do {player addItemToUniform "SmokeShell";};

player addItemToUniform "ACE_M84";

player addVest "V_mas_usl_PlateCarrierLR_aor1";

player addItemToVest "ACRE_SEM52SL";

player addItemToVest "ACE_EarPlugs";

player addItemToVest "ACE_MapTools";

for "_i" from 1 to 5 do {player addItemToVest "ACE_CableTie";};

player addItemToVest "ACE_IR_Strobe_Item";

player addItemToVest "ACE_Flashlight_MX991";

player addItemToVest "ACE_HuntIR_monitor";

for "_i" from 1 to 7 do {player addItemToVest "rhs_mag_30Rnd_556x45_M855A1_Stanag";};

for "_i" from 1 to 4 do {player addItemToVest "30Rnd_9x21_Mag";};

for "_i" from 1 to 4 do {player addItemToVest "ACE_HuntIR_M203";};

for "_i" from 1 to 2 do {player addItemToVest "UGL_FlareRed_F";};

for "_i" from 1 to 2 do {player addItemToVest "UGL_FlareYellow_F";};

for "_i" from 1 to 10 do {player addItemToVest "1Rnd_HE_Grenade_shell";};

player addBackpack "B_AssaultPack_cbr";

for "_i" from 1 to 4 do {player addItemToBackpack "ACE_tourniquet";};

for "_i" from 1 to 7 do {player addItemToBackpack "ACE_fieldDressing";};

for "_i" from 1 to 7 do {player addItemToBackpack "ACE_elasticBandage";};

player addItemToBackpack "ACE_bloodIV_500";

for "_i" from 1 to 5 do {player addItemToBackpack "ACE_morphine";};

for "_i" from 1 to 7 do {player addItemToBackpack "ACE_packingBandage";};

player addItemToBackpack "ACE_personalAidKit";

for "_i" from 1 to 7 do {player addItemToBackpack "ACE_quikclot";};

player addHeadgear "H_mas_usl_opscore";

player addGoggles "G_mas_usl_beard_mask";

comment "Add weapons";

player addWeapon "rhs_weap_m4a1_m203s";

player addPrimaryWeaponItem "rhsusf_acc_nt4_black";

player addPrimaryWeaponItem "acc_pointer_IR";

player addPrimaryWeaponItem "rhsusf_acc_su230_mrds";

player addWeapon "hgun_mas_usl_P226_F";

player addHandgunItem "muzzle_snds_L";

player addWeapon "Rangefinder";

comment "Add items";

player linkItem "ItemMap";

player linkItem "ItemCompass";

player linkItem "ItemWatch";

player linkItem "ItemGPS";

player linkItem "O_NVGoggles_hex_F";

Eine Kommentarfunktion ist in diesem Blog nicht vorgesehen.
Bei Problemen zum Skript bitte im Gametwitter.de Forum registieren und dort die Kommentarfunktion nutzen.