Jump to content

Haymaker

Member
  • Content Count

    45
  • Joined

  • Last visited

  • Medals

Posts posted by Haymaker


  1. So I'm working on the conditional to the hold action to apply to civilians and other units. I have my mission running on my server and people are having the following issue. 

     

    I want the units to only have the hold action if they are conscious and restrained. Now I thought I had this fixed, but am currently away and not on a computer that can actually test this. They only get the action if they become unconscious. I've tested this without the negation and with false instead of true. I thought this worked but it isn't.

     

    I'd like to figure this out and replace this one script on the server so it works until I can get to it, could someone help my logic here?

     

    My issue is with this particularly:

    !(_target getVariable ['ACE_isUnconscious', true]);

    Or the whole script (I removed my script calls because they aren't necessary here):

    [_this,	//Object
    "talk to the civilian", //Text
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", //Initial icon
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", //Progress icon
    "(alive _target) && (typeOf vehicle _this == 'rhsusf_usmc_recon_marpat_d_rifleman_fast') && !(_target getVariable ['ACE_isUnconscious', true]);", //Condition show action
    "(alive _target) && (typeOf vehicle _this == 'rhsusf_usmc_recon_marpat_d_rifleman_fast') && !(_target getVariable ['ACE_isUnconscious', true]);", //Condition progress action
    {
    _anims = ["STAND_U1","STAND_U2","STAND_U3"];
    _anim = selectRandom _anims;
    [(_this select 0), "STAND_U1", "none"] call BIS_fnc_ambientAnim;
    }, //Code start
    {Hint "May I speak with you for a moment?";}, //Code progress
    {
    hint "Sure";
    }, //Code completed
    {Hint "Don't bother me again.";}, //Code interupted
    [], //Arguments
    2, //Duration
    0, //Priority
    true, //Remove when completed
    false //Show when unconscious
    ] remoteExec ["BIS_fnc_holdActionAdd", [0,-2] select isDedicated, true];

    Any help is greatly appreciated!

     

    -Haymaker


  2. Trying to get a killed unit to drop intel once killed. Script is executed on random spawned units. Take a look below but note that I am well aware that there are some variables changed for testing purposes. My issue is that for whatever reason, I get "type any, expected string" on the _spawnIntel line, which has been used prior successfully. I've tried using the position of "_unit", "killer", and "unit", each with no luck.

     

    Any help is much appreciated! Thanks!

    _unit = _this select 0;
    _intelPool = ["Land_Wallet_01_F","EvPhoto","EvMoney","EvMap","EvKobalt","EvMoscow","EvDogTags","Intel_File2_F","Leaflet_05_Old_F","Leaflet_05_New_F","Leaflet_05_F","Land_Camera_01_F","Land_HandyCam_F","Land_Laptop_F","Land_MobilePhone_smart_F","Land_MobilePhone_old_F","Land_PortableLongRangeRadio_F","Land_SatellitePhone_F","Land_Tablet_01_F"];
    
    if (1 > .5) then
    {
    	_unit addEventHandler ["killed", 
    	{	
    	// Get position of the killed unit
    	_position = position killer;
    
    	// Create intelligence at the position of the unit
    	_intel = selectRandom _intelPool;
    	_spawnIntel = createVehicle [_intel, _position, [], 0, "NONE"];
    
    	// Execute script on intel
    	_spawnIntel execVM "scripts\hm_hardIntel\hm_checkIntel.sqf";
    	}
    	];
    };

     


  3.  

    Not sure why I can't seem to get this to work. I get the script error "Type array, expected object, location". This also occurred when I tried to use modelToWorld. However, the script works correctly when executed on the player via debug console. Any help is much appreciated! Thanks!

    // Excerpted from another script of mine			
    
    // Create the random unit on position of the recruitment station
    _unit = _group createUnit [_unitType, _spawnPosition, [], 0, "FORM"];
    _unit execVM "scripts\hm_talibanLoadoutGenerator.sqf";
    
    // Create a flare soldier
    if (random 1 < .5) then 
    {							
         _unit addEventHandler ["firedNear", {_this execVM "scripts\flareSoldier.sqf";}];
    };
    // flareSoldier.sqf
    
    if (!isServer) exitWith {};
    
    _flares = ["F_40mm_red","F_40mm_green"];
    _flare = selectRandom _flares;
    
    if (daytime >= 18 || daytime < 6) then 
    {
    	_flareSpawn = _flare createVehicle position _this; 
    };

  4. 48 minutes ago, jonpas said:

    Yeah, try that, we had reports of that before and Arma itself had trouble in the past, but I am unsure if that was resolved. If that fixes it for him, an issue on GitHub would still be nice with a crash dump attached so we can investigate closer.

    Disabling Tobii worked! Thank you so much for your help!

     

    I'll also try to get my friend to recreate the issue and get a crash dump.

    • Thanks 1

  5. Not quite sure how to use the CBA garrison function and would like to avoid writing my own if I could avoid it.


    Error - Undefined variable in expression. #cba_fnc_waypointGarrison

     

    **Steps to reproduce:**
    - Script executed on an object (not entire script, there is a unit defined)

    _spawnPosition = position _this;
    _group = creategroup east;
    _unit = selectRandom _unitPool;                                            
    _unit createUnit[_spawnPosition, _group];
    _garrison = [_group, _spawnPosition] call cba_fnc_waypointGarrison;
    //Also tried: [_group, _group, 150, "MOVE", "AWARE", "YELLOW", "FULL", "COLUMN", "leader _GROUP spawn CBA_fnc_waypointGarrison", [3,6,9]] call CBA_fnc_addWaypoint;

    *CBA_A3/addons/ai/fnc_waypointGarrison.sqf*

     

    I'm assuming I'm calling this function wrong but can't seem to be able to find documentation or examples to help.

    Thanks.


  6. 2 hours ago, jonpas said:

    Sounds like something very specific. Any chance he can make an issue on GitHub with as much information as possible (hardware, operating system, other software, crash dump files... etc.)? Crash dump files would go a long way to see where the crash is originating from. Joining our Slack would be even better so we can communicate in a faster manner and maybe get him to test more specifically.

    EDIT: Is he by any chance running Tobii EyeX tracker?

    His laptop is actually running Tobii Eye Tracking, I can have him do that for you, but he's going to disable it, and/or uninstall, and give it a try first to see if that's the problem.


  7. My community is having a small issue with ACRE2. I've been a user of ACRE since early Arma 2, and I love the mod and prefer it over all other radio mods, and would like to have it as a dependency on my scripted game-mode which I will soon be releasing to the public.

     

    There is one specific player that is a part of our playgroup who cannot join any server while running ACRE2. He gets stuck in the loading screen on joining a server, and if he leaves it long enough, he gets a DXGI error. This occurs on both local host and dedicated. He reinstalled all of his mods, his game, verified integrity of game cache, updated all of his graphics drivers, and reinstalled DirectX. We are certain that this problem is strictly caused by ACRE2 because he can join servers without issue while running other mods, while if he is running only ACRE2, he cannot join.

     

    If there is any known fix or any help you can provide to us, that would be fantastic. Otherwise I'm afraid we will have to make a switch to TFAR (which I REALLY, REALLY, do not want to do).

     

    Thank you!


  8. On 1/17/2017 at 0:30 AM, JD Wang said:

    Is there any work going on with this mod at the moment?

     

    I really like the "random IED with trigger man" idea, but at the moment it looks like while you can select the class of trigger man, you can't select the class of vehicles it uses. So that means if you run a mission which doesn't use any vanilla vehicles, this mod becomes very hard to use, as any vanilla vehicles on the map will have been spawned by the modules, which means players are definitely going to be more cautious and check them out.

     

    Is there any way around this?  

    Mod has some serious potential but has unfortunately been remarkably broken for a long time.


  9. On 10/6/2016 at 6:58 AM, thedubl said:

    I looked at this for 5 minutes this morning, while having the morning coffee. Looks like this is finding wonky roads segments being return by roadConnectedTo (https://community.bistudio.com/wiki/roadsConnectedTo), which then leads to the rest breaking since the _connectedRoad var is not defined. I will see if I can do work around after work today.

    cosCore: ~129, ~185

    
    _tempPos=_roadPosArray select _rdCount;_rdCount=_rdCount+1;		_roadConnectedTo = roadsConnectedTo _tempPos;_connectedRoad = _roadConnectedTo select 0;_direction = [_tempPos, _connectedRoad] call BIS_fnc_DirTo;

    Any fixes yet? I changed direction to be  _direction = random 360; which makes it work, but at the expense of vehicles being lined up with the road.

    • Like 1

  10. 13 hours ago, pierremgi said:

    You need to apply the EH to an unit (or a vehicle). But your nearestObject (in this syntax) return a <null object>.

    You can try: (nearestObjects [_position, ["CAManBase"], 2]) select 0;

    or even better: _position nearEntities [_warlord,2] select 0;

     

    Why don't you use the first syntax for createUnit? You will not have to search for a nearest object.

    _cellLeader = _group createUnit [_warlord, _position,[],0,"NONE"];

    _cellLeader addEventHandler ["killed", {code}];

     

     

    Cheers! I'm going to have to credit you with all the help you've been giving me:drinking2:


  11. // _warlord is a unit classname, _position is a predetermined location, _group is a group (just clarifying)
    
    _warlord createUnit [_position, _group];
    
    _cellLeader = nearestObject [_position, _warlord];
    
    _cellLeader execVM "scripts\warlord.sqf";

     

    warlord.sqf:

    _this addEventHandler ["killed", {success = success - 1; Hint "You have killed a cell leader";}];

     

    Does absolutely nothing. I also tried adding the event handler to execute the script, with the script only containing the calculations (success = success - 1;).

     

    Not sure why I can't get this to work! All help is appreciated.


  12.                 // Determine nearestBuilding
                    _nearestBuilding = nearestBuilding _position; 
                    
                    // Create the warlord group
                    _group = createGroup East;
    				
    				// Issue occurs somewhere within the nested if
                    if (player distance _position > 400) then{
    
                        // Determine whether to spawn station in a building or outside
                        if (_nearestBuilding distance _position < 400) then {
                        
                            // Spawn a station in the nearestBuilding
                            _spawnFlag = createVehicle [_flag, _nearestBuilding buildingPos 1, [], 0, "NONE"];
                                                                      
                            // Spawn a cache in the nearestBuilding
                            _spawnCache = createVehicle [_cache, _nearestBuilding buildingPos 1, [], 0, "NONE"];
                                                                      
                        } else {
                                                                      
                            _cache = "CUP_TKVehicleBox_EP1";
                            _spawnflag = createVehicle [_flag, _position, [], 0, "NONE"];
                            _spawncache = createVehicle [_cache, _position, [], 0, "NONE"];
                            _spawntent = createVehicle ["Land_TentA_F", _position, [], 0, "NONE"];
                                                                      
                        };
                                                                      
                        _spawnVehicleStation = createVehicle [_vehicleStation, _position, [], 0, "NONE"];
                        _warlord createUnit [_position, _group];
                    };

    No I did not include the entire script because it isn't necessary, the problem that is occurring is occurring somewhere within this excerpt - so assume all undeclared variables have been declared.

     

    So I've been working on some dynamic spawning scripts for some insurgent objects. I added a nested if to determine whether to spawn some of the assets inside a building or outside. Now this works about half of the time, the other half of the time it only spawns "_warlord" and "_vehicleStation" in the location, and throws "_cache" and "_flag" to the origin. I'm assuming that this could be because it doesn't recognize certain buildings as enterable with positions, in which case I will just have to prepare an array of buildings to look for. 

     

    Any help or opinions are much appreciated. Thank you.


  13. 43 minutes ago, pierremgi said:

    The problem, proceeding this way, is your allUnits is not updated. The EH will be added on allUnits, once, then no chance for spawned units.

    Two ways as workaround:

    - make a loop and check for new unit(s) without EH (setVariable on the unit for example) as far as you don't want to add endlessly an EH on each unit;

    - use the mission EH "entityKilled" which scouts for any kill and apply a code when the unit dies.

     

    Spoiler

    //EVENT HANDLER TO TRACK DEAD CIVILIANS
    _unit addEventHandler["killed",{
    _unit=_this select 0;
    if (_this select 1 == player) then{
    success = success + 1;
    };

     

    Works now. Stupid mistake of mine. Thank you guys.


  14. 9 minutes ago, theend3r said:

    Could we have the luxury of getting just the part you want examined with nice formatting (i.e. indents and all)? I suspect the brackets aren't correct from my few seconds of copying it to Notepad++ (I might be wrong).

    I left the whole script in the same format because it's a script which allows you to add scripts to civilians spawned in by COS, that way whoever sees understands the context.


  15. Added to COS with a few other scripts, however, the eventhandler just does nothing. Any help is appreciated.

     

    See "//EVENT HANDLER TO TRACK DEAD CIVILIANS".

     

     

    Spoiler

    /*
    Add Script to individual units spawned by COS.
    _unit = unit. Refer to Unit as _unit.
    */

    _unit =(_this select 0);

    //THIS FINDS OUT WHAT MAP IS RUNNING AND WHAT SET OF HOUSES TO CHECK FOR
    //MAPS SUPPORTED: Stratis, Altis, Tanoa, Takistan, Zargabad, and Chernarus
    //You can easily add more maps to list by adjusting examples below
    if(isServer)then{
    switch(worldName)do{
    case "Stratis":{//IF map is Stratis = Altis/Stratis Houses
    nH_List=["Land_CarService_F","Land_Chapel_Small_V1_F","Land_Chapel_Small_V2_F","Land_Chapel_V1_F","Land_Chapel_V2_F","Land_d_Stone_Shed_V1_F","Land_FuelStation_Build_F","Land_FuelStation_Shed_F","Land_Hospital_main_F","Land_Hospital_side1_F","Land_Hospital_side2_F","Land_i_Addon_02_V1_F","Land_i_Addon_03mid_V1_F","Land_i_Addon_03_V1_F","Land_i_Addon_04_V1_F","Land_i_Barracks_V1_F","Land_i_Barracks_V2_F","Land_i_Garage_V1_F","Land_i_Garage_V2_F","Land_i_House_Big_01_V1_F","Land_i_House_Big_01_V2_F","Land_i_House_Big_01_V3_F","Land_i_House_Big_02_V1_F","Land_i_House_Big_02_V2_F","Land_i_House_Big_02_V3_F","Land_i_House_Small_01_V1_F","Land_i_House_Small_01_V2_F","Land_i_House_Small_01_V3_F","Land_i_House_Small_02_V1_F","Land_i_House_Small_02_V2_F","Land_i_House_Small_02_V3_F","Land_i_House_Small_03_V1_F","Land_i_Shed_Ind_F","Land_i_Shop_01_V1_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V3_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V3_F","Land_i_Stone_HouseBig_V1_F","Land_i_Stone_HouseBig_V2_F","Land_i_Stone_HouseBig_V3_F","Land_i_Stone_HouseSmall_V1_F","Land_i_Stone_HouseSmall_V2_F","Land_i_Stone_HouseSmall_V3_F","Land_i_Stone_Shed_V1_F","Land_i_Stone_Shed_V2_F","Land_i_Stone_Shed_V3_F","Land_Metal_Shed_F","Land_MilOffices_V1_F","Land_Offices_01_V1_F","Land_Slum_House01_F","Land_Slum_House02_F","Land_Slum_House03_F","Land_Unfinished_Building_01_F","Land_Unfinished_Building_02_F","Land_u_Addon_01_V1_F","Land_u_Addon_02_V1_F","Land_u_Barracks_V2_F","Land_u_House_Big_01_V1_F","Land_u_House_Big_02_V1_F","Land_u_House_Small_01_V1_F","Land_u_House_Small_02_V1_F","Land_u_Shed_Ind_F","Land_u_Shop_01_V1_F","Land_u_Shop_02_V1_F","Land_WIP_F"];
    };

    case "Altis":{//IF MAP IS ALTIS = Altis/Stratis Houses
    nH_List=["Land_CarService_F","Land_Chapel_Small_V1_F","Land_Chapel_Small_V2_F","Land_Chapel_V1_F","Land_Chapel_V2_F","Land_d_Stone_Shed_V1_F","Land_FuelStation_Build_F","Land_FuelStation_Shed_F","Land_Hospital_main_F","Land_Hospital_side1_F","Land_Hospital_side2_F","Land_i_Addon_02_V1_F","Land_i_Addon_03mid_V1_F","Land_i_Addon_03_V1_F","Land_i_Addon_04_V1_F","Land_i_Barracks_V1_F","Land_i_Barracks_V2_F","Land_i_Garage_V1_F","Land_i_Garage_V2_F","Land_i_House_Big_01_V1_F","Land_i_House_Big_01_V2_F","Land_i_House_Big_01_V3_F","Land_i_House_Big_02_V1_F","Land_i_House_Big_02_V2_F","Land_i_House_Big_02_V3_F","Land_i_House_Small_01_V1_F","Land_i_House_Small_01_V2_F","Land_i_House_Small_01_V3_F","Land_i_House_Small_02_V1_F","Land_i_House_Small_02_V2_F","Land_i_House_Small_02_V3_F","Land_i_House_Small_03_V1_F","Land_i_Shed_Ind_F","Land_i_Shop_01_V1_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V3_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V3_F","Land_i_Stone_HouseBig_V1_F","Land_i_Stone_HouseBig_V2_F","Land_i_Stone_HouseBig_V3_F","Land_i_Stone_HouseSmall_V1_F","Land_i_Stone_HouseSmall_V2_F","Land_i_Stone_HouseSmall_V3_F","Land_i_Stone_Shed_V1_F","Land_i_Stone_Shed_V2_F","Land_i_Stone_Shed_V3_F","Land_Metal_Shed_F","Land_MilOffices_V1_F","Land_Offices_01_V1_F","Land_Slum_House01_F","Land_Slum_House02_F","Land_Slum_House03_F","Land_Unfinished_Building_01_F","Land_Unfinished_Building_02_F","Land_u_Addon_01_V1_F","Land_u_Addon_02_V1_F","Land_u_Barracks_V2_F","Land_u_House_Big_01_V1_F","Land_u_House_Big_02_V1_F","Land_u_House_Small_01_V1_F","Land_u_House_Small_02_V1_F","Land_u_Shed_Ind_F","Land_u_Shop_01_V1_F","Land_u_Shop_02_V1_F","Land_WIP_F"];
    };

    case "Tanoa":{//IF MAP IS TANOA = Tanoa Houses
    nH_List=["Land_Airport_02_terminal_F","Land_House_Big_04_F","Land_House_Small_04_F","Land_House_Small_05_F","Land_Shop_City_01_F","Land_Shop_City_02_F","Land_Addon_04_F","Land_Shop_City_05_F","Land_School_01_F","Land_House_Big_03_F","Land_House_Native_01_F","Land_House_Native_02_F","Land_Temple_Native_01_F","Land_SM_01_shed_F","Land_Warehouse_03_F","Land_Barracks_01_dilapidated_F","Land_Barracks_01_grey_F","Land_Barracks_01_camo_F","Land_Cathedral_01_F","Land_GuardHouse_01_F","Land_FuelStation_01_shop_F","Land_FuelStation_01_workshop_F","Land_FuelStation_02_workshop_F","Land_Hotel_01_F","Land_Hotel_02_F","Land_Supermarket_01_F","Land_House_Small_02_F","Land_House_Big_02_F","Land_House_Small_03_F","Land_House_Small_06_F","Land_House_Big_01_F","Land_Shed_07_F","Land_Shed_05_F","Land_Shed_02_F","Land_Slum_05_F","Land_Slum_02_F","Land_Slum_01_F","Land_GarageShelter_01_F","Land_Shop_Town_03_F","Land_Shop_Town_05_F","Land_Shop_Town_01_F","Land_House_Small_01_F","Land_Slum_03_F","Land_Slum_04_F","Land_Shed_01_F","Land_Shed_04_F"];
    };

    case "Takistan":{//IF MAP IS TAKISTAN = Middle Eastern Houses
    nH_List=["Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_2_EP1","Land_House_L_3_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1","Land_House_L_9_EP1","Land_House_C_1_EP1","Land_House_C_1_v2_EP1","Land_House_C_2_EP1","Land_House_C_3_EP1","Land_House_C_4_EP1","Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_10_EP1","Land_House_C_11_EP1","Land_House_C_12_EP1","Land_A_Mosque_small_1_EP1","Land_A_Mosque_small_2_EP1","Land_A_Mosque_big_addon_EP1","Land_A_Mosque_big_hq_EP1"];
    };

    case "Lythium":{//IF MAP IS LYTHIUM = Middle Eastern Houses
    nH_List=["Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_2_EP1","Land_House_L_3_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1","Land_House_L_9_EP1","Land_House_C_1_EP1","Land_House_C_1_v2_EP1","Land_House_C_2_EP1","Land_House_C_3_EP1","Land_House_C_4_EP1","Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_10_EP1","Land_House_C_11_EP1","Land_House_C_12_EP1","Land_A_Mosque_small_1_EP1","Land_A_Mosque_small_2_EP1","Land_A_Mosque_big_addon_EP1","Land_A_Mosque_big_hq_EP1"];
    };

    case "Zargabad":{//IF MAP IS ZARGABAD = Middle Eastern Houses
    nH_List=["Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_2_EP1","Land_House_L_3_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1","Land_House_L_9_EP1","Land_House_C_1_EP1","Land_House_C_1_v2_EP1","Land_House_C_2_EP1","Land_House_C_3_EP1","Land_House_C_4_EP1","Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_10_EP1","Land_House_C_11_EP1","Land_House_C_12_EP1","Land_A_Mosque_small_1_EP1","Land_A_Mosque_small_2_EP1","Land_A_Mosque_big_addon_EP1","Land_A_Mosque_big_hq_EP1"];
    };

    case "Chernarus":{//IF MAP IS CHERNARUS = Chernarus buildings
    nH_List=["Land_A_BuildingWIP","Land_A_FuelStation_Build","Land_A_GeneralStore_01","Land_A_GeneralStore_01a","Land_A_Hospital","Land_A_Pub_01","Land_a_stationhouse","Land_Barn_Metal","Land_Barn_W_01","Land_Church_03","Land_Farm_Cowshed_a","Land_Farm_Cowshed_b","Land_Farm_Cowshed_c","Land_Hlidac_budka","Land_HouseBlock_A1","Land_HouseB_Tenement","Land_HouseV2_01A","Land_HouseV2_02_Interier","Land_HouseV2_04_interier","Land_HouseV_1I1","Land_HouseV_1I4","Land_HouseV_1L1","Land_HouseV_1L2","Land_HouseV_2L","Land_Ind_Garage01","Land_Ind_Workshop01_01","Land_Ind_Workshop01_02","Land_Ind_Workshop01_04","Land_Ind_Workshop01_L","Land_kulna","Land_Mil_Barracks_i","Land_Mil_ControlTower","Land_Panelak","Land_Panelak2","Land_Rail_House_01","Land_rail_station_big","Land_Shed_Ind02","Land_Shed_W01","Land_stodola_old_open","Land_Tovarna2","Land_vez"];
    };

    default{//If any of the above maps aren't detected, default select A2 Takistan houses
    nH_List=["Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_2_EP1","Land_House_L_3_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1","Land_House_L_9_EP1","Land_House_C_1_EP1","Land_House_C_1_v2_EP1","Land_House_C_2_EP1","Land_House_C_3_EP1","Land_House_C_4_EP1","Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_10_EP1","Land_House_C_11_EP1","Land_House_C_12_EP1","Land_A_Mosque_small_1_EP1","Land_A_Mosque_small_2_EP1","Land_A_Mosque_big_addon_EP1","Land_A_Mosque_big_hq_EP1"];
    };
    publicVariable "nH_List";
    };


    //THIS IS THE EVENTHANDLER THAT MAKES THE CIVILIANS FLEE
    {if(side _x==civilian)then{
    _x addEventHandler["FiredNear",{
    _civ=_this select 0;

        switch(round(random 2))do{
            case 0:{_civ switchMove "ApanPercMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
            case 1:{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
            case 2:{_civ playMoveNow "ApanPpneMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
            default{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};};

    //nearestObjects[ PositionOrTarget, ["List","Of","Classnames","To","Look","For"], MaxDistanceToSearchAroundTarget ];
    _nH=nearestObjects[_civ,nH_List,100];


    _H=selectRandom _nH;//Pick an object found in the above nearestObjects array

    _HP=_H buildingPos -1;//Finds list of all available building positions in the selected building

    _HP=selectRandom _HP;//Picks a building position from the list of building positions

    _civ doMove _HP;//Orders the civilian to move to the building position

    //Remove the eventHandler to prevent spamming
    _civ removeAllEventHandlers "FiredNear";}];};
    }forEach allUnits-switchableUnits-playableUnits
    };

    //EVENT HANDLER TO TRACK DEAD CIVILIANS
    {if(side _x==civilian)then{
    _x addEventHandler["killed",{
    _civ=_this select 0;

    if (_this select 1 == player) then{
    success = success + 1;
    };

    //Remove the eventHandler to prevent spamming
    _civ removeAllEventHandlers "Killed";}];
    }forEach allUnits-switchableUnits-playableUnits
    };

    params["_unit"];
    _d = [_unit, 300, 1] call Saro_fnc_bomber;


  16. 50 minutes ago, sarogahtyp said:

    this errors meaning is as it is described in that error message.

    It means that an argument of nearRoads should be a number but it is not.

    just look at the wiki: nearRoads

    the only argument which has to be a number is the radius.

    in ur error message the radius is this: (_mSize + _rad)

    it seems that this expression is no number and you should check that...

     

    I suppose_mSize isn't being properly stored because of the map change, because _mSize is derived from _sizeX and _sizeY which are declared from map config. So in order to work around it I've commented out those lines and manually inputted my own numbers _sizeX and _sizeY.

     

    This gets the script running, although my initial thought was that _mSize was indicating the entire map's size, but it seems like it's an indication of the spawn radius instead. I'm experimenting with different values because it seems that they interfere with the manner of which the script works very, very much. 

     


  17. So I'm working on a script that randomly creates groups of units of random size and make by a series of loops. To keep things short, here is my current problem area:

     

     

    Primarily note that these are snippets taken from the code taken sequentially.

    	_randomPatrol = '[_group, _position, random 800] call BIS_fnc_taskPatrol';
    	_garrison = '[_group, _position, random 300, 3, true] call CBA_fnc_taskDefend';
    	_behaviorPool = [_randomPatrol, _garrison];
    
    	// Group random patrol or garrison function
    	_randomBehavior = selectRandom _behaviorPool;
    

    What I want to do is make it a random pick of whether units are tasked with defending a location, or patrolling the location. It works when I set it so that all of the units garrison, or all of the units patrol, but not for randomizing it. I'm assuming it's a problem with array or something?

     

    Any help is appreciated, thanks.

×