Jump to content

Cockheaven

Member
  • Content Count

    78
  • Joined

  • Last visited

  • Medals

Posts posted by Cockheaven


  1. I'm trying to find a scripting command that prohibits a curator from editing an object, similarly to how a player is not moveable, killable (END), deletable etc. by the curator. I did some looking and all I found was a command that checks weather or not an object is editable by the curator, none that explicitly restrict curator editing. While I was typing this I thought of a potential solution, I'll give it a shot later and report back code in spoiler, however if someone already has a solution or more info on this leme know!

    This should go in the objects init (I guess).
     

    Spoiler
    
    while {true} do {
    	{
    	 _x removeCuratorEditableObjects [[_this], true];
    	} forEach allCurators;
    	sleep 0.5;
    };

     

     


  2. So, I'm at my wits end here fellas. I have implemented this code directly in addactions and its worked in MP. Now I've gone the route of consolidating and creating functions and calling. But it seems I broke it... I've looked at this code and troubleshot it till I was blue in the face and I am at my wits end. Please take a look and I'll explain further at the end of the post. Code follows. This is all running on a dedicated server.

    initserver.sqf
     

    Spoiler
    
    ["Initialize", [true]] call BIS_fnc_dynamicGroups;
    
    [] execVM "56RDLoadOuts.sqf";
    
    [] execVM "ArmorAISpawn.sqf";
    
    [] execVM "ConvoyAiSpawn.sqf"; 
    
    [] execVM "RmorRng.sqf";
    
    [] execVM "EnemyFighter.sqf";
    
    [] execVM "EnemyFighterSQ.sqf";
    
    [] execVM "EnemyCASFW.sqf";  
     
    [] execVM "EnemyCASRW.sqf";  
    
    [] execVM "AssaultAiSpawn2.sqf";  
    
    [] execVM "AssaultAiSpawn.sqf";  
    
    [] execVM "HostileAAA.sqf";  
    
    [] execVM "CK_SpwnV.sqf";
    
    CK_FN_CLRTNK = {
    	cleanUp= vehicles inAreaArray TNKCLR;
    	{{deleteVehicle _x} forEach crew _x + [vehicle _x]}forEach cleanUp;
    	hint "Static Armor Clear";
    };  
    
    
    CK_FN_CLRAIR = {
    	cleanUp= allUnits inAreaArray EnemyAirSpace;
    	{{deleteVehicle _x} forEach crew _x + [vehicle _x]} forEach cleanUp;
    	hint "Enemy Air Space Clear";
    };
     
    
    
    CK_FN_CLRASSLT = {
    	cleanUp= allUnits inAreaArray AssaultForce;
    	{{deleteVehicle _x} forEach crew _x + [vehicle _x]} forEach cleanUp;
    	hint "Assault Area Clear";
    };
    
    
    CK_FN_CLRCNVY = {
    cleanUp= allUnits inAreaArray Convoy;
    {{deleteVehicle _x} forEach crew _x + [vehicle _x]} forEach cleanup;
    hint "Convoy Clear";
    };
    
    CK_FN_CLRAAA = {
    cleanUp= allUnits inAreaArray EnemyAAA;
    {{deleteVehicle _x} forEach crew _x + [vehicle _x]} forEach cleanUp;
    hint "Hostile AAA Clear";
    };
    
    CK_FN_MORNING = {
    	[[], {setDate [2035, 6, 24, 10, 0]}] remoteExecCall ["call",0,"JIP_id_setDate"];  
    any = [[["Late next morning","align = 'center' size = '0.7' font='PuristaBold'"]]] spawn BIS_fnc_typeText2;  
    sleep 5;  
    };
    
    CK_FN_EVENING = {
    	[[], {setDate [2035, 6, 24, 22, 0]}] remoteExecCall ["call",0,"JIP_id_setDate"];  
    any =[[["Late next evening","align = 'center' size = '0.7' font='PuristaBold'"]]] spawn BIS_fnc_typeText2;  
    sleep 5;  
    };
    
    CK_FNC_CLR = {
        params ["_CK_SPWN","_CK_ZOFST","_CK_CASE"];
     	private _ClrArea =  _CK_SPWN nearObjects ["EmptyDetector", 5] select 0;
     	cleanUp= vehicles inAreaArray _ClrArea;
     	{
     	deleteVehicle _x;
    	} forEach cleanup; 
    	uisleep 5;
    	hint "Spawn Area Clear";	
    };
    
    CK_FNC_CLRB = {
        params ["_CK_SPWN","_CK_ZOFST","_CK_CASE"];
     	private _ClrArea =  CK_BDEL1_1;
     	cleanUp= vehicles inAreaArray _ClrArea;
     	{
     	deleteVehicle _x;
    	} forEach cleanup; 
    	uisleep 5;
    	hint "Spawn Area Clear";	
    };

     


    CK_SpwnV.sqf
     

    Spoiler
    
    CK_FNC_SPWNV = {
    	params ["_CK_SPWN","_CK_ZOFST","_CK_CASE"];
    		switch (_CK_CASE) do { 
    			case 1 : {CK_VIC = ["B_Heli_Transport_01_F","Ghost Hawk"];}; 
    			case 2 : {CK_VIC = ["CUP_B_MH6M_USA","Little Bird"];};
    			case 3 : {CK_VIC = ["CUP_B_UH60M_US","Black Hawk"];};
    			case 4 : {CK_VIC = ["CFP_B_USRANGERS_MH_60L_DAP_4Pylons_WDL_01","Black Hawk Armed"];};
    			case 5 : {CK_VIC = ["CUP_B_AW159_Unarmed_RN_Blackcat","Wildcat"];};
    			case 6 : {CK_VIC = ["CUP_B_AW159_RN_Blackcat","Wildcat Armed"];};
    			case 7 : {CK_VIC = ["CFP_B_USMC_UH_1Y_Venom_Transport_DES_01","Huey"];};
    			case 8 : {CK_VIC = ["CFP_B_USMC_UH_1Y_Venom_Gunship_DES_01","Huey Armed"];};
    			case 9 : {CK_VIC = ["CUP_B_SA330_Puma_HC2_BAF","Puma"];};
    			case 10 : {CK_VIC = ["CUP_B_Merlin_HC3_GB","Merlin"];};
    			case 11 : {CK_VIC = ["CUP_B_Merlin_HC3_VIV_GB","Merlin VIV"];};
    			case 12 : {CK_VIC = ["CUP_B_Mi171Sh_Unarmed_ACR","MI-171"];};
    			case 13 : {CK_VIC = ["CFP_B_KEARMY_Harbin_ZB9_01","Harbin"];};
    			case 14 : {CK_VIC = ["B_Heli_Transport_03_F","CH-471 Chinook"];};
    			case 15 : {CK_VIC = ["CUP_B_CH47F_USA","CH-47F Chinook"];};
    			case 16 : {CK_VIC = ["CUP_B_CH47F_VIV_USA","CH-47F Chinook VIV"];};
    			case 17 : {CK_VIC = ["CUP_B_CH53E_USMC","CH-53 Super Stallion"];};
    			case 18 : {CK_VIC = ["CUP_B_CH53E_VIV_USMC","CH-53 Super Stallion VIV"];};
    			case 19 : {CK_VIC = ["CUP_B_AH6J_USA","AH-6M Little Bird"];};
    			case 20 : {CK_VIC = ["CUP_B_AH1Z_Dynamic_USMC","AH-1Z Cobra"];};
    			case 21 : {CK_VIC = ["B_Heli_Attack_01_dynamicLoadout_F","AH-66 Comanchee"];};
    			case 22 : {CK_VIC = ["CUP_B_AH64D_DL_USA","AH-64D Apache"];};
    			case 23 : {CK_VIC = ["CUP_I_Mi24_Mk4_ION","MI-24 Super Hind"];};
    			case 24 : {CK_VIC = ["CUP_I_Mi24_D_Dynamic_ION","MI-24D Hind"];};
    			case 25 : {CK_VIC = ["CFP_B_CZARMY_Mi_35_Dark_WDL_01","MI-35 Hind"];};
    			case 26 : {CK_VIC = ["CFP_O_RUARMY_Ka_50_Black_Shark_DES_01","KA-50 Black Shark"];};
    			case 27 : {CK_VIC = ["CFP_O_RUARMY_Ka_52_Black_DES_01","KA-52 Alligator"];};
    			case 28 : {CK_VIC = ["B_Plane_Fighter_01_F","F-118 Black Wasp"];};
    			case 29 : {CK_VIC = ["B_Plane_Fighter_01_Stealth_F","F-118 Black Wasp Stealth"];};
    			case 30 : {CK_VIC = ["CUP_B_F35B_USMC","F-35 Lightning"];};
    				case 31 : {CK_VIC = ["CUP_B_F35B_Stealth_USMC","F-35 Lightning Stealth"];};
    			case 32 : {CK_VIC = ["B_Plane_CAS_01_dynamicLoadout_F","A-10D Wipeout"];};
    			case 33 : {CK_VIC = ["USAF_A10","A-10C Warthog"];};
    			case 34 : {CK_VIC = ["CUP_B_AV8B_DYN_USMC","AV-8B Harrier"];};
    			case 35 : {CK_VIC = ["CUP_B_L39_CZ","L-39 Trainer"];};
    			case 36 : {CK_VIC = ["CUP_B_SU34_CDF","SU-34 Flanker"];};
    			case 37 : {CK_VIC = ["B_LSV_01_unarmed_F","Polaris"];};
    			case 38 : {CK_VIC = ["B_LSV_01_armed_F","Polaris HMG"];};
    			case 39 : {CK_VIC = ["B_LSV_01_AT_F","Polaris AT"];};
    			case 40 : {CK_VIC = ["B_MRAP_01_F","Hunter"];};
    				case 41 : {CK_VIC = ["B_MRAP_01_hmg_F","Hunter HMG"];};
    			case 42 : {CK_VIC = ["B_MRAP_01_gmg_F","Hunter GMG"];};
    			case 43 : {CK_VIC = ["B_MRAP_03_F","Fennek"];};
    			case 44 : {CK_VIC = ["B_MRAP_03_hmg_F","Fennek HMG"];};
    			case 45 : {CK_VIC = ["B_MRAP_03_gmg_F","Fennek GMG"];};
    			case 46 : {CK_VIC = ["CUP_B_RG31E_M2_USA","Cougar"];};
    			case 47 : {CK_VIC = ["CUP_B_Mastiff_LMG_GB_D","Mastiff LMG"];};
    			case 48 : {CK_VIC = ["CUP_B_Mastiff_HMG_GB_D","Mastiff HMG"];};
    			case 49 : {CK_VIC = ["CUP_B_Mastiff_HMG_GB_D","Mastiff GMG"];};
    			case 50 : {CK_VIC = ["CUP_B_HMMWV_Crows_M2_USA","Humvee M2"];};
    				case 51 : {CK_VIC = ["CUP_B_HMMWV_Crows_MK19_USA","Humvee Mk-19"];};
    			case 52 : {CK_VIC = ["CUP_B_HMMWV_TOW_USA","Humvee TOW"];};
    			case 53 : {CK_VIC = ["CUP_B_LAV25_HQ_desert_USMC","LAV LMG"];};
    			case 54 : {CK_VIC = ["CUP_B_LAV25_desert_USMC","LAV M240"];};
    			case 55 : {CK_VIC = ["B_APC_Wheeled_01_cannon_F","Badger"];};
    			case 56 : {CK_VIC = ["I_APC_Wheeled_03_cannon_F","Pandur"];};
    			case 57 : {CK_VIC = ["I_APC_tracked_03_cannon_F","Warrior"];};
    			case 58 : {CK_VIC = ["CUP_B_M2A3Bradley_USA_D","Bradley"];};
    			case 59 : {CK_VIC = ["B_Mortar_01_F","Mortar"];};
    			case 60 : {CK_VIC = ["CUP_B_M1129_MC_MK19_Desert_Slat","M1129"];};
    				case 61 : {CK_VIC = ["CFP_B_USARMY_M119_US","M119"];};
    			case 62 : {CK_VIC = ["B_MBT_01_arty_F","Sholef"];};
    			case 63 : {CK_VIC = ["CFP_B_UGARMY_BM_21_01","BM-21"];};
    			case 64 : {CK_VIC = ["B_MBT_01_mlrs_F","Seara"];};
    			case 65 : {CK_VIC = ["CUP_B_M270_DPICM_USA","M270 Cluster"];};
    			case 66 : {CK_VIC = ["CUP_B_M270_HE_USA","M270 HE"];};
    			case 67 : {CK_VIC = ["CUP_B_M1A1_DES_US_Army","Abrams M1A1"];};
    			case 68 : {CK_VIC = ["CUP_B_M1A2_TUSK_MG_DES_US_Army","Abrams M1A2"];};
    			case 69 : {CK_VIC = ["B_MBT_01_cannon_F","Merkava"];};
    			case 70 : {CK_VIC = ["B_MBT_01_TUSK_F","Merkava UP"];};
    				case 71 : {CK_VIC = ["I_MBT_03_cannon_F","Leopard"];};
    			case 72 : {CK_VIC = ["B_AFV_Wheeled_01_up_cannon_F","Rhino UP"];};
    			case 73 : {CK_VIC = ["CUP_B_RHIB2Turret_USMC","RHIB Mk-19"];};
    			case 74 : {CK_VIC = ["B_Boat_Armed_01_minigun_F","Speed Boat HMG"];};
    			case 75 : {CK_VIC = ["CUP_B_Zodiac_USMC","Zodiac"];};
    			case 76 : {CK_VIC = ["CFP_B_USMC_AAVP7_A1_DES_01","AAVP7"];};
    			case 77 : {CK_VIC = ["CUP_B_LCAC_USMC","LCAC"];};
    			case 78 : {CK_VIC = ["CUP_B_LCU1600_USMC","LCU 1600"];};
    			case 79 : {CK_VIC = ["CUP_I_LCVP_VIV_RACS","LCPV"];};
    			case 80 : {CK_VIC = ["B_SDV_01_F","SDV"];};
    				case 81 : {CK_VIC = ["CUP_B_MV22_USMC","Osprey"];};
    			case 82 : {CK_VIC = ["CUP_B_MV22_USMC_RAMPGUN","Osprey M2"];};
    			case 83 : {CK_VIC = ["CUP_B_MV22_VIV_USMC","Osprey VIV"];};
    			case 84 : {CK_VIC = ["B_T_VTOL_01_infantry_F","Black Fish"];};
    			case 85 : {CK_VIC = ["B_T_VTOL_01_armed_F","Black Fish Armed"];};
    			case 86 : {CK_VIC = ["B_T_VTOL_01_vehicle_F","Black Fish VIV"];};
    			case 87 : {CK_VIC = ["USAF_AC130U","AC-130 Spectre"];};
    			case 88 : {CK_VIC = ["USAF_E3","E3 AWACS"];};
    			case 89 : {CK_VIC = ["USAF_C17","C-17 Globe Master"];};
    			case 90 : {CK_VIC = ["Valor_Transport_Unarmed_F","UV-85 Omaha"];};
    				case 91 : {CK_VIC = ["HTNK_Gdi","Mammoth"];};
    			case 92 : {CK_VIC = ["CUP_B_Challenger2_Desert_BAF","Challenger"];};
    			case 93 : {CK_VIC = ["B_UAV_01_F","Darter"];};
    			case 94 : {CK_VIC = ["B_UAV_06_F","Pelican"];};
    			case 95 : {CK_VIC = ["B_UAV_05_F","Sentinal"];};
    			case 96 : {CK_VIC = ["B_UAV_02_dynamicLoadout_F","Yabhon"];};
    			case 97 : {CK_VIC = ["B_T_UAV_03_dynamicLoadout_F","Falcon"];};
    			case 98 : {CK_VIC = ["USAF_MQ9","Reaper"];};
    			case 99 : {CK_VIC = ["CFP_B_CDF_Pchela_1T_SNW_01","Pchela"];};
    			case 100 : {CK_VIC = ["bwi_a3_at6b","Texan II"];};
    			case 101 : {CK_VIC = ["USAF_F22_Heavy","F-22 Raptor Heavy"];};
    			case 102 : {CK_VIC = ["USAF_F35A","F-35 Raptor Heavy"];};
    			default {CK_VIC = ["","Nothing"];};
    		};
    	private _SpwnPos = CK_GSPWN;
    	private _vic = createVehicle [CK_VIC select 0,  [getPosATL _SpwnPos select 0,getPosATL _SpwnPos select 1,(getPosATL _SpwnPos select 2) + 0.01], [], 0,"CAN_COLLIDE"];
    	_vic allowDamage false;
    	_vic enableSimulationGlobal false;
    	private _MRKR = nearestObjects [(_CK_SPWN), ["Land_HelipadEmpty_F"], 5];
    	_SpwnPos = _MRKR select 0;
    	_vic setdir getdir _SpwnPos;
    	_vic setPosASL [getPosATL _SpwnPos select 0, getPosATL _SpwnPos select 1, _CK_ZOFST];		
    	uisleep 1;
    	_vic enableSimulationGlobal true;
    	_vic allowDamage true;
    	if (_CK_CASE < 28) then {
    	  	_vic addaction ["Disable Main Rotor", {
    			_this select 1;
    			[(_this select 0) , ["hithrotor", 1]] remoteExecCall ["setHitpointdamage", owner (_this select 0)];
    		}];
    		_vic addaction ["Disable Tail Rotor", {
    			_this select 1;
    			[(_this select 0) , ["hitvrotor", 1]] remoteExecCall ["setHitpointdamage", owner (_this select 0)];
    		}];
    		} else {
    	};
    	_vic addaction ["Fix It!", {
    		_this select 1;
    		[(_this select 0) , 0] remoteExecCall ["setDamage", owner (_this select 0)];
    	}];
    	_vic addaction ["Flip Vehicle", {
    		_this select 1; 
        	private _veh = (_this select 0); 
        	_veh setVectorUp [0,0,1]; 
        	_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0]; 
     	}];
     	_vic addaction ["Rearm", {
     		_this select 1; 
      		[(_this select 0) , 1] remoteExecCall ["setVehicleAmmo", owner (_this select 0)];
      	}]; 
    	hint format ["%1 spawned", CK_VIC select 1];
    };

     

    Okay so now I have some pedestals that players can utilize to spawn various vehicles, lets take the transport helo for exaple.

    heres the object init in 3den.

    Spoiler
    
    this setObjectTextureGlobal [0, "BHWK.paa"];       
    this addaction ["Clear Spawn Area", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];}];      
    this addaction ["Spawn Ghost Hawk", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,1] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Little Bird", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,2] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Black Hawk", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,3] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Black Hawk Armed", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,4] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Wildcat", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,5] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Wildcat Armed", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,6] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Huey", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,7] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Huey Armed", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,8] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Puma", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,9] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Merlin", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,10] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Merlin VIV", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,11] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn MI-171", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,12] remoteExec ["CK_FNC_SPWNV",2];}];      
    this addaction ["Spawn Harbin", {      
     _this select 1;      
     _CK_CLR = [CK_HTRN1_1] remoteExec ["CK_FNC_CLR",2];      
     _CK_SPWNV = [CK_HTRN1_1,getposasl CK_HTRN1_1 select 2,13] remoteExec ["CK_FNC_SPWNV",2];}];

     


    Okay so theres that, heres the problem. When spawning a vehicle everything fires without a problem but the additional addactions for the vehicle are missing "Disable main rotor" etc... In the past this was all embeded in each individual addaction and it worked but now for some reason the additional addactions are not added to the spawned vehicle. This is working when I host locally. Thanks for any help!


  3. Hi guys, I'm trying to use a CBA slider to effect a particular sound volume in the example here its the MX, but its going to end up being a few different sounds. My slider is going to go from zero to one and I'm hoping to just send a multiplier to the particular sound(s).

     

    Spoiler
    
    class CfgSoundSets
    {
        class Rifle_Shot_Base_SoundSet
        {
            soundShaders[] = 
            {
                MX_Closure_SoundShader,
                MX_closeShot_SoundShader,
                MX_midShot_SoundShader,
                MX_distShot_SoundShader,
                MX_tailInterior_SoundShader
            };
            volumeFactor = 1.6;
            volumeCurve = InverseSquare2Curve;
            sound3DProcessingType = WeaponMediumShot3DProcessingType;
            distanceFilter = weaponShotDistanceFreqAttenuationFilter;
            spatial = 1;
            doppler = 0;
            loop = 0;
        };
    };

     

     

     

    So, I'm hoping to effect the volumeFactor with a multiplier, is this possible and if so how do I send it to the particular sound? Do I just have to redefine the class?

     

    Spoiler

    [
        "CK_Volume_SliderMx", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
        "SLIDER", // setting type
        "MX Volume", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
        "Fiftysix Sound", // Pretty name of the category where the setting can be found. Can be stringtable entry.
        [0, 1, .5, 1], // data for this setting: [min, max, default, number of shown trailing decimals]
        nil, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
        {  
        call CK_fnc_SetMxVol;
        } // function that will be executed once on mission start and every time the setting is changed.
    ] call CBA_fnc_addSetting;


    CK_fnc_SetMxVol = {

    hint format ["You just changed the Mx volume to %1", CK_Volume_SliderMx];

    {
      _x = _x*CK_Volume_SliderMx;
    } forEach VolumeFactor;
    //idk maybee another foreach per class? where do I point foeach, where do the values live?
    };


    Are these values editable on the fly, or is this somthing that would be better redefined?

    A little more...

     

    Spoiler
    
    //Maybee it looks like this 
    
    class CfgSoundSets
    {
    	class stuff_soundset
    	{
    		soundShaders[] = {"stuff"};
    		//other vars here
    		//throwing your select game
    		//haha more random vars
    		volumeFactor = 1;
    
    	};
    	class things_soundset
    	{
    		soundShaders[] = {"things"};
    		//other vars here
    		//haha more random vars
    		volumeFactor = 2.6;
    
    	};
    	class forlols_soundset
    	{
    		soundShaders[] = {"forlols"};
    		//other vars here
    		//yay theres no order to vars
    		volumeFactor = 3.0;
    		//haha more random vars
    
    	};
    };

     

    So, not only do I have to target a specific variable (I guess by name?) but I need to do it for multiple classes as well as each class may have the variable in a different position, I'm a little out of my depth here so I'm not sure if array structure applies to classes?


  4. Okay, so i spent some time trying a few things but no success. 

    First up I created a function, or I thought I did....
    initserver.sqf
     

    Spoiler
    
    fnc_CK_STRIP = {
      	_CK_MAGNUM = selectRandom [1,3,5,9,13];
      	_CK_ITEMNUM = selectRandom [3,6,12,16];
      	_CK_MAGS = magazines player;
      	_CK_ITEMS = items player;
      	_CK_MAGSL = [];
      	_CK_ITMSL = [];
    		for "_i" from _CK_MAGNUM to 0 step -1 do 
    			{
    
    			_ThisMag = selectRandom _CK_Mags;
    			_CK_MAGSL pushBack _Thismag;
    
    			};
    		for "_i" from _CK_ITEMNUM to 0 step -1 do 
    			{
    
    			_ThisItem = selectRandom _CK_ITEMS;
    			_CK_ITMSL pushBack _ThisItem;
    
    			};
    
    			{
    			player removeMagazineGlobal _x; 
    			} foreach _CK_MAGSL;
    			{
    			player removeitem _x; 
    			} foreach _CK_ITMSL;
    
    	_CK_BOX = createVehicle ["CFP_B_USSEALS_WDL_SupportBox", [getpos CK_Wreck select 0, getpos CK_Wreck select 1, 0], [], 8, "NONE"];
    	_CK_BOX allowDamage false;
    	clearWeaponCargoGlobal _CK_BOX;
    	clearMagazineCargoGlobal _CK_BOX;
    	clearBackpackCargoGlobal _CK_BOX;
    	clearItemCargoGlobal _CK_BOX;
    	_CK_BOX setPosATL getPosATL _CK_BOX;
    	_CK_BOX setVelocity [random 6, random 6, random 6];
    
    		{
    		_CK_BOX addMagazineCargoGlobal [_x,1];
    		} foreach _CK_MAGSL;
    
    		{
    		_CK_BOX addItemCargoGlobal [_x,1]; 
    		} foreach _CK_ITMSL;
    };

     

    then somewhere in the events chain

    remotexec ["fnc_CK_STRIP",0];

    didn't work, so i tried 

    remotexeccall ["fnc_CK_STRIP",0];

    didn't work either...

    Second thing I tried was putting it in a script and calling the script

    CK_STRIP.sqf
     

    Spoiler

          _CK_MAGNUM = selectRandom [1,3,5,9,13];
          _CK_ITEMNUM = selectRandom [3,6,12,16];
          _CK_MAGS = magazines player;
          _CK_ITEMS = items player;
          _CK_MAGSL = [];
          _CK_ITMSL = [];
            for "_i" from _CK_MAGNUM to 0 step -1 do 
                {

                _ThisMag = selectRandom _CK_Mags;
                _CK_MAGSL pushBack _Thismag;

                };
            for "_i" from _CK_ITEMNUM to 0 step -1 do 
                {

                _ThisItem = selectRandom _CK_ITEMS;
                _CK_ITMSL pushBack _ThisItem;

                };

                {
                player removeMagazineGlobal _x; 
                } foreach _CK_MAGSL;
                {
                player removeitem _x; 
                } foreach _CK_ITMSL;

        _CK_BOX = createVehicle ["CFP_B_USSEALS_WDL_SupportBox", [getpos CK_Wreck select 0, getpos CK_Wreck select 1, 0], [], 8, "NONE"];
        _CK_BOX allowDamage false;
        clearWeaponCargoGlobal _CK_BOX;
        clearMagazineCargoGlobal _CK_BOX;
        clearBackpackCargoGlobal _CK_BOX;
        clearItemCargoGlobal _CK_BOX;
        _CK_BOX setPosATL getPosATL _CK_BOX;
        _CK_BOX setVelocity [random 6, random 6, random 6];

            {
            _CK_BOX addMagazineCargoGlobal [_x,1];
            } foreach _CK_MAGSL;

            {
            _CK_BOX addItemCargoGlobal [_x,1]; 
            } foreach _CK_ITMSL;

    
      	_CK_MAGNUM = selectRandom [1,3,5,9,13];
      	_CK_ITEMNUM = selectRandom [3,6,12,16];
      	_CK_MAGS = magazines player;
      	_CK_ITEMS = items player;
      	_CK_MAGSL = [];
      	_CK_ITMSL = [];
    		for "_i" from _CK_MAGNUM to 0 step -1 do 
    			{
    
    			_ThisMag = selectRandom _CK_Mags;
    			_CK_MAGSL pushBack _Thismag;
    
    			};
    		for "_i" from _CK_ITEMNUM to 0 step -1 do 
    			{
    
    			_ThisItem = selectRandom _CK_ITEMS;
    			_CK_ITMSL pushBack _ThisItem;
    
    			};
    
    			{
    			player removeMagazineGlobal _x; 
    			} foreach _CK_MAGSL;
    			{
    			player removeitem _x; 
    			} foreach _CK_ITMSL;
    
    	_CK_BOX = createVehicle ["CFP_B_USSEALS_WDL_SupportBox", [getpos CK_Wreck select 0, getpos CK_Wreck select 1, 0], [], 8, "NONE"];
    	_CK_BOX allowDamage false;
    	clearWeaponCargoGlobal _CK_BOX;
    	clearMagazineCargoGlobal _CK_BOX;
    	clearBackpackCargoGlobal _CK_BOX;
    	clearItemCargoGlobal _CK_BOX;
    	_CK_BOX setPosATL getPosATL _CK_BOX;
    	_CK_BOX setVelocity [random 6, random 6, random 6];
    
    		{
    		_CK_BOX addMagazineCargoGlobal [_x,1];
    		} foreach _CK_MAGSL;
    
    		{
    		_CK_BOX addItemCargoGlobal [_x,1]; 
    		} foreach _CK_ITMSL;

     

    then somewhere in the events chain

    remotexec ["CK_STRIP.sqf",0];

    didn't work, so i tried 

    remotexeccall ["CK_STRIP.sqf",0];

    didn't work either...

    So I was rolling on this train of finally getting locality, and now I've run into a locality blockade... I can run that code locally via debug console and it does what I want it to do. What method am I supposed to use to accomplish this? That code needs to run on each client, I thought remotexec did that, am i using it wrong, is there some other syntax/command to use?
     


  5. Thanks again @pierremgi, I have Everything working except for one section and I'm thinking i need to treat this as a function and remote exec the whole thing. Here's the snip.

     

    Spoiler
    
    CK_MyDudes = call BIS_fnc_listPlayers;
    
    
    {
    
      	_CK_MAGNUM = selectRandom [1,3,5,9,13];
      	_CK_ITEMNUM = selectRandom [3,6,12,16];
      	_CK_MAGS = magazines _x;
      	_CK_ITEMS = items _x;
      	_CK_MAGSL = [];
      	_CK_ITMSL = [];
    		for "_i" from _CK_MAGNUM to 0 step -1 do 
    			{
    
    			_ThisMag = selectRandom _CK_Mags;
    			_CK_MAGSL pushBack _Thismag;
    
    			};
    		for "_i" from _CK_ITEMNUM to 0 step -1 do 
    			{
    
    			_ThisItem = selectRandom _CK_ITEMS;
    			_CK_ITMSL pushBack _ThisItem;
    
    			};
    
    			{
    			player removeMagazineGlobal _x; 
    			} foreach _CK_MAGSL;
    			{
    			player removeitem _x; 
    			} foreach _CK_ITMSL;
    
    	_CK_BOX = createVehicle ["CFP_B_USSEALS_WDL_SupportBox", [getpos CK_Wreck select 0, getpos CK_Wreck select 1, 0], [], 8, "NONE"];
    	_CK_BOX allowDamage false;
    	clearWeaponCargoGlobal _CK_BOX;
    	clearMagazineCargoGlobal _CK_BOX;
    	clearBackpackCargoGlobal _CK_BOX;
    	clearItemCargoGlobal _CK_BOX;
    	_CK_BOX setPosATL getPosATL _CK_BOX;
    	_CK_BOX setVelocity [random 6, random 6, random 6];
    
    		{
    		_CK_BOX addMagazineCargoGlobal [_x,1];
    		} foreach _CK_MAGSL;
    
    		{
    		_CK_BOX addItemCargoGlobal [_x,1]; 
    		} foreach _CK_ITMSL;
    
    } forEach CK_MyDudes;

     

    So If I'm understanding correctly, what's happening is the outside foreach is running on the server, and it runs once per player. However since it runs on the server the nested foreach containing "removeMagazineGlobal" doesn't run on the player that the outside foreach is run on, how do I accomplish this, Can i define _X = _CK_CurrentPlayer and pass that to the nested foreach, well that's what I'm going to try. Otherwise i was thinking that I make this a function and run the function on each client? But IDK how to do that, at least how to pass params etc...


  6. Hi guys, I've been steadily producing terrible code and making it less terrible as I go. I'm still having problems recognizing locality of certain commands, and when/who needs to execute the specific code. Thanks for your help, as I continue to produce horrible scripts! :sorry:

    What I'm trying to do
    1) Players use an addaction to start an event (working)
    2) Players are transported into a plane (working)

    a) the plane begins to get shot down (crash) (working)
    b) some radio chatter (text and sound), and music plays (only working for the player that triggered the action ("player1"))
    c) some explosion happens and an engine fire starts (working)
    d) the plane is forced downward (working kind of brute force though)
    3) Players encounter another explosion at low altitude (working)
    a) players are knocked unconscious (only working for "player1")
    b) random clutter is spawned based on player count (working)
    c) players are stripped of random items and those items are placed in some boxes (half working only player1 loses items)
    3) Players awaken to a crash site (working again only player1 was unconscious) 
    a) music switch to shorter track (working only for player1)
    b) static engine noise plays from the wreck (working for playe1 only)

    I have also noticed that for "player1" the events progress linearly through the script, but for the other players that is not necessarily the case. I was poking around and it sounds to be scheduler related, but I'm not quite understanding how to work around that. Ideally all of the events in my script would happen synchronously and in the order they are shown in the script. Any help in pointing me where to go from here is much appreciated, script and description.ext to follow.

    description.ext
     

    Spoiler
    
    overviewPicture = "plane-1.jpg";
    respawnOnStart = -1;
    respawn = "BASE";
    respawnDelay = 3;
    respawnDialog = 0;
    overviewText = "Plane Crash Takistan";
    author = "COCKHEAVEN";
    onLoadName = "Plane Crash Takistan";
    loadScreen = "plane-1.jpg";
    onLoadMission = "Plane Crash Takistan";
    
    
    class CfgSounds
    {
    	sounds[] = {};
    	
    class TestSound1
    {
    	sound[] = {"@A3\sounds_f\sfx\radio\ambient_radio8.wss",3,1,100};
    	name = "TestSound1";
    	titles[] = {};
    };
    class TestSound2
    {
    	sound[] = {"@A3\sounds_f\sfx\radio\ambient_radio2.wss",3,1,100};
    	name = "TestSound2";
    	titles[] = {};
    };
    class TestSound3
    {
    	sound[] = {"@A3\sounds_f\sfx\radio\ambient_radio3.wss",3,1,100};
    	name = "TestSound3";
    	titles[] = {};
    };
    class TestSound4
    {
    	sound[] = {"@A3\sounds_f\sfx\radio\ambient_radio2.wss",3,1,100};
    	name = "TestSound4";
    	titles[] = {};
    };
    };

     



    Crash.sqf
     

    Spoiler
    
    
    //----------------------------Get Players and put them in crashing Plane-------------------//
    CK_ENGINE = false;
    CK_MyDudes = call BIS_fnc_listPlayers;
    _CK_MRKR = [CK_MOMY_1,CK_MOMY_2,CK_MOMY_3,CK_MOMY_4,CK_MOMY_5,CK_MOMY_6] call BIS_fnc_selectRandom; // array of invisible helipads (pre placed)
    _CK_MOMPOS = getpos _CK_MRKR;
    CK_POS = [_CK_MOMPOS select 0, _CK_MOMPOS select 1, (_CK_MOMPOS select 2) + 900];
    CK_Plane = [CK_POS, getdir _CK_MRKR, "CUP_B_C130J_USMC", west] call BIS_fnc_spawnVehicle;
    
    CK_Mother = CK_Plane select 0; // get the plane object
    CK_Mother setVelocity [0, (velocity CK_Mother select 1) + 220, (velocity CK_Mother select 2) - 10]; // give it some speed and down
    CK_PlaneGroup = CK_Plane select 2; // get pilots
    CK_Mother animate ["ramp_top",1,true]; // open ramp
    CK_Mother animate ["ramp_bottom",.7,true]; // open ramp
    CK_Mother allowDamage false; // saftey third
    CK_Mother AllowCrewInImmobile True; // no ejections
    CK_Mother engineOn true; // turn it on
    
    
    CK_PlaneGroup setGroupID ["Eagle"]; // RP is fun
    
    
    
    Speakers = [CK_Mother];//array of your speakers
    SoundPads = []; // empty for soundpads
    {
      pads = createVehicle["Land_HelipadEmpty_F", (getpos _x), [], 0, "CAN_COLLIDE"];
      SoundPads pushback pads;
    } forEach Speakers;
    {
    _x say3d ["TestSound1", 1500, 1];
    } foreach SoundPads;// make all of your speakers play the sound
    
    CK_Mother sideChat "Roger Ramsen Air Base, maintain altitude make bearing zero three zero airspeed 180"; //cool RP
    {
      _x moveInAny CK_Mother; // players in plane
      _x allowDamage false; // saftey third
      _x setVariable ["ace_map_hideBlueForceMarker", true, true]; // turn off BFT (fingers crossed)
    } forEach CK_MyDudes;
    
    
    
    
    uisleep 2;
    //-----------------------------------------------------------------------------------------//
    
    
    //---------------------------------Shoot em down-------------------------------------------//
    CK_AAA = [_CK_MOMPOS, random 360, "CUP_O_Ural_ZU23_TKM", east] call BIS_fnc_spawnVehicle; // create AA vehicle
    
    CK_AAA commandSuppressiveFire CK_Mother; // Shoot plane
    
    //-----------------------------------------------------------------------------------------//
    
    //---------------------------------Crash the Plane-----------------------------------------//
    _bomb = "APERSTripMine_Wire_Ammo" createVehicle (CK_Mother modelToWorld [-10, 0, -.75]);
    _bomb setDamage 1;
    CK_Mother setFuel 0;
    FireBall = createVehicle ["Land_HelipadEmpty_F", (CK_Mother modelToWorld [-10, 0, -.75]), [], 0, "CAN_COLLIDE"];
    FireBall attachTo [CK_Mother, [-10, 0, -.75] ];
    Flame = createVehicle ["test_EmptyObjectForFireBig", FireBall, [], 0, "CAN_COLLIDE"];
    Flame attachto [FireBall, [0, 0, 0] ];
    "LeadTrack03_F_EXP" remoteExec ["playmusic"];;
    CK_Mother setVelocity [(velocity CK_Mother select 0), (velocity CK_Mother select 1),(velocity CK_Mother select 2) - 50]; // explode and engine and set on fire, play cool music and send plane down
    
    
    Speakers = [CK_Mother];//array of your speakers
    SoundPads = []; // empty for soundpads
    {
      pads = createVehicle["Land_HelipadEmpty_F", (getpos _x), [], 0, "CAN_COLLIDE"];
      SoundPads pushback pads;
    } forEach Speakers;
    {
    _x say3d ["TestSound2", 1500, 1];
    } foreach SoundPads;// make all of your speakers play the sound
    
    CK_Mother sideChat "Mayday, Mayday, Mayday. This is Eagle we are under fire and going down.";
    uisleep 1.5;
    CK_Mother sideChat "Ramsen Air Base, Eagle, we are under fire, engine three is out, engine one on fire, prepare for emergency landing";
    uisleep 3; // cool RP
    while {getposATL CK_Mother select 2 > 300} do {
    CK_Mother setVelocity [0, (velocity CK_Mother select 1) + .075, (velocity CK_Mother select 2) - .05];
    CK_AAA doFire CK_Mother;
    uisleep 1;
     }; // fly down plz
    waituntil {getposATL CK_Mother select 2 < 300};
    CK_Mother sideChat "I'm going to have to dump your cargo";
    
    _veh = createVehicle ["CFP_C_AFRCHRISTIAN_SUV_01", [getPos CK_Mother select 0, (getPos CK_Mother select 1) - 25,(getPos CK_Mother select 2)], [], 0, "NONE"];
    _veh setdir getdir CK_Mother; // dump a vehicle
    
    [objnull, _veh] call BIS_fnc_curatorobjectedited;
    _veh SetVelocity [0,0,0]; // parachute plz
    
    _CK_SMK1 = createVehicle ["SmokeShellpurple", (getpos _veh), [], 0, "CAN_COLLIDE"];    
    _CK_SMK1 attachTo [(vehicle _veh), [-0.2,0.0,0.5]];   
    
    _CK_SMK2 = createVehicle ["SmokeShellpurple", (getpos _veh), [], 0, "CAN_COLLIDE"];    
    _CK_SMK2 attachTo [(vehicle _veh), [0.2,0.0,0.5]];   
    
    _CK_SMK3 = createVehicle ["SmokeShellpurple", (getpos _veh), [], 0, "CAN_COLLIDE"];    
    _CK_SMK3 attachTo [(vehicle _veh), [0.0,0.0,0.5]];  
    
    
    uisleep 2;
    
    while {getposATL CK_Mother select 2 > 120} do {
    CK_Mother setVelocity [0, (velocity CK_Mother select 1) + .15, (velocity CK_Mother select 2) - .025];
    CK_AAA doFire CK_Mother;
    uisleep 1;
     }; // fly down plz
    
    //-----------------------------------------------------------------------------------------//
    
    _bomb = "APERSTripMine_Wire_Ammo" createVehicle (CK_Mother modelToWorld [-10, -5, -.75]);
    _bomb setDamage 1;
    {
      _x setVariable ["ACE_isUnconscious", true];
    } forEach CK_MyDudes; // go to sleep
    waituntil {isTouchingGround CK_Mother};
    CK_Mother setVelocity [0, 0, 0]; // do not bounce thanks!
    CK_AA1 = CK_AAA select 0;
    CK_AA2 = CK_AAA select 2;
    deletevehicle CK_AA1;
    deletegroup CK_AA2;
    //--------------------------------Setup plane wreck----------------------------------------//
    
    uisleep 5;
    {
      moveOut _x;
    } forEach CK_MyDudes; // get out
    
    {
     _x setDamage 1;
    } forEach units CK_PlaneGroup; // pilots did not survive
    
    CK_MPOS = getPosATL CK_Mother;
    CK_Dir = getdir CK_Mother;
    
    deleteVehicle CK_Mother; // delete old plane
    deleteVehicle Flame; // delete old fire
    
    CK_Wreck = createVehicle ["C130J_static_EP1", [CK_MPOS select 0,CK_MPOS select 1,-.5], [], 0, "CAN_COLLIDE"]; // create new plane
    CK_Wreck setdir CK_Dir + 180;
    CK_Wreck setVectorUp surfaceNormal position CK_Wreck;
    FireBall = createVehicle ["Land_HelipadEmpty_F", (CK_Wreck modelToWorld [10, 0, 3.25]), [], 0, "CAN_COLLIDE"]; 
    FireBall attachTo [CK_Wreck, [10, -3, -2] ]; 
    Flame = createVehicle ["test_EmptyObjectForFireBig", FireBall, [], 0, "CAN_COLLIDE"];
    uisleep 2; // create new fire
    "EventTrack02_F_Curator" remoteExec ["playmusic"]; // cool music
    CK_Wreck animate ["ramp_top",1,true];
    CK_Wreck animate ["ramp_bottom",1,true]; // open ramp
    //-----------------------------------------------------------------------------------------//
    
    //--------------------------------Take players items----------------------------------------//
    
    {
    
      _CK_MAGNUM = selectRandom [1,3,5,9,13];
      _CK_ITEMNUM = selectRandom [3,6,12,16];
      _CK_MAGS = magazines _x;
      _CK_ITEMS = items _x;
      _CK_MAGSL = [];
      _CK_ITMSL = [];
    for "_i" from _CK_MAGNUM to 0 step -1 do {
    
    _ThisMag = selectRandom _CK_Mags;
    _CK_MAGSL pushBack _Thismag;
    
    };
    for "_i" from _CK_ITEMNUM to 0 step -1 do {
    
    _ThisItem = selectRandom _CK_ITEMS;
    _CK_ITMSL pushBack _ThisItem;
    
    };
    
    	{
    	player removeMagazine _x; 
    	} foreach _CK_MAGSL;
    	{
    	player removeItem _x; 
    	} foreach _CK_ITMSL;
    
    _CK_BOX = createVehicle ["CFP_B_USSEALS_WDL_SupportBox", [getpos CK_Wreck select 0, getpos CK_Wreck select 1, 0], [], 8, "NONE"];
    _CK_BOX allowDamage false;
    clearWeaponCargoGlobal _CK_BOX;
    clearMagazineCargoGlobal _CK_BOX;
    clearBackpackCargoGlobal _CK_BOX;
    clearItemCargoGlobal _CK_BOX;
    _CK_BOX setPosATL getPosATL _CK_BOX;
    _CK_BOX setVelocity [random 6, random 6, random 6];
    
    	{
    	_CK_BOX addMagazineCargoGlobal [_x,1]; 
    	} foreach _CK_MAGSL;
    	{
    	_CK_BOX addItemCargoGlobal [_x,1]; 
    	} foreach _CK_ITMSL;
    
    } forEach CK_MyDudes;
    
    
    //-----------------------------------------------------------------------------------------//
    uisleep 2;
    
    //----------------------------Wake up Players----------------------------------------------//
    CK_JNK = ["Land_HistoricalPlaneDebris_04_F","Land_HistoricalPlaneDebris_03_F","Land_HistoricalPlaneDebris_02_F","Land_HistoricalPlaneDebris_01_F","Fort_Crate_wood","AmmoCrate_NoInteractive_","Land_PlasticCase_01_large_black_F","Land_PlasticCase_01_large_black_CBRN_F","Land_PlasticCase_01_medium_black_F","Land_PlasticCase_01_medium_black_CBRN_F","Land_PlasticCase_01_small_black_F","Land_PlasticCase_01_small_black_CBRN_F","Land_MetalCase_01_large_F","Land_MetalCase_01_small_F","Land_MetalCase_01_medium_F","Box_B_UAV_06_F","Land_Ammobox_rounds_F","Land_PaperBox_01_open_empty_F","Land_PaperBox_01_small_ransacked_brown_F","Land_PaperBox_01_small_open_brown_IDAP_F","Land_PaperBox_01_small_destroyed_white_IDAP_F","Land_PaperBox_01_small_ransacked_white_IDAP_F","Land_EmergencyBlanket_01_discarded_F","Land_EmergencyBlanket_02_discarded_F","Land_WaterBottle_01_pack_F","Land_FoodSack_01_dmg_brown_F","Land_FoodSack_01_empty_white_idap_F"];
    CK_JNKNUM = (count CK_MyDudes) * 3;
    
    
    for "_i" from CK_JNKNUM to 0 step -1 do {
    
    _ThisJNK = selectRandom CK_JNK;
    _CK_JNK = createVehicle [_ThisJNK, CK_Wreck, [], 8, "NONE"];
    _CK_JNK setPos [getPos _CK_JNK select 0, getPos _CK_JNK select 1, 0];
    _CK_JNK setvelocity [random 6, random 6, random 6];
    };
    {
    	_x setvelocity [0,0,0];
    	_x setPosATL getPosATL CK_Wreck;
     	_x setVariable ["ACE_isUnconscious", false];
     	_x allowDamage true;
    } forEach CK_MyDudes;
    
    
    [
    	[
    		["CRASH SITE; ", "align = 'center' shadow = '1' size = '0.7' font='PuristaBold'"],
    		["EAGLE", "align = 'center' shadow = '1' size = '0.7'", "#aaaaaa"],
    		["","<br/>"], 
    		["MOMENTS LATER...","align = 'center' shadow = '1' size = '1.0'"]
    	],-.5,.5
    ] spawn BIS_fnc_typeText2; // mission critical info
    
    playSound3D ["a3\sounds_f\sfx\radio\ambient_radio3.wss", CK_Wreck, true];
    CK_Sound = createSoundSource ["Sound_Fire", getpos Flame, [], 0];
    //-----------------------------------------------------------------------------------------//
    
    CK_ENGINE = true; // loop var for engine noise
    
    while {CK_ENGINE} do {
    playSound3D ["A3\Sounds_F\sfx\missions\bobcat_engine_start.wss", CK_Wreck, true]; // engine noise
    uisleep 3.5;
    };
    

     

     


  7. Hi guys, I'm trying to disable BFT via a script for a group of players during a mission. The Idea is these players crash land somewhere and must escape or radio for extract, to improve the experience I don't want them to know exactly where they are on the map. I haven't busted into the PBO yet, but I've been searching here and the ACE wiki for information on this function. I know I can disable BFT in the editor, but I want it triggered during the mission. Thanks!

     


  8. So, what is it doing. To elaborate, when I run the code execvm "myscript.sqf"; in the debug console and select the "SERVER EXEC" button, what command it being run. I'm asking this because I'm chasing my tail around getting a function to run in a dedicated server properly.

    myscript.sqf
     

    Spoiler
    
    _Bomba = ["CUP_BAF_IEDBox","Box_IED_Exp_F","Land_GarbageBarrel_02_buried_F","CUP_IED_V1","CUP_IED_V2","CUP_IED_V3","CUP_IED_V4","Land_CarBattery_01_F","Land_CarBattery_02_F","PowerCable_01_Roll_F","Land_PaperBox_01_small_stacked_F","Land_GarbageBarrel_01_english_F","Land_PressureWasher_01_F","Land_Device_assembled_F","Land_Pallet_MilBoxes_F","MetalBarrel_burning_F","Land_Suitcase_F","Land_PlasticCase_01_small_F","Wooden_barrels"] call BIS_fnc_selectRandom; // pick a neto object
    
    
    _markers = allMapMarkers select {toUpper _x find "MINEFEILD" >= 0}; // find the minefield
    
    CK_BOMB = createVehicle [_Bomba,getmarkerpos (selectrandom _markers), [], 0]; //create neto object @ minefield
    
    
    [CK_BOMB,"small",2,600,true,3,0,west] spawn MCC_fnc_createIED; // run this function from this mod

     

    The problem Is that I cannot figure how I should be calling this, currently I'm using an addaction with execvm "myscript.sqf";
    This works fine when I host in MP, but when I run the addaction on the dedicated machine I get the object creation but it doesn't run the function from the mod. My solution is to use whatever "SERVER EXEC" uses in the debug console and embed that into the addaction, but what does that button use?


  9. Just a simple question, Is it possible to spawn an AI and tell the system it is not an AI but a player? I'm asking this because I had a medical training script working utilizing the old ACE 3 medical system, now I am having to work around the new system by using BIS unconscious and a wait until looking at the paper doll for epinephrine. It seems now ACE looks at unconscious AI and !Alive(s) them every so many seconds, the old system did not do this and I was able to use ACE unconscious in the past... TLDR If I could tell the game that the AI unit I'm spawning is a player I think it would be an easier workaround....


  10. Thanks for the assistance @mrcurry I took your idea and ran with it, heres what ended up being an acceptable solution.

    HVT1_1 init
     

    HVT1_1 addEventHandler ["HandleDamage", {HVT1_1 setDamage 0.7;   
    HVT1_1 allowDamage false;
    ["ace_captives_setSurrendered",[HVT1_1,true]] call CBA_fnc_globalEvent;
    HVT1_1 allowDamage true;  
    0}]; 

    A little redundancy with the allowdamage but better alive than !alive...
    What I observed, with the current ACE settings not allowing AI unconscious it seems it scans for AI that are unconscious (ACE unconscious) and if it returns true it kills them. So it seems with the Allow AI Unconsciousness option disabled it is not possible to have an isolated AI go unconscious, the solution was to have the AI surrender when he gets shot.


  11. Hi guys I did a quick search for similar scenarios to what I'm trying to achieve and it turned up dry. I have an HVT (HVT1_1) in a building, he's armed and dangerous. Players need to capture him alive, so what i'd like to do is (no matter what ammunition) have the HVT go unconscious upon being hit so players may subdue and stabilize him. I know I can enable AI unconsciousness using ACE settings but I don't want that to be global I just want HVT1_1 to be able to go unconscious. Here is what I have so far
    HVT1_1 init
     

    this addEventHandler ["HitPart", {this setDammage 0.7; 
    this setvariable ["ACE_isUnconscious", true, true]; 
    this setUnconscious true;}];

    The problem is HVT1_1 Dies...


  12. 8 hours ago, RCA3 said:

     You're counting this 3 times. Just use the value from line above in the while loop and on the if then{4*...}.

    Also using private and if you can only local variables may speed up the process.

    Maybe add a ~5-10 second sleep to the while loop as well.

    Thanks, repetitive remedial math is bad.
     

     

    13 hours ago, 7erra said:

    Two possible reasons that I know of:

    1. Spawning units in general.
    2. Counting a huge array. Try removing dead units from it. That would also simplify the {alive _x} count CK_Enemies in the while do condition to count CK_Enemies.

    so redefine CK_Enemies = alive CK_Enemies then do the count?


  13. Hi guys, I have created a script to spawn enemies until a player in an area has been outnumbered, then wait until the player isn't outnumbers and resume spawning. I'm using a while for this with some If and uisleep. While this script is running I'm seeing a severe impact on performance, FPS is fine but server command processing is slowed, Zeus spawning or module placing lags. Is this an efficient way of performing this task? Is there a better way to do this? Also how do I stop the script from running?

     

    Spoiler
    
    [ "t3", ["We have arrived at FARP Winchester which appears abandoned. Secure and hold Winchester until EVAC arrives.","The Gauntlet","Castle"] ] call BIS_fnc_taskSetDescription;
    "t3" call BIS_fnc_taskSetCurrent; //set the task as current
    ["t3","defend"] call BIS_fnc_taskSetType;
    
    if (!isServer) exitWith {}; 
    hintSilent "waiting for 15 init";
    uisleep 15;
    
    CK_Enemies = []; // empty array for spawned groups
    
    //wait for squad to collect in castle then send initial wave
    CSTL_DNFDRS = allPlayers inAreaArray CSTLGNDS; // who goes there
    _nearplayercount = count CSTL_DNFDRS; // count players in castle
    _playerLoops = _nearplayercount; // used to restrict min player requirement
    
    while {(count (allPlayers inAreaArray CSTLGNDS)) > 0} do 
    {
    	hintSilent "players in Castle waiting 25";
    	uisleep 25;
    	CSTL_DNFDRS = allPlayers inAreaArray CSTLGNDS;
    	_nearplayercount = count CSTL_DNFDRS;
    	_playerLoops = _nearplayercount;
    	if ((4*(count (allPlayers inAreaArray CSTLGNDS))) < ({alive _x} count CK_Enemies)) then 
    		{
    			hintSilent "Outnumbered waiting 20";
    			uisleep 20;
    		}
    		else
    		{
    			{
    				if (_playerLoops > 0) then 
    					{
    						_grp4Marker = Selectrandom ["IEDAMBUSH1_1","IEDAMBUSH1_2","IEDAMBUSH1_3","IEDAMBUSH1_4","IEDAMBUSH1_5","IEDAMBUSH1_6"]; //select a random spawn point for group 4
    						_grp4 = [getmarkerpos _grp4Marker, East, ["CFP_O_HEZBOLLAH_Militia_Squad_Leader_01","CFP_O_HEZBOLLAH_Militia_Rifleman_AT_01"],[],[],[],[],[],116] call BIS_Fnc_spawnGroup; // group unit array and spawn at marker
    						[_grp4, getMarkerPos "Castle"] call bis_fnc_taskAttack; //attack this marker
    						[_grp4, 1] setWaypointSpeed "FULL";
    						[_grp4, 1] setWaypointCombatMode "RED";
    						[_grp4, 1] setWaypointBehaviour "COMBAT";
    						[_grp4, 1] setWaypointFormation "LINE";
    						{
    							CK_Enemies pushBack _x;
    						} foreach units _grp4;
    							 // push groups into CK_Enemies
    					};
    			} foreach CSTL_DNFDRS;
    			hintSilent "second group spawned waiting 5";
    			uisleep 5;
    			};
    		};

     

     


  14. Let me firstly say this work has been heavily inspired and predicated on the post "Simple Call to Prayer" and "Takistan Insurgency""".

     

    So, I have a mission (rather a few mission templates) set in the "middle eastern" region maps from CUP etc... My objective is to have non mod dependent CTP experience that is also simple and lightweight. I have been mildly successful in following the Simple Call to Prayer post mentioned above. In my mission I have a trigger that runs at certain times similar to the afore mentioned post.

     

    Trigger Onact
     

    Spoiler
    
    execVM "CTP.sqf"

     

    description.ext

    Spoiler
    
    overviewPicture = "56RDFlag.jpg";
    respawnOnStart = -1;
    respawn = "BASE";
    respawnDelay = 3;
    respawnDialog = 0;
    overviewText = "DUO BLUFOR TAKISTAN";
    author = "COCKHEAVEN";
    onLoadName = "DUO BLUFOR TAKISTAN";
    loadScreen = "56RDFlag.jpg";
    onLoadMission = "DUO BLUFOR TAKISTAN";
    
    class CfgSounds 
    {
    	Sounds[] = {CK_Call1,CK_Call2,CK_Call3}; 
    
    		class CK_Call1
    	{
    
    	name     = "CK_Call1"; 
    	sound[]  = {"Sounds\CK_Call1.ogg", 15, 1, 100};
    	titles[] = {0,""};
    	soundLength = 186; 
    
    	};
    		class CK_Call2 
    	{
    
    	name     = "CK_Call2"; 
    	sound[]  = {"Sounds\CK_Call2.ogg", 15, 1, 100};
    	titles[] = {0,""};
    	soundLength = 196; 
    
    	};
    		class CK_Call3 
    	{
    
    	name     = "CK_Call3"; 
    	sound[]  = {"Sounds\CK_Call3.ogg", 15, 1, 100};
    	titles[] = {0,""};
    	soundLength = 227; 
    
    	};
    };

     


    CTP.sqf

    Spoiler
    
    _Speakers = [Speaker1_1,Speaker1_2,Speaker1_3,Speaker1_4,Speaker1_5,Speaker1_6,Speaker1_7,Speaker1_8,Speaker1_9,Speaker1_10,Speaker1_11,Speaker1_12,Speaker1_13,Speaker1_14,Speaker1_15,Speaker1_16,Speaker1_17,Speaker1_18,Speaker1_19];//array of your speakers
    {
    _x say3d ["CK_Call2", 800, 1];
    } foreach _Speakers;// make all of your speakers play sound listed dont need 19 speakers but speakers must start at 1_1 and incriment by 1 for each speaker on the map
    
    
    
    if (isServer) then {
      CK_Civs = [];// empty for civs
      CK_rugs = [];// empty for CK_rugs
    {
    	if ((side _x) == civilian) then {
    		CK_Civs pushBack _x
    	}// find all civs put them in array
    } forEach allUnits;// search in allunits
    {
    	_rug = createVehicle[(selectRandom ["Land_Carpet_EP1","Land_Rug_01_Traditional_F","Land_Rug_01_F"]), (getpos _x), [], 0, "CAN_COLLIDE"];// create rug for each civ
    	_x setDir 90; // set civ facing east
    	_x setFormDir 90; // because in arma you need mutlitple stupid f****** commands for the same thing!
    	_rug setDir 90; // set rug facing east
    	CK_rugs pushBack _rug;
    	_x disableAI "PATH"; // stop
    	_x disableAI "MOVE"; // stop
    } forEach CK_Civs;// run for all civs
    };
    _limit = 5; // define loop limit
    _num = 0; // define loop init
    while {(_num) < (_limit)} do {
    	{
    	_x setUnitPos "DOWN";
    	} forEach CK_Civs; // up downs for civs
    	uisleep 2;
    	{
    	_x setUnitPos "UP";
    	} forEach CK_Civs; // up downs for civs
    	uisleep 2;
    	_num = _num + 1; // counting is fun
    	};
    {
    	_x enableAI "PATH"; // start
    	_x enableAI "MOVE"; // start
    	_x setUnitPos "AUTO";
    } forEach CK_Civs;// run for all civs
    
    {
    	deleteVehicle _x;
    } forEach CK_rugs;

     


    Only two minor problems I'm having. Firstly only the sound defined as CK_Call2 will play for its entire duration, I have tried playing CK_Call1 and CK_Call3 but they each stop playing after about 3 seconds. Secondly on the server the civs rotate 90 degrees but then rotate freely, the rugs create and orient perfectly but the civies do not do up-downs and the rugs all delete after the loop finishes.... So basically I'm stuck with 1 sound file that plays and civies that just stand there on top of their carpets facing random directions, I guess its a locality thing but I don't really understand that stuff yet......

     

     


  15. Hi guys, I had been putting together a kit for my community to standardize missions and part of that kit incorporated standard unit loadouts in the ace arsenal. To achieve this @Mr H. helped me with creating and extracting loadouts and inputting them in objects that are enabled as ace arsenals. 

     

    Object init

    Spoiler
    
    this spawn {waitUntil{!isNil 'ACE_ArsenalAllowedItems'};[_this,ACE_ArsenalAllowedItems,true] call ace_arsenal_fnc_initBox};

     

     

    Init.sqf and or initserver.sqf

    Spoiler
    
    [] execVM "56RDLoadOuts.sqf";

     

     

    56RDLoadOuts.sqf

    Spoiler
    
    //-----------Load Outs-----------//
    
    _allLoadOuts = [
    
    
    //-----Platoon-----//
    ["56RD MTP Commander",[[],[],["hgun_Pistol_heavy_01_F","","acc_flashlight_pistol","optic_MRD",["11Rnd_45ACP_Mag",11],[],""],["U_B_CombatUniform_mcam_tshirt",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrierSpec_mtp",[["SmokeShellPurple",10,1],["11Rnd_45ACP_Mag",3,11],["CUP_HandGrenade_M67",2,1],["immersion_pops_poppack",3,1],["murshun_cigs_cigpack",1,20],["murshun_cigs_lighter",1,100]]],["tf_rt1523g",[]],"H_MilCap_mcamo","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152_1","ItemCompass","tf_microdagr","NVGogglesB_grn_F"]]],
    
    
    
    //-----Squad_Leader-----//
    ["56RD MTP Squad Leader 6.5",[["arifle_MX_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],[],"bipod_01_F_blk"],[],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrierSpec_mtp",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",6,30]]],["tf_rt1523g",[["3Rnd_HE_Grenade_shell",4,3]]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Team_Leader-----//
    ["56RD MTP Team Leader 6.5",[["arifle_MX_GL_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],["3Rnd_HE_Grenade_shell",3],""],[],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrierGL_mtp",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",6,30],["3Rnd_HE_Grenade_shell",2,3]]],["B_AssaultPack_mcamo",[]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Autorifleman-----//
    ["56RD MTP Autorifleman 6.5",[["arifle_MX_SW_Black_F","","acc_pointer_IR","optic_Hamr",["100Rnd_65x39_caseless_black_mag",100],[],"bipod_01_F_blk"],[],[],["U_B_CombatUniform_mcam_tshirt",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrier1_rgr",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["100Rnd_65x39_caseless_black_mag",4,100]]],["B_AssaultPack_mcamo",[["ACE_EarPlugs",1]]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Ammo_Bearer-----//
    ["56RD MTP Ammo_Bearer 6.5",[["arifle_MX_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],[],"bipod_01_F_blk"],[],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrier1_rgr",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",10,30]]],["B_Carryall_mcamo",[["30Rnd_65x39_caseless_black_mag",20,30],["100Rnd_65x39_caseless_black_mag",4,100],["SmokeShellPurple",5,1]]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Medic-----//
    ["56RD MTP Medic 6.5",[["arifle_MXC_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],[],""],[],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrierSpec_mtp",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",6,30]]],["B_AssaultPack_mcamo",[["ACE_fieldDressing",35],["ACE_epinephrine",10],["ACE_morphine",10],["ACE_tourniquet",5],["ACE_bloodIV",8],["SmokeShellPurple",5,1]]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Rifleman_AT-----//
    ["56RD MTP Light AT 6.5",[["arifle_MX_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],[],"bipod_01_F_blk"],["CUP_launch_M136","","","",["ACE_PreloadedMissileDummy_CUP",1],[],""],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrier2_rgr",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",10,30]]],["B_AssaultPack_mcamo",[["ACE_EarPlugs",1],[["CUP_launch_M136","","","",[],[],""],1]]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]],
    
    
    
    //-----Rifleman-----//
    ["56RD MTP Rifleman 6.5",[["arifle_MX_Black_F","","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_black_mag",30],[],"bipod_01_F_blk"],[],[],["U_B_CombatUniform_mcam",[["ACE_CableTie",2],["ACE_EarPlugs",1],["ACE_morphine",5],["ACE_fieldDressing",19],["ACE_Flashlight_XL50",1],["ACE_tourniquet",2],["ACE_bloodIV",1]]],["V_PlateCarrier2_rgr",[["SmokeShellPurple",5,1],["HandGrenade",2,1],["30Rnd_65x39_caseless_black_mag",10,30]]],["B_AssaultPack_mcamo",[]],"H_HelmetSpecB_snakeskin","",["Binocular","","","",[],[],""],["ItemMap","ItemGPS","tf_anprc152","ItemCompass","ItemWatch","NVGogglesB_grn_F"]]]
    
    ];
    
    //----------LoadOuts End----------//
    
    //-------add loadouts to ace default------
    {[_x select 0,_x select 1] call ace_arsenal_fnc_addDefaultLoadout}forEach _allLoadOuts;
    
    //Copy and Paste the line below into your ingame arsenals to restrict items to those listed in the array
    
    ACE_ArsenalAllowedItems =["hgun_Pistol_heavy_01_F","acc_flashlight_pistol","optic_MRD","11Rnd_45ACP_Mag","U_B_CombatUniform_mcam_tshirt","ACE_CableTie","ACE_EarPlugs","ACE_morphine","ACE_fieldDressing","ACE_Flashlight_XL50","ACE_tourniquet","ACE_bloodIV","V_PlateCarrierSpec_mtp","SmokeShellPurple","CUP_HandGrenade_M67","immersion_pops_poppack","murshun_cigs_cigpack","murshun_cigs_lighter","tf_rt1523g","H_MilCap_mcamo","Binocular","ItemMap","ItemGPS","tf_anprc152_1","ItemCompass","tf_microdagr","NVGogglesB_grn_F","arifle_MX_Black_F","acc_pointer_IR","optic_Hamr","30Rnd_65x39_caseless_black_mag","bipod_01_F_blk","U_B_CombatUniform_mcam","HandGrenade","3Rnd_HE_Grenade_shell","H_HelmetSpecB_snakeskin","tf_anprc152","ItemWatch","arifle_MX_GL_Black_F","V_PlateCarrierGL_mtp","B_AssaultPack_mcamo","arifle_MX_SW_Black_F","100Rnd_65x39_caseless_black_mag","V_PlateCarrier1_rgr","B_Carryall_mcamo","arifle_MXC_Black_F","ACE_epinephrine","CUP_launch_M136","ACE_PreloadedMissileDummy_CUP","V_PlateCarrier2_rgr"];

     


    This is no longer working, we had a few weeks of success and it was great, nothing was changed on our end however the script for the loadouts is not being called. I can run null = execvm "56RDLoudouts.sqf" in game and it puts the loadouts in the "default loadouts" in the ace arsenal, what gives?


  16. Hi all, I had made a mission a while ago and it has been stable from that time up until this point. The premise is to have a few objects placed that have addactions in them allowing players to start various training scenarios. I will attach one of these objects with the addaction it contains in it's init below as well as the script that addaction executes.

    Obj init
     

    Spoiler
    
    this addaction ["Spawn Assault Force", {_this select 1;hint "Assault Force Spawned";playSound "Alarm_BLUFOR"; [] spawn {  _sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";  sleep 6.1;  deleteVehicle _sound; };execVM "AssaultAiSpawn.sqf"; ;} ];

     


    AssaultAISpawn.sqf
     

    Spoiler
    
    //_markers = allMapMarkers select {toUpper _x find "CONVOY" >= 0};
    if(!isServer)exitWith{
    _myunitarray = ["CUP_O_BMP_HQ_CSAT","O_APC_WHEELED_02_RCWS_V2_F","O_APC_TRACKED_02_CANNON_F","O_MBT_02_CANNON_F","O_MBT_04_CANNON_F"];
    _veh = selectRandom _myunitarray createVehicle getMarkerPos "ASSAULT1_1";
    _veh setDir 160;
    createVehicleCrew _veh;
    _veh3 = selectrandom _myunitarray createVehicle getMarkerPos "ASSAULT1_3";
    createVehicleCrew _veh3;
    _veh3 setDir 160;
    _veh4 = selectrandom _myunitarray createVehicle getMarkerPos "ASSAULT1_4";
    createVehicleCrew _veh4;
    _veh4 setDir 160;
    _veh5 = selectrandom _myunitarray createVehicle getMarkerPos "ASSAULT1_5";
    createVehicleCrew _veh5;
    _veh5 setDir 160;
    _veh6 = selectRandom _myunitarray createVehicle getMarkerPos "ASSAULT1_6";
    createVehicleCrew _veh6;
    _veh6 setDir 160;
    _veh2 = selectRandom _myunitarray createVehicle getMarkerPos "ASSAULT1_2";
    createVehicleCrew _veh2;
    _veh2 setDir 160;
    _veh7 = selectRandom _myunitarray createVehicle getMarkerPos "ASSAULT1_7";
    createVehicleCrew _veh7;
    _veh7 setDir 160;
    _veh8 = selectRandom _myunitarray createVehicle getMarkerPos "ASSAULT1_8";
    createVehicleCrew _veh8;
    _veh8 setDir 160;
    
    _veh2crew = crew _veh2; //this will give you an array which has the crew members.
    _veh3crew = crew _veh3;
    _veh4crew = crew _veh4;
    _veh5crew = crew _veh5;
    _veh6crew = crew _veh6;
    _veh7crew = crew _veh7;
    _veh8crew = crew _veh8;
    
    _vehgrp = group driver _veh; //you get the convoy leader's group with this little command
    _veh2crew join _vehgrp; //Array is needed for join command.
    _veh3crew join _vehgrp;
    _veh4crew join _vehgrp;
    _veh5crew join _vehgrp;
    _veh6crew join _vehgrp;
    _veh7crew join _vehgrp;
    _veh8crew join _vehgrp;
    
    
    			[_vehgrp, getMarkerPos "SLUGFEST1"] call bis_fnc_taskAttack;
    			[_vehgrp, 1] setWaypointSpeed "NORMAL";
    			[_vehgrp, 1] setWaypointCombatMode "RED";
    			[_vehgrp, 1] setWaypointBehaviour "SAFE";
    			[_vehgrp, 1] setWaypointFormation "LINE";
    
    			[_vehgrp, getMarkerPos "SLUGFEST2"] call bis_fnc_taskAttack;
    			[_vehgrp, 1] setWaypointSpeed "NORMAL";
    			[_vehgrp, 1] setWaypointCombatMode "RED";
    			[_vehgrp, 1] setWaypointBehaviour "SAFE";
    			[_vehgrp, 1] setWaypointFormation "LINE";
    
    			[_vehgrp, getMarkerPos "SLUGFEST3"] call bis_fnc_taskAttack;
    			[_vehgrp, 1] setWaypointSpeed "NORMAL";
    			[_vehgrp, 1] setWaypointCombatMode "RED";
    			[_vehgrp, 1] setWaypointBehaviour "SAFE";
    			[_vehgrp, 1] setWaypointFormation "LINE";
    };
    
    
    
    if ( "ASLT1" call BIS_fnc_taskExists ) then {
    		"ASLT1" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT1"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT1", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh;
    
    if ( "ASLT2" call BIS_fnc_taskExists ) then {
    		"ASLT2" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT2"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh2,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT2", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh2;
    
    if ( "ASLT3" call BIS_fnc_taskExists ) then {
    		"ASLT3" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT3"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh3,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT3", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh3;
    
    if ( "ASLT4" call BIS_fnc_taskExists ) then {
    		"ASLT4" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT4"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh4,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT4", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh4;
    
    if ( "ASLT5" call BIS_fnc_taskExists ) then {
    		"ASLT5" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT5"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh5,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT5", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh5;
    
    if ( "ASLT6" call BIS_fnc_taskExists ) then {
    		"ASLT6" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT6"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh6,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT6", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh6;
    
    if ( "ASLT7" call BIS_fnc_taskExists ) then {
    		"ASLT7" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT7"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh7,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT7", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh7;
    
    if ( "ASLT8" call BIS_fnc_taskExists ) then {
    		"ASLT1" call BIS_fnc_deleteTask
    	}; //delete any existing ASLT1
    
    [west,["ASLT8"],["A CSAT Assault force has landed near Lolisse. Intercept and Destroy the enemy.","Slug Fest","tank"],_veh8,1,3,true] call BIS_fnc_taskCreate;
    
    {
    		_x addEventHandler [ "Killed", {[ "ASLT8", "SUCCEEDED", true ] call BIS_fnc_taskSetState;}]
    }forEach units _veh8;

     

    And so, as the post title says, these scripts seem to be repeating depending on the number of players on the server when someone executes the addaction. i'm stumped because this did not use to happen and I cannot figure out what may have changed to cause this. If someone can see a problem in my code (I'm sure they are there) or can suggest a more secure/better way of allowing players to spawn preconfigured enemies please help me out! Thanks!

    P.S. There are a lot of people that have helped me this far and I am blatantly using their code, if you are one of them and you recognize your code, thank you!

×