Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

1164 Excellent


About beno_83au

  • Rank
    Sergeant Major

Profile Information

  • Location

Contact Methods

  • Youtube
  • Steam url id

Recent Profile Visitors

5344 profile views
  1. I would imagine that Sarogahtyp could do the same thing and show it working as he's described, so you showing a video of working code not working for you probably won't change much. I don't think there's any doubt from anyone here that you're not getting the result you want. The issue is that you're not getting that result with code that works. Try starting a fresh scenario, no mods, and just get in and see how it runs from the debug console.
  2. beno_83au

    Help with Custom Loadout

    I generally do what @Smart Games has suggested for random loadouts. Once you get it set up it's incredibly easy to move from one mission to another, or swap classnames in and out. Plus, you can apply it to any number of units, whenever you need it. The only way I do it differently is to declare all the loadouts in a separate .sqf and save them into public variable, and sometimes use predefined loadout sets. For example, below the MIL_EasterEgg is a predefined set and the rest is just like Smart Games has done (MIL_EasterEgg uses setUnitLoadout in the spawn script). opForLoadouts.sqf MIL_EasterEgg = [ ["sgun_HunterShotgun_01_sawedoff_F","","","",["2Rnd_12Gauge_Pellets",2],[],""], [], ["hgun_Pistol_heavy_02_F","","","",["6Rnd_45ACP_Cylinder",6],[],""], ["U_C_Uniform_Scientist_02_F",[["FirstAidKit",2]]], ["rhs_vest_commander",[["2Rnd_12Gauge_Pellets",4,2],["6Rnd_45ACP_Cylinder",3,6]]], ["B_CombinationUnitRespirator_01_F",[["Chemlight_blue",2,1],["Chemlight_green",2,1],["Chemlight_red",2,1],["Chemlight_yellow",2,1]]], "H_Hat_Tinfoil_F","G_Blindfold_01_white_F", [], ["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""] ]; MIL_EasterEggAvailable = true; MIL_Uniforms = ["U_OrestesBody","U_Marshal","U_C_Poor_1","U_I_C_Soldier_Bandit_2_F","U_I_C_Soldier_Bandit_5_F","U_I_C_Soldier_Bandit_3_F","U_I_C_Soldier_Para_5_F","U_C_Man_casual_6_F","U_C_Man_casual_4_F","U_C_Man_casual_5_F","U_C_E_LooterJacket_01_F","U_I_L_Uniform_01_tshirt_black_F","U_I_L_Uniform_01_tshirt_skull_F","U_I_L_Uniform_01_tshirt_sport_F","U_C_Uniform_Scientist_02_formal_F","U_O_R_Gorka_01_black_F","U_C_Mechanic_01_F"]; MIL_Webbing = ["V_TacVestIR_blk","V_Chestrig_rgr","V_HarnessO_brn","V_BandollierB_cbr","rhs_vydra_3m","rhsusf_iotv_ocp","rhsusf_mbav","rhsusf_plateframe_sapi","rhsusf_spcs_ucp","rhs_6b5_khaki","rhsgref_alice_webbing","V_LegStrapBag_olive_F","V_Rangemaster_belt","V_Press_F","V_SmershVest_01_F","V_CarrierRigKBT_01_EAF_F","rhs_6sh46","V_Pocketed_coyote_F"]; MIL_Packs = ["B_AssaultPack_blk","rhsusf_assault_eagleaiii_coy","B_FieldPack_ghex_F","B_Kitbag_rgr","B_Messenger_Gray_F","rhs_sidor","B_TacticalPack_mcamo"]; MIL_Primaries = [["rhs_weap_ak104_zenitco01_b33","rhs_acc_pgs64","rhs_30Rnd_762x39mm_polymer",true],["rhs_weap_ak105_zenitco01_b33","rhs_acc_pgs64","rhs_30Rnd_545x39_7N10_AK",true],["rhs_weap_ak74","rhs_acc_dtk1983","rhs_30Rnd_545x39_7N6M_AK",false],["rhs_weap_ak74n","rhs_acc_dtk1983","rhs_30Rnd_545x39_7N6M_AK",false],["rhs_weap_akm","rhs_acc_dtkakm","rhs_30Rnd_762x39mm_bakelite",false],["rhs_weap_akms","rhs_acc_dtkakm","rhs_30Rnd_762x39mm_bakelite",false],["rhs_weap_aks74","rhs_acc_dtk1983","rhs_30Rnd_545x39_7N6M_AK",false],["rhs_weap_aks74u","rhs_acc_dtk1983","rhs_30Rnd_545x39_7N6M_AK",false],["rhs_weap_m14_rail_wd","","rhsusf_20Rnd_762x51_m80_Mag",true],["rhs_weap_m16a4_carryhandle","","rhs_mag_30Rnd_556x45_M855A1_Stanag",false],["rhs_weap_m24sws_d","","rhsusf_5Rnd_762x51_m118_special_Mag",true],["rhs_weap_m4","","rhs_mag_30Rnd_556x45_M855A1_Stanag",true],["rhs_weap_m4a1_carryhandle","","rhs_mag_30Rnd_556x45_M855A1_Stanag",true],["rhs_weap_M590_8RD","","rhsusf_8Rnd_00Buck",false],["rhs_weap_M590_5RD","","rhsusf_5Rnd_00Buck",false],["rhsusf_weap_MP7A2_winter","","rhsusf_mag_40Rnd_46x30_FMJ",true],["rhs_weap_Izh18","","rhsgref_1Rnd_00Buck",false],["rhs_weap_kar98k","","rhsgref_5Rnd_792x57_kar98k",false],["rhs_weap_l1a1_wood","rhsgref_acc_falMuzzle_l1a1","rhs_mag_20Rnd_762x51_m80_fnfal",false],["rhs_weap_m1garand_sa43","","rhsgref_8Rnd_762x63_M2B_M1rifle",false],["rhs_weap_m3a1_specops","","rhsgref_30rnd_1143x23_M1911B_SMG",false],["rhs_weap_m70ab2","","rhs_75Rnd_762x39mm",false],["rhs_weap_m38","","rhsgref_5Rnd_762x54_m38",false],["rhs_weap_MP44","","rhsgref_30Rnd_792x33_SmE_StG",false],["rhs_weap_savz61","","rhsgref_20rnd_765x17_vz61",false],["rhs_weap_g36c","","rhssaf_30rnd_556x45_EPR_G36",true]]; MIL_PrimaryAttachments_Optic = ["rhsusf_acc_ACOG_USMC","rhsusf_acc_EOTECH","rhsusf_acc_eotech_552","rhsusf_acc_compm4","rhsusf_acc_RX01_NoFilter","rhsusf_acc_mrds","rhsusf_acc_mrds_c","rhsusf_acc_RM05","rhsusf_acc_T1_high","rhsusf_acc_T1_low","rhsusf_acc_eotech_xps3"]; MIL_PrimaryAttachments_Grip = ["rhsusf_acc_grip2","rhsusf_acc_grip1","rhsusf_acc_harris_bipod","rhsusf_acc_kac_grip","rhsusf_acc_rvg_blk","rhsusf_acc_rvg_de","rhsusf_acc_tacsac_blue","rhsusf_acc_tdstubby_blk","rhsusf_acc_grip3","rhsusf_acc_grip2","rhsusf_acc_grip1","rhsusf_acc_harris_bipod","rhsusf_acc_kac_grip","rhsusf_acc_rvg_blk","rhsusf_acc_rvg_de","rhsusf_acc_tdstubby_blk","rhsusf_acc_grip3"]; MIL_Secondaries = [["rhs_weap_6p53","rhs_18rnd_9x21mm_7N28"],["rhs_weap_pya","rhs_mag_9x19_17"],["rhs_weap_makarov_pm","rhs_mag_9x18_8_57N181S"],["rhsusf_weap_glock17g4","rhsusf_mag_17Rnd_9x19_JHP"],["rhsusf_weap_m1911a1","rhsusf_mag_7x45acp_MHP"],["rhsusf_weap_m9","rhsusf_mag_15Rnd_9x19_JHP"],["rhs_weap_savz61_folded","rhsgref_20rnd_765x17_vz61"],["rhs_weap_tt33","rhs_mag_762x25_8"],["rhs_weap_type94_new","rhs_mag_6x8mm_mhp"],["rhs_weap_cz99","rhssaf_mag_15Rnd_9x19_FMJ"]]; MIL_Torches = ["rhsusf_acc_M952V","rhsusf_acc_wmx","rhs_acc_2dpZenit_ris","acc_flashlight_pistol"]; MIL_Headgear = ["H_Bandanna_surfer","H_Beret_blk","H_Cap_blu","H_Hat_checker","H_Helmet_Skate","rhs_6b26_green","rhs_altyn_visordown","rhs_beanie_green","rhs_ssh68","rhsusf_opscore_bk","rhsusf_opscore_coy_cover","rhsusf_opscore_fg","rhsusf_opscore_mc","rhsusf_opscore_paint","rhsusf_protech_helmet","rhsgref_helmet_M1_des","rhsgref_helmet_m1940_camo01","rhsgref_hat_m43cap_heer","H_HeadBandage_stained_F","H_HeadBandage_bloody_F"]; MIL_Facewear = ["G_Bandanna_aviator","G_Bandanna_beast","G_Bandanna_blk","G_Bandanna_khk","G_Bandanna_oli","G_Bandanna_shades","G_Bandanna_sport","G_Bandanna_tan","G_AirPurifyingRespirator_02_black_F","G_AirPurifyingRespirator_02_olive_F","G_AirPurifyingRespirator_02_sand_F","G_AirPurifyingRespirator_01_F","G_RegulatorMask_F","rhs_scarf","rhsusf_shemagh2_gogg_grn","rhsusf_shemagh2_gogg_od","rhsusf_shemagh2_gogg_tan","rhsusf_shemagh2_gogg_white"]; { publicVariable _x; } forEach [ "MIL_EasterEgg", "MIL_EasterEggAvailable", "MIL_Uniforms", "MIL_Webbing", "MIL_Packs", "MIL_Primaries", "MIL_PrimaryAttachments_Optic", "MIL_PrimaryAttachments_Grip", "MIL_Secondaries", "MIL_Headgear", "MIL_Facewear" ]; paraFlag setVariable ["MIL_OpForLoadouts_Ready",true];
  3. Using the Slammer ("B_MBT_01_TUSK_F") as the example, the gunner's coax ("LMG_coax") and commander's gun ("HMG_127_MBT") both have their reloadTime values at 0.25 seconds, but in reality fire at a higher RoF than that. Can anyone explain why that is? I can't determine if there are any other values that are affecting the rates of fire or timing between shots. Edit: I did include some rough testing with the main cannon, but a more "scientific" process proved my rough testing wrong (while proving the machine gun results correct). Also tried on the AMV-7 gun ("autocannon_40mm_CTWS") which has a reloadTime of 0.3 and fired pretty close to that, which doesn't add much to the question though...... Cheers.
  4. beno_83au

    Issue with script

    Ok, one last shot. https://community.bistudio.com/wiki/selectRandom is how you use selectRandom, not the way you have here. So, like before, you have to check the commands to see how to use them. Otherwise you will keep making the same mistakes and keep getting nowhere: _sup = selectRandom (allUnits select {side _x == EAST}); systemChat str _sup;
  5. beno_83au

    Issue with script

    It can take a while to wrap your head around some of the different concepts. This is especially true if, like me, you were starting from scratch as someone without any experience in this. And speaking from experience, the best thing you can do is break everything down into it's individual parts and make each step work on it's own, while at the same time understating why it works, generally through relying heavily on the biki. When figuring commands out it's not a bad idea to either hint or systemChat your results: systemChat str (selectRandom (units opfor)); It's a basic one, but apply the idea to the commands you don't understand, or when you get weird results. Maybe even "opfor" turns out to be wrong? Then you check that. Moving on from that method (and only a little more advanced) is the use of the diag_log command. So at the end of the day if A, B, C and D are not working, get A working first. I swear this is only the second edit I've made to this post. But it should also be mentioned that bald people should avoid trying to script the AI, because you'll usually need that hair for pulling it out.
  6. beno_83au

    Issue with script

    Was writing, but pierre covered most of it (I was going to mention there is also selectRandomWeighted). But to reinforce the points already made, the biki should be your #1 reference point for learning how to use the commands and figuring out what is wrong. And, each time you return to the editor you can delete the rpt file to start fresh, then just search "error" and skip down until you're at the first script error.
  7. beno_83au

    Issue with script

    There's still a number of errors in that example. You should be looking at how each command and function works here: https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands https://community.bistudio.com/wiki/Category:Arma_3:_Functions For example, BIS_fnc_enemyTargets returns an array (of enemy units), which you have saved/declared as _targets. But then you try to use _targets with getPosATL which only takes on object, not an array (same idea as with doMove). So you need to work out what you're trying to achieve with that (e.g. are you trying to get just one unit's position?). But you also need to look at what the error is telling you, and you need to read the error report to be sure you get the right info. The on-screen error reports will overlap each other if there is more than one, and in the past I've been guilty of getting stuck on a problem when I didn't realise two errors were overlapping (it is not always obvious). So it's important that you check your error report for the details. And as is the case in your situation, you've only seen the error about the else statement, when there's still another error before that. That's why you check the .rpt and solve the first occurrence of any errors before moving on (as sometimes later errors are fixed when an earlier error is fixed). In the case of the else statement, you've basically written: }; else { Which is incorrect, as the error states, and proper examples are given in the above linked wiki. The exact error report can sometimes be a little misleading, as it is here (I assume), but it is pointing you to the correct area of that specific error and so looking at the command in the wiki will show you why it's throwing an error. Also, not an error, but you can declare EmemPos as a local variable (_EmemPos) throughout this script if it is not being used anywhere else. Not a biggie, but it will save on a small amount of resources if it is only declared locally to the script.
  8. beno_83au

    Issue with script

    The error is because of getPosATL _targets. You're not saving it as a variable or using it as a condition, so it doesn't make any sense. As for the error, I suspect there's more than one error happening here. From a quick glance it seems you haven't defined _targets anywhere, the previous line in question doesn't end with a ; and the following if......then check will fail because _targets isn't defined. You may need to look at your .rpt to see where things are going wrong in the first instance, and solve the issues one at a time.
  9. Yes. The event handler is added to the player and will activate any time they enter a vehicle. There is another event handler, https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetIn, that would be used if needing to add it to vehicles themselves. But your case sounds like it'll be best to use getInMan.
  10. beno_83au

    Enemy counter

    @rodrigoglowacki have you tried hintSilent?
  11. You haven't looped your script before the condition, so it'll run once when executed and that's it. But, even if it runs when the player is in the vehicle it'll loop the enableChannel command every frame, forever (while {true} do will never return false). You're better off using a GetInMan event handler though: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetInMan Then just run the enableChannel command and wait until the player isn't in the vehicle and disable it again.
  12. beno_83au

    PUID Spawning configuration

    It's been a good while since I've had my head in Exile scripts, but it sounds like it's forcing respawn when the player joins the server. If that's the case then maybe adding a Killed EH in onPlayerRespawn would work. So that the player joins, the get force respawned, then the EH adds itself...... onPlayerRespawn.sqf player addEventHandler ["Killed",{ waitUntil {lifeState player != "DEAD-RESPAWN"}; //code }]; You might need to mess around with the wait condition a little to get it right, but that should be a good start.
  13. Where there is a will, there is (almost) always a way 🙂
  14. https://community.bistudio.com/wiki/deleteAt is a good way to avoid getting the same element from an array. It'll return the removed element for you to use and remove it from the array.
  15. Something like this @Nemanjic?