gustavoalvares
Member-
Content Count
9 -
Joined
-
Last visited
-
Medals
Community Reputation
1 NeutralAbout gustavoalvares
-
Rank
Private
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
script Help with trigger script
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@sarogahtyp Thanks man! -
gustavoalvares started following [Release] Simple Weapon Shop System, Help with trigger script and Help with Custom Loadout
-
script Help with trigger script
gustavoalvares posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Guys, good afternoon! (or good night or good morning :]) I have a question about how I can create a script to activate a trigger to spawn a group of enemies. I believe that to activate the trigger I have to use this script: private _trigger1 = createTrigger ["EmptyDetector", _triggerMarker]; _trigger1 setTriggerActivation ["east", "not present", false]; _trigger1 setTriggerStatements [_opfor1 = [getMarkerPos _spawnTes1, EAST, _opfor1] call BIS_fnc_spawnGroup]; _trigger1 setTriggerTimeout [10,10,10]; However I would like this group of enemies to be deleted when the player leaves the area... I keep in mind that for that I would have to use the script "this && !(player in thisList) deletVehicle _opfor1" but I don't know where I would put it this command since I didn't find anything about something like "setDeactivation". Does anyone have any idea how I could do this? I appreciate the help! -
Help with Custom Loadout
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@beno_83au thanks a lot man, i'll try it this way too. -
Help with Custom Loadout
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Smart Games the way you did it I hadn't seen it yet, but it made it much clearer as to how to set up the script. I will replace and test, thank you very much!! -
Help with Custom Loadout
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For ammunition I had the idea to use the script in this example that serves to spawn weapons on the ground. That way it works, the weapons spawn with the ammo on the ground too, but I don't know why it doesn't add to the NPCs. Here's the script: _markerPos = getMarkerPos "lootMilitary"; _chance_house = 25; _max_positions = 2; _house_radius = 500; _box_classname = "GroundWeaponHolder"; _max_magazines = 3; _weaponArray = [ "arifle_MX_F", "arifle_Katiba_F", "hgun_Rook40_F", "hgun_ACPC2_snds_F", "srifle_DMR_01_F", "hgun_PDW2000_F", "SMG_01_F", "arifle_MX_khk_F", "hgun_P07_khk_F", "arifle_AK12_F", "arifle_AKM_F", "srifle_DMR_07_blk_F", "LMG_Mk200_F", "LMG_Zafir_F" ]; _itemBoxArray = []; _houseArray = (_markerPos nearObjects ["house", _house_radius]) select {random 100 < _chance_house}; { _buildingPositions = [_x, (random ceil _max_positions)] call BIS_fnc_buildingPositions; { _weapon = _weaponArray select (floor (random (count _weaponArray))); _itemBox = _box_classname createVehicle [0,0,0]; _itemBox setPos _x; _itemBox addWeaponCargoGlobal [_weapon,1]; _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); _mag = _magazines select (floor (random (count _magazines))); _itemBox addMagazineCargoGlobal [_mag, (ceil random _max_magazines)]; _itemBoxArray = _itemBoxArray + [_itemBox]; } forEach _buildingPositions; } forEach _houseArray; -
Help with Custom Loadout
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Smart Games I think I understand, I should start the {...} forEach right at the beginning of the script where the weapons are, it would look like this: // Loadout { _weaponPrimary = selectRandom [ "arifle_MX_F", "arifle_Katiba_F", "srifle_DMR_01_F", "SMG_01_F", "arifle_MX_khk_F", "arifle_AK12_F", "arifle_AKM_F", "srifle_DMR_07_blk_F", "LMG_Mk200_F", "LMG_Zafir_F" ]; _weaponSecondary = selectRandom [ "hgun_Rook40_F", "hgun_ACPC2_snds_F", "hgun_PDW2000_F", "hgun_P07_khk_F" ]; _magazinePrimary = getArray (configFile >> "CfgWeapons" >> _weaponPrimary >> "magazines"); _magazineSecondary = getArray (configFile >> "CfgWeapons" >> _weaponSecondary >> "magazines"); removeAllWeapons _x; removeAllItems _x; removeAllAssignedItems _x; removeUniform _x; removeVest _x; removeBackpack _x; removeHeadgear _x; removeGoggles _x; _x removeItem "NVGoggles"; _x unassignItem "NVGoggles"; _x addWeapon _weaponPrimary; _x addPrimaryWeaponItem (selectRandom ["","","optic_Yorris","optic_MRD","CUP_optic_Kobra","optic_Aco","optic_ACO_grn","optic_Aco_smg","optic_ACO_grn_smg","CUP_optic_SB_11_4x20_PM","optic_Holosight","optic_Holosight_smg","optic_Arco","optic_Hamr","optic_Arco_AK_blk_F","optic_Arco_blk_F","optic_ERCO_blk_F","optic_MRCO","CUP_optic_PechenegScope","CUP_optic_PSO_1","CUP_optic_PSO_1_AK","optic_DMS","optic_SOS","CUP_optic_LeupoldMk4","optic_AMS","optic_KHS_blk","CUP_optic_PSO_1_1","CUP_optic_PSO_3"]); _x addPrimaryWeaponItem (selectRandom ["","","acc_flashlight","acc_flashlight_smg_01","acc_flashlight_pistol","CUP_acc_ANPEQ_15_Black","acc_pointer_IR","muzzle_snds_L","CUP_muzzle_snds_MicroUzi","muzzle_snds_M","CUP_muzzle_snds_KZRZP_AK545","muzzle_snds_H","CUP_muzzle_snds_KZRZP_AK762","muzzle_snds_B","CUP_muzzle_snds_KZRZP_SVD","CUP_muzzle_snds_SCAR_H","muzzle_snds_338_black","CUP_muzzle_snds_AWM","bipod_01_F_blk","bipod_02_F_blk","bipod_03_F_blk","bipod_02_F_lush","CUP_optic_ekp_8_02"]); //_x enableGunLights "forceOn"; _x addWeapon _weaponSecondary; _x forceAddUniform (selectRandom ["U_O_R_Gorka_01_camo_F","U_O_R_Gorka_01_black_F","U_O_R_Gorka_01_brown_F","U_O_R_Gorka_01_camo_F"]); //for "_i" from 1 to 4 do {_x addItemToUniform _magazinePrimary}; //for "_i" from 1 to 4 do {_x addItemToUniform _magazineSecondary}; _x addVest (selectRandom ["","V_Rangemaster_belt","V_BandollierB_blk","V_HarnessOSpec_gry","V_TacVest_blk_POLICE","V_Press_F","V_PlateCarrierIA1_dgtl","V_PlateCarrier1_rgr","V_PlateCarrier2_blk","V_SmershVest_01_F","V_Chestrig_khk","V_TacVest_oli","V_TacChestrig_oli_F","V_HarnessOGL_ghex_F"]); for "_i" from 1 to 4 do {_x addItemToUniform _magazinePrimary}; for "_i" from 1 to 4 do {_x addItemToVest _magazineSecondary}; _x addBackpack (selectRandom ["","","B_AssaultPack_blk","B_Bergen_blk","B_Carryall_oucamo","B_FieldPack_oucamo","B_Kitbag_rgr_Exp","B_AssaultPack_mcamo_AA"]); for "_i" from 1 to 4 do {_x addItemToBackpack _magazinePrimary}; for "_i" from 1 to 4 do {_x addItemToBackpack _magazineSecondary}; //_x addHeadgear ""; //_x addGoggles ""; _x linkItem "ItemMap"; _x linkItem "ItemCompass"; _x linkItem "ItemWatch"; _x linkItem "ItemRadio"; //_x linkItem "ItemGPS"; }forEach (units _group1); -
Help with Custom Loadout
gustavoalvares replied to gustavoalvares's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Casio91Fin Thanks, I'll make these changes and see if it works. -
Good morning guys (or good afternoon or good night)! I'm trying to create my first mission using scripts to spawn enemies, but I would like to make them spawn with random weapons and equipment. I looked in a few places for some references I could use and came up with this script I'm working on. However, I am having two problems with the script. The first is that enemies are spawning with the same weapons instead of random weapons. The second is that when they spawn they don't have ammo. Can anyone tell me what I'm doing wrong in the script and how can I fix it? Here's the script I'm using: private ["_group1","_spawnTes4","_weaponPrimary","_weaponSecondary","_magazinePrimary","_magazineSecondary"]; // Group 1 _group1 = ["CUP_O_RU_Soldier_TL_M_EMR","CUP_O_RU_Soldier_M_EMR","CUP_O_RU_Soldier_M_EMR","CUP_O_RU_Crew_M_EMR","CUP_O_RU_Medic_M_EMR","CUP_O_RU_Soldier_AR_M_EMR","CUP_O_RU_Soldier_Marksman_M_EMR"]; _spawnTes4 = "spawn4"; _group1 = [getMarkerPos _spawnTes4, EAST, _group1] call BIS_fnc_spawnGroup; [_group1, getMarkerpos "spawn3"] call BIS_fnc_taskDefend; _group1 setBehaviour (["STEALTH","SAFE"] call BIS_fnc_selectRandom); // Skill { _x setSkill ["spotDistance",0.8]; _x setSkill ["aimingShake",0.6]; _x setSkill ["spotTime",0.65]; } forEach (units _group1); _group1 allowFleeing 0; // Loadout _weaponPrimary = selectRandom [ "arifle_MX_F", "arifle_Katiba_F", "srifle_DMR_01_F", "SMG_01_F", "arifle_MX_khk_F", "arifle_AK12_F", "arifle_AKM_F", "srifle_DMR_07_blk_F", "LMG_Mk200_F", "LMG_Zafir_F" ]; _weaponSecondary = selectRandom [ "hgun_Rook40_F", "hgun_ACPC2_snds_F", "hgun_PDW2000_F", "hgun_P07_khk_F" ]; _magazinePrimary = getArray (configFile >> "CfgWeapons" >> _weaponPrimary >> "magazines"); _magazineSecondary = getArray (configFile >> "CfgWeapons" >> _weaponSecondary >> "magazines"); { removeAllWeapons _x; removeAllItems _x; removeAllAssignedItems _x; removeUniform _x; removeVest _x; removeBackpack _x; removeHeadgear _x; removeGoggles _x; _x removeItem "NVGoggles"; _x unassignItem "NVGoggles"; _x addWeapon _weaponPrimary; _x addPrimaryWeaponItem (selectRandom ["","","optic_Yorris","optic_MRD","CUP_optic_Kobra","optic_Aco","optic_ACO_grn","optic_Aco_smg","optic_ACO_grn_smg","CUP_optic_SB_11_4x20_PM","optic_Holosight","optic_Holosight_smg","optic_Arco","optic_Hamr","optic_Arco_AK_blk_F","optic_Arco_blk_F","optic_ERCO_blk_F","optic_MRCO","CUP_optic_PechenegScope","CUP_optic_PSO_1","CUP_optic_PSO_1_AK","optic_DMS","optic_SOS","CUP_optic_LeupoldMk4","optic_AMS","optic_KHS_blk","CUP_optic_PSO_1_1","CUP_optic_PSO_3"]); _x addPrimaryWeaponItem (selectRandom ["","","acc_flashlight","acc_flashlight_smg_01","acc_flashlight_pistol","CUP_acc_ANPEQ_15_Black","acc_pointer_IR","muzzle_snds_L","CUP_muzzle_snds_MicroUzi","muzzle_snds_M","CUP_muzzle_snds_KZRZP_AK545","muzzle_snds_H","CUP_muzzle_snds_KZRZP_AK762","muzzle_snds_B","CUP_muzzle_snds_KZRZP_SVD","CUP_muzzle_snds_SCAR_H","muzzle_snds_338_black","CUP_muzzle_snds_AWM","bipod_01_F_blk","bipod_02_F_blk","bipod_03_F_blk","bipod_02_F_lush","CUP_optic_ekp_8_02"]); //_x enableGunLights "forceOn"; _x addWeapon _weaponSecondary; _x forceAddUniform (selectRandom ["U_O_R_Gorka_01_camo_F","U_O_R_Gorka_01_black_F","U_O_R_Gorka_01_brown_F","U_O_R_Gorka_01_camo_F"]); //for "_i" from 1 to 4 do {_x addItemToUniform _magazinePrimary}; //for "_i" from 1 to 4 do {_x addItemToUniform _magazineSecondary}; _x addVest (selectRandom ["","V_Rangemaster_belt","V_BandollierB_blk","V_HarnessOSpec_gry","V_TacVest_blk_POLICE","V_Press_F","V_PlateCarrierIA1_dgtl","V_PlateCarrier1_rgr","V_PlateCarrier2_blk","V_SmershVest_01_F","V_Chestrig_khk","V_TacVest_oli","V_TacChestrig_oli_F","V_HarnessOGL_ghex_F"]); for "_i" from 1 to 4 do {_x addItemToUniform _magazinePrimary}; for "_i" from 1 to 4 do {_x addItemToVest _magazineSecondary}; _x addBackpack (selectRandom ["","","B_AssaultPack_blk","B_Bergen_blk","B_Carryall_oucamo","B_FieldPack_oucamo","B_Kitbag_rgr_Exp","B_AssaultPack_mcamo_AA"]); for "_i" from 1 to 4 do {_x addItemToBackpack _magazinePrimary}; for "_i" from 1 to 4 do {_x addItemToBackpack _magazineSecondary}; //_x addHeadgear ""; //_x addGoggles ""; _x linkItem "ItemMap"; _x linkItem "ItemCompass"; _x linkItem "ItemWatch"; _x linkItem "ItemRadio"; //_x linkItem "ItemGPS"; }forEach (units _group1); I tried using the BIS_fnc_addWeapon function and it worked for random weapons, but it didn't work for ammo, here's the example I used: [_x, (selectRandom [ "arifle_MX_F","arifle_Katiba_F","srifle_DMR_01_F","SMG_01_F","arifle_MX_khk_F","arifle_AK12_F","arifle_AKM_F","srifle_DMR_07_blk_F","LMG_Mk200_F","LMG_Zafir_F",3])] call BIS_fnc_addWeapon;
-
[Release] Simple Weapon Shop System
gustavoalvares replied to hoverguy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Incredible these scripts! It helped a lot in the creation of scenarios. I have only one doubt, when I start the scenario, the character starts with the "random" equipment ... any idea of what I may be missing or how to fix this?