Jump to content

ovibag

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About ovibag

  • Rank
    Private First Class
  1. Still doesn't seem to be working with JIP players, I've changed the isGlobal to 2 like you said. class TRGU_ModuleGear: Module_F { scope=2; displayName="Section Gear"; category="TRGU_Modules_Cat"; icon = "\TRGU_Modules\TRGU_LOGO.paa"; author="TRGU"; function="trgu_fnc_Gear"; functionPriority=1; isGlobal=2; isTriggerActivated=0; isDisposable=0; class ModuleDescription: ModuleDescription { description="Place down the module and all TRGU units will have their loadouts set to their role."; sync[]={}; }; };
  2. Awesome! I thought it would have to be an additional eventhandler, or changing when the function executes. Thanks again Larrow!
  3. Working great, mostly! Only issue is the module doesn't work for JIP players!
  4. Check out this video, seems to answer and supply the script you're after!
  5. Actually having issues getting this to work properly, doesn't seem to be randomizing the gear at all. Here is the relative code. _classDef = [ [ [ "TRGU_Zero", "B_Soldier_AR_F" ], //Classes [ "UK3CB_BAF_B_Bergen_MTP_Radio_H_A", "UK3CB_BAF_B_Bergen_MTP_Radio_H_B" ], //Backpacks [ "UK3CB_BAF_H_Mk7_Camo_A", "UK3CB_BAF_H_Mk7_Camo_B", "UK3CB_BAF_H_Mk7_Camo_C", "UK3CB_BAF_H_Mk7_Camo_D", "UK3CB_BAF_H_Mk7_Camo_E", "UK3CB_BAF_H_Mk7_Camo_F", "UK3CB_BAF_H_Mk7_Net_ESS_A", "UK3CB_BAF_H_Mk7_Camo_ESS_B", "UK3CB_BAF_H_Mk7_Camo_ESS_C", "UK3CB_BAF_H_Mk7_Scrim_A" ], //Helmets [ "UK3CB_BAF_U_CombatUniform_MTP_ShortSleeve", "UK3CB_BAF_U_CombatUniform_MTP" ] //Uniform ], [ [ "B_Officer_F" ], //Classes [ "B_AssaultPack_khk", "B_AssaultPack_rgr" ], //Backpacks [ "H_HelmetB_camo", "H_HelmetB_grass" ] //Helmets ], [ [ "B_Pilot_F" ], //Classes [ "B_O_Parachute_02_F" ], //Backpacks [ "H_PilotHelmetFighter_B", "H_PilotHelmetHeli_B" ] //Helmets ] ]; _fnc_getClassArrays = { _class = typeOf _this; { if ( _class in ( _x select 1 ) ) exitWith { removeuniform _this; removeHeadgear _this; removebackpack _this; _this addBackpackGlobal ( ( _x select 2 ) call BIS_fnc_selectRandom ); _this addHeadgear ( ( _x select 3 ) call BIS_fnc_selectRandom ); _this AddUniform ( ( _x select 4 ) call BIS_fnc_selectRandom ); }; }forEach _classDef; }; { if ( local _x ) then { switch ( typeOf _x ) do { case ("TRGU_Zero") : { _x call _fnc_getClassArrays; removeAllWeapons _x; removeAllItems _x; removeAllAssignedItems _x; removeVest _x; removeGoggles _x; for "_i" from 1 to 4 do {_x addItemToUniform "ACE_fieldDressing";}; for "_i" from 1 to 4 do {_x addItemToUniform "ACE_packingBandage";}; for "_i" from 1 to 2 do {_x addItemToUniform "ACE_quikclot";}; for "_i" from 1 to 2 do {_x addItemToUniform "ACE_elasticBandage";}; _x addItemToUniform "ACE_tourniquet"; _x addItemToUniform "ACE_morphine"; _x addItemToUniform "ACE_epinephrine"; _x addVest "UK3CB_BAF_V_Osprey_SL_D"; for "_i" from 1 to 6 do {_x addItemToVest "UK3CB_BAF_30Rnd";}; for "_i" from 1 to 2 do {_x addItemToVest "UK3CB_BAF_30Rnd_T";}; for "_i" from 1 to 2 do {_x addItemToVest "UK3CB_BAF_17Rnd_9mm";}; _x addItemToBackpack "ACE_microDAGR"; _x addItemToBackpack "ACE_IR_Strobe_Item"; _x addItemToBackpack "ACE_MapTools"; for "_i" from 1 to 4 do {_x addItemToBackpack "SmokeShellBlue";}; for "_i" from 1 to 2 do {_x addItemToBackpack "SmokeShellRed";}; _x addItemToBackpack "UK3CB_BAF_100Rnd"; _x addItemToBackpack "optic_Nightstalker"; _x addItemToBackpack "optic_NVS"; _x addItemToBackpack "UK3CB_BAF_G_Tactical_Clear"; _x addItemToBackpack "UK3CB_BAF_HMNVS"; _x addWeapon "UK3CB_BAF_L85A2_RIS"; _x addPrimaryWeaponItem "UK3CB_BAF_SFFH"; _x addPrimaryWeaponItem "UK3CB_BAF_LLM_IR_Black"; _x addPrimaryWeaponItem "RKSL_optic_LDS"; _x addWeapon "UK3CB_BAF_L131A1"; _x addWeapon "ACE_Vector"; _x linkItem "ItemMap"; _x linkItem "ItemCompass"; _x linkItem "tf_microdagr"; _x linkItem "tf_anprc152_2"; _x linkItem "ItemGPS"; };
  6. This is spot on what I meant! Absolutely perfect. Thank you very much for all the help! I think thats about everything now haha
  7. I changed lots of stuff just trying to fix the damn thing by myself, reverted back to the one you included in the example pbo (Thank you). Yeah exactly what I meant! Sorry for explaining it terribly. This worked perfectly! I tried using an eventHandler before, but I just couldn't get it to work how I wanted it to. Thanks for clearing the issue up!
  8. Still needing help with this, pulling my hair out
  9. Thanks for the help! Its basically working exactly how I need it too! Currently just working through adding all the roles that need changing >.> Is there a way to make it so it only changes their gear if the module is placed? Because its currently just working with or without the module being placed. Also is there a way to have random predefined helmets/backpacks across different unit classnames? And finally have the gear be reapplied on respawn?
  10. This worked great and there isn't an error when loading in anymore!! But the unit still doesnt have his loadout changed at all
  11. How would I go about doing that? This is the first module I've attempted to make so a bit out of my depth I think
  12. I'm trying to create a module that checks all units class names and alters their loadout if their class name is correct. I'm getting an error when loading into the game with the module placed. Any help is really appreciated! The error is [bIS_fnc_moduleExecute] Cannot execute module, error found in 'trgu_fnc_gear' Here is the config for the module class CfgPatches{ class TRGU_Modules { units[] = {"TRGU_ModuleGear"}; requiredVersion = 1.0; requiredAddons[] = {"A3_Modules_F"}; }; }; class CfgFactionClasses { class NO_CATEGORY; class TRGU_Modules_Cat: NO_CATEGORY { displayName = "TRGU Modules"; icon = "\TRGU_Modules\TRGU_LOGO.paa"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class ArgumentsBaseUnits { class Units; }; class ModuleDescription { class AnyBrain; }; }; class TRGU_ModuleGear: Module_F { scope = 2; displayName = "Section Gear"; icon = "\TRGU_Modules\TRGU_LOGO.paa"; category = "TRGU_Modules_Cat"; author = "TRGU"; function = "trgu_fnc_Gear"; functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; isDisposable = 0; curatorInfoType = "RscDisplayAttributeModuleTRGU"; class Arguments: ArgumentsBaseUnits { class Units: Units {}; }; class ModuleDescription: ModuleDescription { description = "Place down the module and all TRGU units will have their loadouts set to their role."; sync[] = {}; }; }; }; class CfgFunctions { class TRGU_Modules { class TRGU_Modules_Cat { class TRGU_fnc_gear {file = "TRGU_Modules\functions\fnc_gear.sqf"}; }; }; }; This is the fnc_gear.sqf _activate = [_this,3,true,[true]] call bis_fnc_param; _units = [_this,1,[],[[]]] call BIS_fnc_param; if (_activated) then { { if (typeof _x == "TRGU_Rfn") then { removeAllWeapons _x; removeAllItems _x; removeAllAssignedItems _x; removeUniform _x; removeVest _x; removeBackpack _x; removeHeadgear _x; removeGoggles _x; _x forceAddUniform "STKR_UBACS_ROLL"; for "_i" from 1 to 4 do {_x addItemToUniform "ACE_fielddressing";}; for "_i" from 1 to 2 do {_x addItemToUniform "ACE_elasticbandage";}; for "_i" from 1 to 1 do {_x addItemToUniform "ACE_tourniquet";}; for "_i" from 1 to 4 do {_x addItemToUniform "ACE_quikclot";}; for "_i" from 1 to 1 do {_x addItemToUniform "ACE_morphine";}; for "_i" from 1 to 4 do {_x addItemToUniform "ACE_packingBandage";}; for "_i" from 1 to 1 do {_x addItemToUniform "ACE_epinephrine";}; _x addVest "UK3CB_BAF_V_Osprey_SL_D"; for "_i" from 1 to 7 do {_x addItemToVest "UK3CB_BAF_30Rnd";}; for "_i" from 1 to 2 do {_x addItemToVest "UK3CB_BAF_30Rnd_T";}; for "_i" from 1 to 2 do {_x addItemToVest "UK3CB_BAF_17Rnd_9mm";}; for "_i" from 1 to 2 do {_x addItemToVest "HandGrenade";}; for "_i" from 1 to 6 do {_x addItemToVest "SmokeShell";}; for "_i" from 1 to 2 do {_x addItemToVest "SmokeShellYellow";}; _x addItemToVest "R3F_25Rnd_556x45_TRACER_FAMAS"; _x addItemToVest "HandGrenade"; _x addItemToVest "SmokeShell"; _x addBackpack ["UK3CB_BAF_B_Bergen_MTP_Rifleman_H_A","UK3CB_BAF_B_Bergen_MTP_Rifleman_H_B","UK3CB_BAF_B_Bergen_MTP_Rifleman_H_C"] call BIS_fnc_selectRandom; _x addHeadgear ["UK3CB_BAF_H_Mk7_Camo_D","UK3CB_BAF_H_Mk7_Net_D","UK3CB_BAF_H_Mk7_Net_CESS_D","UK3CB_BAF_H_Mk7_Scrim_D"] call BIS_fnc_selectRandom; _x addWeapon "UK3CB_BAF_L85A2_RIS"; _x addPrimaryWeaponItem "UK3CB_BAF_LLM_IR_Black"; _x addPrimaryWeaponItem "RKSL_optic_LDS"; _x addPrimaryWeaponItem "UK3CB_BAF_SFFH"; _x linkItem "ItemMap"; _x linkItem "ItemCompass"; _x linkItem "tf_microdagr"; _x linkItem "tf_rf7800str"; _x linkItem "ItemGPS"; _x linkItem "UK3CB_BAF_HMNVS"; }; } foreach allunits; }; true Any help is appreciated!
×