Jump to content

lawman_actual

Member
  • Content Count

    258
  • Joined

  • Last visited

  • Medals

Everything posted by lawman_actual

  1. lawman_actual

    Help: Basics of GUI building

    Thanks everyone. I'll have another go tomorrow/this weekend and report back if I'm still experiencing problems
  2. lawman_actual

    Help: Basics of GUI building

    Many thanks Kingsley, this makes things a little clearer. So is it correct to assume you define one of each used control type in defines? And then in dialogs.hpp, is it only fields that you change that differ from those used in defines? I guess I'm still not sure what is required and what isn't in the dialogues.hpp (though I haven't had a chance to mess around with it yet). Many thanks to everyone for your help on this. I'd be pulling my hair out without someone to ask for help on this one
  3. lawman_actual

    Help: Basics of GUI building

    EDIT: Example error messages. The following were retrieved after copying your example defines.hpp and the direct output from my GUI Editor save. It confuses me that controls defined in the in-game editor have error messages coming up: 21:03:33 Warning Message: No entry 'C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/combo_entity.ComboScrollBar'. 21:03:33 Warning Message: No entry 'C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/combo_supportType.ComboScrollBar'. 21:03:33 Error loading control C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/text_location/ 21:03:33 Error loading control C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/button_myPos/ 21:03:33 Error loading control C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/frame_referencePosition/ 21:03:33 Error loading control C:\Users\ME\Documents\Arma 3\missions\Combat%20Test%2003.Altis\description.ext/firemissionform1/controls/text_supporting/
  4. lawman_actual

    Help: Basics of GUI building

    Hi Icaruk Yes, I have #include "defines.hpp" In my description. I was looking for a little more help than that. I understand what KK is saying about styles and whatnot, but I'm not sure what pieces of 'defining code' to put where for the controls. I don't really understand how the stuff going in "defines.hpp" relates to "dialogues.hpp" and how sometimes the two seem to clash whereas sometimes they don't. And to clarify, I did use the GUI editor in game and obtained some code for various frames and texts. I believe this was it, though I've modified so many things since I can't be 100% sure this is the direct output from the in-game editor class firemissionform1 { idd=-1; movingenable = false; class controls { //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT START (by Lawman, v1.063, #Sufery) //////////////////////////////////////////////////////// class mainframe1: RscFrame { //colorBackground[] = {0,0,0,0}; idc = 1800; type = 0; text = "Request Fire Mission"; //--- ToDo: Localize; x = 0.396875 * safezoneW + safezoneX; y = 0.28 * safezoneH + safezoneY; w = 0.20625 * safezoneW; h = 0.407 * safezoneH; colorText[] = {0,0,0,1}; }; class text_entity: RscText { idc = 1000; text = "Entity"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.357 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.022 * safezoneH; }; class combo_entity: RscCombo { idc = 2100; x = 0.489687 * safezoneW + safezoneX; y = 0.357 * safezoneH + safezoneY; w = 0.0979687 * safezoneW; h = 0.022 * safezoneH; colorBackground[] = {0,0,0,0.25}; }; class text_supportType: RscText { idc = 1001; text = "Support Type"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.401 * safezoneH + safezoneY; w = 0.061875 * safezoneW; h = 0.022 * safezoneH; }; class combo_supportType: RscCombo { idc = 2101; x = 0.489687 * safezoneW + safezoneX; y = 0.401 * safezoneH + safezoneY; w = 0.0979687 * safezoneW; h = 0.022 * safezoneH; colorBackground[] = {0,0,0,0.25}; }; class text_location: RscText { idc = 1002; text = "Mission Location"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.489 * safezoneH + safezoneY; w = 0.061875 * safezoneW; h = 0.022 * safezoneH; colorText[] = {0,0,0,1}; sizeEx = 0.75 * GUI_GRID_H; }; class text_x: RscText { idc = 1003; text = "X:"; //--- ToDo: Localize; x = 0.5 * safezoneW + safezoneX; y = 0.533 * safezoneH + safezoneY; w = 0.0154688 * safezoneW; h = 0.022 * safezoneH; colorText[] = {0,0,0,1}; }; class text_xEntry: RscText { idc = 1004; text = "00000"; //--- ToDo: Localize; x = 0.510312 * safezoneW + safezoneX; y = 0.533 * safezoneH + safezoneY; w = 0.0309375 * safezoneW; h = 0.022 * safezoneH; }; class RscText_1005: RscText { idc = 1005; text = "Y:"; //--- ToDo: Localize; x = 0.54125 * safezoneW + safezoneX; y = 0.533 * safezoneH + safezoneY; w = 0.0154688 * safezoneW; h = 0.022 * safezoneH; colorText[] = {0,0,0,1}; }; class RscText_1006: RscText { idc = 1006; text = "00000"; //--- ToDo: Localize; x = 0.551562 * safezoneW + safezoneX; y = 0.533 * safezoneH + safezoneY; w = 0.0309375 * safezoneW; h = 0.022 * safezoneH; }; class button_myPos: RscButton { idc = 1600; text = "Use Current Position"; //--- ToDo: Localize; x = 0.5 * safezoneW + safezoneX; y = 0.566 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.011 * safezoneH; colorBackground[] = {0,0,0,0.35}; colorActive[] = {-1,-1,-1,0.5}; sizeEx = 0.4 * GUI_GRID_H; }; class frame_referencePosition: RscFrame { idc = 1801; x = 20 * GUI_GRID_W + GUI_GRID_X; y = 14 * GUI_GRID_H + GUI_GRID_Y; w = 8.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; colorText[] = {0,0,0,1}; colorBackground[] = {0,0,0,0.35}; }; class text_distance: RscText { idc = 1007; text = "Range"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.599 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.022 * safezoneH; }; class text_rangeInput: RscText { idc = 1008; text = "300"; //--- ToDo: Localize; x = 0.5 * safezoneW + safezoneX; y = 0.599 * safezoneH + safezoneY; w = 0.0257812 * safezoneW; h = 0.022 * safezoneH; }; class text_m: RscText { idc = 1009; text = "m"; //--- ToDo: Localize; x = 0.520625 * safezoneW + safezoneX; y = 0.599 * safezoneH + safezoneY; w = 0.0154688 * safezoneW; h = 0.022 * safezoneH; colorText[] = {0,0,0,1}; }; class text_bearing: RscText { idc = 1010; text = "Bearing"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.643 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.022 * safezoneH; }; class bearing_input: RscText { idc = 1011; text = "210"; //--- ToDo: Localize; x = 0.5 * safezoneW + safezoneX; y = 0.643 * safezoneH + safezoneY; w = 0.0257812 * safezoneW; h = 0.022 * safezoneH; }; class text_reference: RscText { idc = 1012; text = "Reference Point"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.533 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.022 * safezoneH; }; class text_supporting: RscText { idc = 1013; text = "Supporting Unit"; //--- ToDo: Localize; x = 0.407187 * safezoneW + safezoneX; y = 0.313 * safezoneH + safezoneY; w = 0.061875 * safezoneW; h = 0.022 * safezoneH; colorText[] = {0,0,0,1}; sizeEx = 0.75 * GUI_GRID_H; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// }; }; Simply combining this with a defines.hpp didn't seem to run though
  5. I have a group moving to a waypoint, at which point they leave the vehicle and are assigned a move command to their next objective. I had to write a script to re-define the handle for the vehicle and units because it is part of a procedural script where these handles are reused for multiple deployments. w_unload = hemttcrew addWaypoint [_startdeploy, 1]; w_unload setWaypointType "MOVE"; hemttcrew setCurrentWaypoint w_unload; if (chosenside == 0) then { potentialunits = potentialunits + units _newgroup; } else {}; w_unload setWaypointStatements ["true", " _myvehicle = (vehicle this); _myvehicle lock false; _incargo = +units(group (assignedGunner _myvehicle)); alphagroup = group (assignedDriver _myvehicle); player sideChat (format['%1',_incargo]); _aunit = +_incargo call BIS_fnc_selectRandom; { doGetOut _x} foreach _incargo; {_x leaveVehicle _myvehicle} foreach _incargo; _endof = count assignmentus; for '_a' from 0 to _endof do { _ismine = (assignmentop select _a) find _aunit; if (_ismine > -1) then {_number = _a; objnumb = +_number;_a = _endof;} else {}; }; _thisobj = markerlist select objnumb; objpos = getMarkerPos _thisobj; if (player in _incargo) then {_thisobj setMarkerAlpha 1;} else {}; alphaobj = alphagroup addWaypoint [objpos, 25]; alphaobj setWaypointType 'SAD'; alphaobj setWaypointCombatMode 'RED'; alphagroup setCurrentWaypoint alphaobj;"]; The script works fine, the units reach their objective, leave the vehicle and go to the correct objective. But I keep getting a little message flash up saying there is an error with the BIS_fnc_selectRandom because the array has no values. I got the player to sideChat the value for _incargo to ensure it was properly determining who was 'in cargo' (which in this case is anyone in the vehicle, as everyone needs to get out). It worked fine, calling out 4 units. But oddly, it then called out an empty array as well. The script seems to be called twice, and the second time the array for _incargo is empty, which would explain why the BIS_fnc_selectRandom was playing up. After some tests, it seems that using _myvehicle to determine who's _incargo works fine as long as the unit is still in the vehicle. After the units leave the vehicle _myvehicle changes to the actual vehicle, which could be messing things up. It's almost as if the way point is being completed twice, one time when the units are still in the vehicle and once when they exit. I was hoping someone could shed a little more light on this.
  6. Afternoon I need to be able to reassign a unit after it's completed it's Waypoint. I have achieved this easily enough for units I know about from the start by writing a unique handle for each one, but I'm not sure how to achieve this for units procedurally generated in-mission. I made a test scenario to try out the concept so you can see what I mean. Here was my first test; testscript.sqf for "_i" from 1 to 3 step 1 do { _newgroup = createGroup west; _unit = _newgroup createUnit ["B_Soldier_GL_F",getMarkerPos "marker2",[],0.5,"CORPORAL"]; _goal = _newgroup addWaypoint [getMarkerPos "marker1", 5]; _goal setWaypointType "MOVE"; _newgroup setCurrentWaypoint _goal; _goal setWaypointStatements ["True","deleteVehicle _unit"]; sleep 10; }; As you can see, as part of a cycle, three units are generated and assigned a waypoint. On reaching that waypoint _unit is deleted. The problem with this was that _unit was constantly being redefined when the next unit was created. The result was that when unit 1 reached it's waypoint, unit 3 was being deleted. So I attempted creating a unique handle for each by concatenating a variable that changed after each pass; numbercounter = 1; for "_i" from 1 to 3 step 1 do { _newgroup = createGroup west; _unit = Format["unit_%1", numbercounter]; _goal = Format["goal_%1", numbercounter]; _unit = _newgroup createUnit ["B_Soldier_GL_F",getMarkerPos "marker2",[],0.5,"CORPORAL"]; _goal = _newgroup addWaypoint [getMarkerPos "marker1", 5]; _goal setWaypointType "MOVE"; _newgroup setCurrentWaypoint _goal; _goal setWaypointStatements ["True","Format['deleteVehicle unit_%1', numbercounter];"]; numbercounter = numbercounter + 1; sleep 2; }; Although this didn't show any errors, it's not deleting any units. In any case, I'm not sure when this script would be concatenating the numbercounter variable. Would it be as the waypoint statement is set (in which case the number would be the correct one) or as the waypoint statement script is called (in which case the number would again refer to the last created unit) Anyhow, this doesn't seem like a great way of doing it as I'm going to end up with bucket-loads of "unit_x" variables. Any other ideas very welcome! Best, Lawman
  7. lawman_actual

    Stored array being corrupted?

    Ahh, ok that might explain some errors I've had in the past. Thanks once again
  8. Well I'm stumped. As part of my script I'm using arrays to store information about who's doing what: // Objective: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] condition = [ 1, 1, 1, 1, 1, 0, 0, -1, -1, -1, -1, -1, 0]; redarray = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; bluearray = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; usattacking = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; opattacking = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; speak = usattacking; The 'speak' line is there because I suspected the array was somehow not behaving as expected. I have a trigger that side Chat's "speak". But when I do this, the array doesn't return as expected (all zeros) Instead, I get the following: [0,0,0,0,0, Scalar NaN, Scalar NaN, 0,0,0,0,0,Scalar NaN] What the *bleep* could cause the values to change like this? ---------- Post added at 18:45 ---------- Previous post was at 17:59 ---------- Help please :rolleyes:
  9. lawman_actual

    Stored array being corrupted?

    I'm not sure I follow you? These are the only times I reference us attacking after creating the array and assigning speak to it: if ((([b]usattacking select _trial[/b]) + _register) <= maxatobj) then {numbhandle = _trial; _x = 20;} else {_alist = _alist - _subject;}; _current = [b]usattacking select numbhandle[/b]; [b]usattacking set [numbhandle, _new];[/b] I don't see where I would need to make a copy ---------- Post added at 19:02 ---------- Previous post was at 18:46 ---------- I think I see what you're saying now. I had been modifying usstarts which was throwing things off with usattacking. Many thanks Killzone! Here's the script that seems to be working (though I'm sure it isn't flawless) for "_x" from 1 to 20 step 1 do { register = 12; _alist = +usstarts; _subject = [_alist call BIS_fnc_selectRandom]; _trial = (markerlist find (_subject select 0)); if (((usattacking select _trial) + register) <= maxatobj) then {numbhandle = _trial; _x = 20;} else {_alist = _alist - _subject;}; }; newobj = markerlist select numbhandle; _current = usattacking select numbhandle; _new = _current + register; usattacking set [numbhandle, _new]; _x = 20; //END OF FOR I FROM// };
  10. Placing commandStop unitName in the on act field of the waypoint at which you want the order issued will achieve this. This will mean that the following will be called when the waypoint is 'completed' (when units reach the waypoint in the case of MOVE waypoints) commandStop unitname You will have to decide how you then want to move your units to the next location though. In place of unit name type the name of the leader of the group you want to stop, and he will order units under his control to stop
  11. lawman_actual

    Stored array being corrupted?

    Fair point. Guess I was tired >_< Here's a bit more of the .init. There's a big gap in it that won't make much sense because I was in the middle of copying a script I wrote separately into it init.sqf: //***** MISSION STARTUP *****// chosenside = 1; obj = 0; initAmbientLife; usattacking = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; opattacking = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; //*****GENERIC DEPLOYMENT SCRIPT*****// //___US DEPLOYMENT___/ //US VEHICLES = ["B_MRAP_01_F","B_APC_Wheeled_01_cannon_F","B_Heli_Transport_01_camo_F","B_Truck_01_transport_F"]; // (HUNTER) (MARSHALL) (UH-80) (HEMTT) for "_i" from 0 to 15 do { player setPosATL [20000,20000,500]; if (ustickets <= 11) then {setchoice = [4,8];} else {}; if (ustickets < 8) then {setchoice = [4];} else {setchoice = [4,8,12];}; setchoice = setchoice call BIS_fnc_selectRandom; if (setchoice == 4) then {_h_vehicle = 1;} else { if (setchoice == 8) then {_a_vehiclechoice = [2,3];_h_vehicle = _a_vehiclechoice call BIS_fnc_selectRandom;} else {_h_vehicle = 4;}; }; //[VEHICLE 4: HEMTT] for "_x" from 1 to 20 step 1 do { _register = 12; _alist = usstarts; _subject = [_alist call BIS_fnc_selectRandom]; _trial = (markerlist find (_subject select 0)); if (((usattacking select _trial) + _register) <= maxatobj) then {numbhandle = _trial; _x = 20;} else {_alist = _alist - _subject;}; }; newobj = markerlist select numbhandle; _current = usattacking select numbhandle; _new = _current + _register; usattacking set [numbhandle, _new]; //END OF FOR I FROM// };
  12. Hi Caleb commandStop sounds like it might be what you're after: https://community.bistudio.com/wiki/commandStop This will issue the stop order in conjunction with an audible command, as opposed to doStop which is silent. Let me know if you are unsure how or where to use this command. ---------- Post added at 19:36 ---------- Previous post was at 19:31 ---------- As for finding cover, I do not see a command to order units to find cover such as you might do using the command menu in game. You could experiment with a waypoint. Setting waypoint type to something like HOLD with COMBAT behaviour would likely cause units to move to cover, or you could set to STEALTH if you wanted them to take cover and try not to be detected
  13. Don't mind me. Just being an idiot
  14. Apologies. Here is a little more of the script. _register = 12; _alist = usstarts; for "_i" from 1 to 20 step 1 do { _subject = [_alist call BIS_fnc_selectRandom]; _trial = (markerlist find (_subject select 0)); if (((usattacking select _trial) + _register) <= maxatobj) then {numbhandle = _trial; _i = 20;} else {_alist = _alist - _subject;}; }; newobj = markerlist select numbhandle; _current = usattacking select numbhandle; _new = _current + _register; usattacking set [numbhandle, _new]; _obj13pos1 = getMarkerPos newobj; _xpos13one = _obj13pos1 select 0; _ypos13one = _obj13pos1 select 1; _zpos13one = _obj13pos1 select 2; _location13one = [_xpos13one, _ypos13one, _zpos13one]; _distvar13one = [200,400] call BIS_fnc_randomInt; _greenzone13one = [(getMarkerPos newobj), (getMarkerPos "usfob")] call BIS_fnc_dirTo; _dirvar13one = [(_greenzone13one - 50), (_greenzone13one + 50)] call BIS_fnc_randomInt; _spawn13one = _distvar13one + 250; _startspawn13one = [_location13one, _spawn13one, _dirvar13one] call BIS_fnc_relPos; _location13one = [_xpos13one, _ypos13one, 0]; _startdeploy13one = [_location13one, _distvar13one, _dirvar13one] call BIS_fnc_relPos; _ATLZ13one = 0; _modATLZ13one = 1; for "_i" from 1 to 20 step 1 do { _intersectN13one = lineIntersectsWith [[(_startspawn13one select 0), (_startspawn13one select 1) + 2, _modATLZ13one], [(_startspawn13one select 0) + 0.2, (_startspawn13one select 1) + 2.2, _ATLZ13one + 0.25], objNull, objNull, false]; _intersectE13one = lineIntersectsWith [[(_startspawn13one select 0) + 2, (_startspawn13one select 1), _modATLZ13one], [(_startspawn13one select 0) + 2.2, (_startspawn13one select 1) + 0.2, _ATLZ13one + 0.25], objNull, objNull, false]; _intersectS13one = lineIntersectsWith [[(_startspawn13one select 0), (_startspawn13one select 1) - 1, _modATLZ13one], [(_startspawn13one select 0) - 0.2, (_startspawn13one select 1) - 2.2, _ATLZ13one + 0.25], objNull, objNull, false]; _intersectW13one = lineIntersectsWith [[(_startspawn13one select 0) - 2, (_startspawn13one select 1), _modATLZ13one], [(_startspawn13one select 0) - 2.2, (_startspawn13one select 1) - 0.2, _ATLZ13one + 0.25], objNull, objNull, false]; _intersectC13one = lineIntersectsWith [[(_startspawn13one select 0), (_startspawn13one select 1), _modATLZ13one], [(_startspawn13one select 0) + 0.1, (_startspawn13one select 1) + 0.1, _ATLZ13one + 0.25], objNull, objNull, false]; isclear = 0; treecheck = nearestObjects [_startdeploy13one, ["building","wall"], 20]; if (count treecheck >= 1) then {} else {isclear = 1;}; if (count _intersectN13one <= 0 && count _intersectE13one <= 0 && count _intersectS13one <= 0 && count _intersectW13one <= 0 && count _intersectC13one <= 0 && isclear == 1) then {_i = 20} else { _dismodifier = [15,30] call BIS_fnc_randomInt; _dirmodifier = [(_greenzone13one-50), (_greenzone13one+50)] call BIS_fnc_randomInt; _startspawn13one = [_startspawn13one, _dismodifier, _dirmodifier] call BIS_fnc_relPos; }; }; //B_Truck_01_covered_F also possible starthemtt13one = createVehicle ["B_Truck_01_transport_F", _startspawn13one, [], 0, "NONE"]; createVehicleCrew starthemtt13one; hemttcrew13one = group leader starthemtt13one; hemttcrew13one allowFleeing 0; starthemtt13one setDir ([(getPos starthemtt13one), (getMarkerPos newobj)] call BIS_fnc_dirTo); hemttcrew13one setCombatMode "BLUE"; unload13one = hemttcrew13one addWaypoint [_startdeploy13one, 1]; unload13one setWaypointType "MOVE"; hemttcrew13one setCurrentWaypoint unload13one; deploygroup2a = group dag2a1; deploygroup2b = group dag2b1; deploygroup2c = group dag2c1; unload13one setWaypointStatements ["true", "starthemtt13one lock false; doGetOut [dag2a1,dag2a2,dag2a3,dag2a4,dag2b1,dag2b2,dag2b3,dag2b4,dag2c1,dag2c2,dag2c3,dag2c4]; dag2a1 leaveVehicle starthemtt13one; dag2a2 leaveVehicle starthemtt13one; dag2a3 leaveVehicle starthemtt13one; dag2a4 leaveVehicle starthemtt13one; dag2b1 leaveVehicle starthemtt13one; dag2b2 leaveVehicle starthemtt13one; dag2b3 leaveVehicle starthemtt13one; dag2b4 leaveVehicle starthemtt13one; dag2c1 leaveVehicle starthemtt13one; dag2c2 leaveVehicle starthemtt13one; dag2c3 leaveVehicle starthemtt13one; dag2c4 leaveVehicle starthemtt13one; obj13pos1 = getMarkerPos newobj; dag2aobj = deploygroup2a addWaypoint [obj13pos1, 1]; dag2aobj setWaypointType 'SAD'; dag2aobj setWaypointCombatMode 'RED'; deploygroup2a setCurrentWaypoint dag2aobj; dag2bobj = deploygroup2b addWaypoint [obj13pos1, 1]; dag2bobj setWaypointType 'SAD'; dag2bobj setWaypointCombatMode 'RED'; deploygroup2b setCurrentWaypoint dag2bobj; dag2cobj = deploygroup2c addWaypoint [obj13pos1, 1]; dag2cobj setWaypointType 'SAD'; dag2cobj setWaypointCombatMode 'RED'; deploygroup2c setCurrentWaypoint dag2cobj; _usrtb13one = getMarkerPos 'usdeploymark'; _hemttrtb13one = hemttcrew13one addWaypoint [_usrtb13one, 1]; _hemttrtb13one setWaypointType 'MOVE'; _hemttrtb13one setWaypointStatements ['true', '{starthemtt13one deleteVehicleCrew _x} forEach crew starthemtt13one; deleteVehicle starthemtt13one;']; if (group player == group dag2a1 || group player == group dag2b1 || group player == group dag2c1) then { newobj setMarkerAlpha 1; } else {}; "]; //_usrtb13one = getMarkerPos "usdeploymark"; //_hemttrtb13one = hemttcrew13one addWaypoint [_usrtb13one, 1]; //_hemttrtb13one setWaypointType "MOVE"; //_hemttrtb13one setWaypointStatements ["true", "{starthemtt13one deleteVehicleCrew _x} forEach crew starthemtt13one; deleteVehicle starthemtt13one;"]; dag2a1 moveInCargo starthemtt13one; dag2a2 moveInCargo starthemtt13one; dag2a3 moveInCargo starthemtt13one; dag2a4 moveInCargo starthemtt13one; dag2b1 moveInCargo starthemtt13one; dag2b2 moveInCargo starthemtt13one; dag2b3 moveInCargo starthemtt13one; dag2b4 moveInCargo starthemtt13one; dag2c1 moveInCargo starthemtt13one; dag2c2 moveInCargo starthemtt13one; dag2c3 moveInCargo starthemtt13one; dag2c4 moveInCargo starthemtt13one; starthemtt13one lock true; And here is my first attempt at re-writing it in a more generic, repeatable form (haven't managed to test it out yet) if _h_vehicle == 4 then { _register = 12; _alist = usstarts; for "_x" from 1 to 20 step 1 do { _subject = [_alist call BIS_fnc_selectRandom]; _trial = (markerlist find (_subject select 0)); if (((usattacking select _trial) + _register) <= maxatobj) then {numbhandle = _trial; _x = 20;} else {_alist = _alist - _subject;}; }; newobj = markerlist select numbhandle; _current = usattacking select numbhandle; _new = _current + _register; usattacking set [numbhandle, _new]; _objpos = getMarkerPos newobj; _xpos = _objpos select 0; _ypos = _objpos select 1; _zpos = _objpos select 2; _location = [_xpos, _ypos, _zpos]; _distvar = [200,400] call BIS_fnc_randomInt; _greenzone = [(getMarkerPos newobj), (getMarkerPos "usfob")] call BIS_fnc_dirTo; _dirvar = [(_greenzone - 50), (_greenzone + 50)] call BIS_fnc_randomInt; _spawn = _distvar + 250; _startspawn = [_location, _spawn, _dirvar] call BIS_fnc_relPos; _location = [_xpos, _ypos, 0]; _startdeploy = [_location, _distvar, _dirvar] call BIS_fnc_relPos; _ATLZ = 0; _modATLZ = 1; for "_x" from 1 to 30 step 1 do { _intersectN = lineIntersectsWith [[(_startspawn select 0), (_startspawn select 1) + 2, _modATLZ], [(_startspawn select 0) + 0.2, (_startspawn select 1) + 2.2, _ATLZ + 0.25], objNull, objNull, false]; _intersectE = lineIntersectsWith [[(_startspawn select 0) + 2, (_startspawn select 1), _modATLZ], [(_startspawn select 0) + 2.2, (_startspawn select 1) + 0.2, _ATLZ + 0.25], objNull, objNull, false]; _intersectS = lineIntersectsWith [[(_startspawn select 0), (_startspawn select 1) - 1, _modATLZ], [(_startspawn select 0) - 0.2, (_startspawn select 1) - 2.2, _ATLZ + 0.25], objNull, objNull, false]; _intersectW = lineIntersectsWith [[(_startspawn select 0) - 2, (_startspawn select 1), _modATLZ], [(_startspawn select 0) - 2.2, (_startspawn select 1) - 0.2, _ATLZ + 0.25], objNull, objNull, false]; _intersectC = lineIntersectsWith [[(_startspawn select 0), (_startspawn select 1), _modATLZ], [(_startspawn select 0) + 0.1, (_startspawn select 1) + 0.1, _ATLZ + 0.25], objNull, objNull, false]; isclear = 0; treecheck = nearestObjects [_startdeploy, ["building","wall"], 20]; if (count treecheck >= 1) then {} else {isclear = 1;}; if (count _intersectN <= 0 && count _intersectE <= 0 && count _intersectS <= 0 && count _intersectW <= 0 && count _intersectC <= 0 && isclear == 1) then {_i = 30} else { _dismodifier = [15,30] call BIS_fnc_randomInt; _dirmodifier = [(_greenzone-50), (_greenzone+50)] call BIS_fnc_randomInt; _startspawn = [_startspawn, _dismodifier, _dirmodifier] call BIS_fnc_relPos; }; }; //B_Truck_01_covered_F also possible starthemtt = createVehicle ["B_Truck_01_transport_F", _startspawn, [], 0, "NONE"]; createVehicleCrew starthemtt; hemttcrew = group leader starthemtt; hemttcrew allowFleeing 0; starthemtt setDir ([(getPos starthemtt), (getMarkerPos newobj)] call BIS_fnc_dirTo); hemttcrew setCombatMode "BLUE"; w_unload = hemttcrew addWaypoint [_startdeploy, 1]; w_unload setWaypointType "MOVE"; hemttcrew setCurrentWaypoint w_unload; _newgroup = createGroup west; _dag1a1 = _newgroup createUnit ["B_Soldier_GL_F",[135,122,0],[],0.5,"CORPORAL"]; _dag1a1 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1a2 = _newgroup createUnit ["B_soldier_AR_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1a2 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1a3 = _newgroup createUnit ["B_medic_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1a3 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1a4 = _newgroup createUnit ["B_soldier_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1a4 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1b1 = _newgroup createUnit ["B_Soldier_GL_F",[135,122,0],[],0.5,"CORPORAL"]; _dag1b1 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1b2 = _newgroup createUnit ["B_soldier_AR_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1b2 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1b3 = _newgroup createUnit ["B_medic_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1b3 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1b4 = _newgroup createUnit ["B_soldier_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1b4 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1c1 = _newgroup createUnit ["B_Soldier_GL_F",[135,122,0],[],0.5,"CORPORAL"]; _dag1c1 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1c2 = _newgroup createUnit ["B_soldier_AR_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1c2 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1c3 = _newgroup createUnit ["B_medic_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1c3 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; _dag1c4 = _newgroup createUnit ["B_soldier_F",getMarkerPos "respawn1",[],0.5,"PRIVATE"]; _dag1c4 addEventHandler ["killed", {null = call {_this execVM "respawni.sqf";}}]; us_tickets = us_tickets - _register; if chosenside == 1 then { potentialunits = potentialunits + [_dag1a1,_dag1a2,_dag1a3,_dag1a4,_dag1b1,_dag1b2,_dag1b3,_dag1b4,_dag1c1,_dag1c2,_dag1c3,_dag1c4]; } else {}; w_unload setWaypointStatements ["true", " _myvehicle = vehicle thislist select 0; _myvehicle lock false; _increw = (crew _myvehicle); _incargo = thislist - _increw; { doGetOut _x} foreach _incargo; {_x leaveVehicle (vehicle _increw)} foreach _incargo; objpos = getMarkerPos newobj; _aunit = _incargo call BIS_fnc_selectRandom; alphagroup = group _aunit; _incargo = _incargo - units alphagroup; _aunit = _incargo call BIS_fnc_selectRandom; bravogroup = group _aunit; _incargo = _incargo - units bravogroup; _aunit = _incargo call BIS_fnc_selectRandom; charliegroup = group _aunit; _incargo = _incargo - units charliegroup; alphaobj = alphagroup addWaypoint [objpos, 25]; alphaobj setWaypointType 'SAD'; alphaobj setWaypointCombatMode 'RED'; alphagroup setCurrentWaypoint alphaobj; bravoobj = bravogroup addWaypoint [objpos, 25]; bravoobj setWaypointType 'SAD'; bravoobj setWaypointCombatMode 'RED'; bravogroup setCurrentWaypoint bravoobj; charlieobj = deploygroup2c addWaypoint [obj13pos1, 1]; charlieobj setWaypointType 'SAD'; charlieobj setWaypointCombatMode 'RED'; charliegroup setCurrentWaypoint charlieobj; _rtbpos = getMarkerPos 'usdeploymark'; _rtb = _increw addWaypoint [_rtb, 50]; _rtb setWaypointType 'MOVE'; _rtb setWaypointStatements ['true', '{_myvehicle deleteVehicleCrew _x} forEach crew _myvehicle; deleteVehicle myvehicle;']; if player in _incargo then {newobj setMarkerAlpha 1;} else {}; "]; dag2a1 moveInCargo starthemtt; dag2a2 moveInCargo starthemtt; dag2a3 moveInCargo starthemtt; dag2a4 moveInCargo starthemtt; dag2b1 moveInCargo starthemtt; dag2b2 moveInCargo starthemtt; dag2b3 moveInCargo starthemtt; dag2b4 moveInCargo starthemtt; dag2c1 moveInCargo starthemtt; dag2c2 moveInCargo starthemtt; dag2c3 moveInCargo starthemtt; dag2c4 moveInCargo starthemtt; starthemtt lock true; if us_tickets < 4 then {_i = 50;} else {}; } else {}; }; ---------- Post added at 15:52 ---------- Previous post was at 15:41 ---------- I should also point out that although the waypoint is called "unload" it is not an unload waypoint ( I seem to remember I tried to use transport unload but I ran into problems and opted to just move and get out)
  15. Ok, so here's a script I had written previously for specific units that I am trying to convert into a generic script that can be reused indefinitely. How would I achieve this? I want different units doing different things (different objectives assigned to Alpha, Bravo and Charlie, vehicle crew to head to base) Can this be achieved with the thislist thing? w_unload setWaypointStatements ["true", "starthemtt lock false; doGetOut [dag2a1,dag2a2,dag2a3,dag2a4,dag2b1,dag2b2,dag2b3,dag2b4,dag2c1,dag2c2,dag2c3,dag2c4]; dag2a1 leaveVehicle starthemtt13one; dag2a2 leaveVehicle starthemtt13one; dag2a3 leaveVehicle starthemtt13one; dag2a4 leaveVehicle starthemtt13one; dag2b1 leaveVehicle starthemtt13one; dag2b2 leaveVehicle starthemtt13one; dag2b3 leaveVehicle starthemtt13one; dag2b4 leaveVehicle starthemtt13one; dag2c1 leaveVehicle starthemtt13one; dag2c2 leaveVehicle starthemtt13one; dag2c3 leaveVehicle starthemtt13one; dag2c4 leaveVehicle starthemtt13one; obj13pos1 = getMarkerPos newobj; dag2aobj = deploygroup2a addWaypoint [obj13pos1, 1]; dag2aobj setWaypointType 'SAD'; dag2aobj setWaypointCombatMode 'RED'; deploygroup2a setCurrentWaypoint dag2aobj; dag2bobj = deploygroup2b addWaypoint [obj13pos1, 1]; dag2bobj setWaypointType 'SAD'; dag2bobj setWaypointCombatMode 'RED'; deploygroup2b setCurrentWaypoint dag2bobj; dag2cobj = deploygroup2c addWaypoint [obj13pos1, 1]; dag2cobj setWaypointType 'SAD'; dag2cobj setWaypointCombatMode 'RED'; deploygroup2c setCurrentWaypoint dag2cobj; _usrtb13one = getMarkerPos 'usdeploymark'; _hemttrtb13one = hemttcrew13one addWaypoint [_usrtb13one, 1]; _hemttrtb13one setWaypointType 'MOVE'; _hemttrtb13one setWaypointStatements ['true', '{starthemtt13one deleteVehicleCrew _x} forEach crew starthemtt13one; deleteVehicle starthemtt13one;'];
  16. Worked perfectly! Many thanks Larrow Can you explain what thislist does? I didn't find it on the scripting commands BIS page and Google wasn't particularly helpful :D
  17. I'm struggling to make a 'for each' line work as part of a waypoint statement...I keep getting error messages saying I've provided 3 variables when two were expected. I've tried the following ways of doing it: _usrtb13one setWaypointStatements ["true", "for '_i' from (count crew starthemtt13one) to 0 step -1 do {starthemtt13one deleteVehicleCrew (crew starthemtt13one select _i);}"]; _usrtb13one setWaypointStatements ["true", "{starthemtt13one deleteVehicleCrew _x} forEach crew starthemtt13one;"]; Thanks!
  18. My mistake ladies and gentlemen I was simply using the wrong handle and trying to set waypoint statements for something that was not in fact a waypoint >_<
  19. Can't get a heli to land and drop of crew using an .sqf file. I suspect the waypoints aren't synchronising, as I've checked each group to make sure the waypoints are being correctly added and assigned. But I'm not getting any error messages, so I can't figure out where I'm going wrong. I've followed syntax as far as I can see... _thisposi = getMarkerPos "objmark7"; _xposi = _thisposi select 0; _yposi = _thisposi select 1; _locationi = [_xposi, _yposi, 300]; _distvari = [200,400] call BIS_fnc_randomInt; _dirvari = [0,359] call BIS_fnc_randomInt; _spawni = _distvari + 1200; _startspawni = [_locationi, _spawni, _dirvari] call BIS_fnc_relPos; _locationi = [_xposi, _yposi, 0]; _startdeployi = [_locationi, _distvari, _dirvari] call BIS_fnc_relPos; //startheli1 = "B_Heli_Transport_01_camo_F" createVehicle _startspawni; startheli1 = createVehicle ["B_Heli_Transport_01_camo_F", _startspawni, [], 0, "FLY"]; createVehicleCrew startheli1; _spawnedi = getPos startheli1; _spawnedi set [2,200]; _crewi = group startheli1; startheli1 setposATL [getpos startheli1 select 0, getpos startheli1 select 1, 300]; startheli1 flyInHeight 200; startheli1 setDir ([startheli1, (getMarkerPos "objmark7")] call BIS_fnc_dirTo); _thisunload = _crewi addWaypoint [_startdeployi, 0]; _thisunload setWaypointType "TR UNLOAD"; _crewi setCurrentWaypoint _thisunload; dag1a1 moveInCargo startheli1; dag1a2 moveInCargo startheli1; dag1a3 moveInCargo startheli1; dag1a4 moveInCargo startheli1; dag2a1 moveInCargo startheli1; dag2a2 moveInCargo startheli1; dag2a3 moveInCargo startheli1; dag2a4 moveInCargo startheli1; _groupdag1a = group dag1a1; _thisgetout = _groupdag1a addWaypoint [_startdeployi, 0]; _thisgetout setWaypointType "GETOUT"; _groupdag1a setCurrentWaypoint _thisgetout; [_crewi, 0] synchronizeWaypoint [[_groupdag1a,0]];
  20. Can anyone help me figure out the syntax for the "nearest helipad" function? I'm not too sure how to interpret the notes in the function viewer: private ["_pos","_radius","_selectRandom","_types","_pos","_nearLocations","_posLocation","_nearObjects"]; _pos = [_this,0,position vehicle player] call bis_fnc_param; _radius = [_this,1,999999,[0]] call bis_fnc_param; _selectRandom = [_this,2,false,[false]] call bis_fnc_param; _types = [_this,3,["Heliport"],[[]]] call bis_fnc_param; //--- Find all helipads around _pos = _pos call bis_fnc_position; _nearLocations = nearestLocations [_pos,_types,_radius]; if (count _nearLocations > 0) then { _location = if (_selectRandom) then { //--- Select random helipad _nearLocations call bis_fnc_selectrandom; } else { //--- Select nearest helipad [_nearLocations,_pos] call bis_fnc_nearestPosition; }; _posLocation = position _location; //--- Find helipad object _nearObjects = _posLocation nearobjects ["RooftopLanding_Base_H",500]; if (count _nearObjects > 0) then { [(_nearObjects select 0) modeltoworld [0,0,1],(_nearObjects select 0),_location]; } else { [_posLocation,objnull,_location] }; } else { //--- No locations found [[0,0,0],objnull,locationnull] };
  21. Thanks grumpy I have previously attempted a script spawning a new helipad, but this caused the pilot to land in some pretty crumby places and often on top of trees etc. There might be a way to add in some checks to see if there are objects nearby and such... but given the crew do a neat job of landing if I leave them to it I might just have to try and keep the bird out of range of the existing pad Would still be interested in hearing if there is a way of cancelling or negating the land at the 'permanent' in-game helipad. Even if no one knows of a precedent, I'm sure we can come up with some theories :D ---------- Post added at 23:38 ---------- Previous post was at 23:32 ---------- A quick search of the BIS functions came up with this: BIS_fnc_nearestHelipad I might have a play around and see if I can re-route or override the landing if it's within a certain distance of the chopper's waypoint
  22. Side note: Is there a way to make the pilot ignore a set helipad when landing? I have a scenario where the pilots approach to an objective is randomised within a radius, and occasionally when the drop-off point is too close to the heli-pad the pilot automatically chooses this as the spot. Trouble is the heli-pad IS the objective, and I want the team to land near but not on the objective.
  23. Thank you Sel - this allowed me to go back to using waypoints, which now appear to have successfully synchronised. I have also now solved the engine off problem. This script would cause the helo to land and turn engines off; startheli1 land 'GETOUT'; The working version is this; startheli1 land 'GET OUT'; Working script now posted below for future reference: _thisposi = getMarkerPos "objmark7"; _xposi = _thisposi select 0; _yposi = _thisposi select 1; _locationi = [_xposi, _yposi, 80]; _distvari = [200,400] call BIS_fnc_randomInt; _dirvari = [0,359] call BIS_fnc_randomInt; _spawni = _distvari + 1000; _startspawni = [_locationi, _spawni, _dirvari] call BIS_fnc_relPos; _locationi = [_xposi, _yposi, 0]; _startdeployi = [_locationi, _distvari, _dirvari] call BIS_fnc_relPos; startheli1 = createVehicle ["B_Heli_Transport_01_camo_F", _startspawni, [], 0, "FLY"]; createVehicleCrew startheli1; helocrewi = group leader startheli1; _spawnedi = getPos startheli1; startheli1 setposATL [getpos startheli1 select 0, getpos startheli1 select 1, 80]; startheli1 flyInHeight 80; startheli1 setDir ([startheli1, (getMarkerPos "objmark7")] call BIS_fnc_dirTo); unload1 = helocrewi addWaypoint [_startdeployi, 1]; unload1 setWaypointType "TR UNLOAD"; helocrewi setCurrentWaypoint unload1; deploygroup1a = group dag1a1; deploygroup1b = group dag1b1; unload1 setWaypointStatements ["true", "startheli1 land 'GETOUT'; commandGetOut [dag1a1,dag1a2,dag1a3,dag1a4]; dag1a1 leaveVehicle startheli1; dag1a2 leaveVehicle startheli1; dag1a3 leaveVehicle startheli1; dag1a4 leaveVehicle startheli1; commandGetOut [dag1b1,dag1b2,dag1b3,dag1b4]; dag1b1 leaveVehicle startheli1; dag1b2 leaveVehicle startheli1; dag1b3 leaveVehicle startheli1; dag1b4 leaveVehicle startheli1; _thisreturn = _helogroup addWaypoint [getMarkerPos 'returnhelo1', 1]; _thisreturn setWaypointType 'MOVE'; _helogroup setCurrentWaypoint _thisreturn;"]; dag1a1 moveInCargo startheli1; dag1a2 moveInCargo startheli1; dag1a3 moveInCargo startheli1; dag1a4 moveInCargo startheli1; dag1b1 moveInCargo startheli1; dag1b2 moveInCargo startheli1; dag1b3 moveInCargo startheli1; dag1b4 moveInCargo startheli1; deploy1 = deploygroup1a addWaypoint [_startdeployi, 1]; deploy1 setWaypointType "GETOUT"; deploygroup1a setCurrentWaypoint deploy1a; deploy1b = deploygroup1a addWaypoint [_startdeployi, 1]; deploy1b setWaypointType "GET OUT"; deploygroup1a setCurrentWaypoint deploy1b; [helocrewi, 0] synchronizeWaypoint [ [deploygroup1a, 0],[deploygroup1b, 0] ];
  24. Thank you Jigsor! The invisible heli-pad worked fine. It still bugs me that I couldn't get the waypoints to work though...it all worked fine placing waypoints in the editor. If anyone knows a solution that gets waypoints working like this I'd appreciate it :) ---------- Post added at 22:34 ---------- Previous post was at 22:18 ---------- Spoke too soon The pilot now successfully lands, but now the crew seem to want to turn off the engine and just sit on the ground, despite the land command being set to "GET OUT" (supposedly hovering low enough for units to get out, without actually landing). Here's what I'm working with so far: _thisposi = getMarkerPos "objmark7"; _xposi = _thisposi select 0; _yposi = _thisposi select 1; _zposi = _thisposi select 2; _locationi = [_xposi, _yposi, 80]; _distvari = [200,400] call BIS_fnc_randomInt; _dirvari = [0,359] call BIS_fnc_randomInt; _spawni = _distvari + 1000; _startspawni = [_locationi, _spawni, _dirvari] call BIS_fnc_relPos; _locationi = [_xposi, _yposi, 0]; _startdeployi = [_locationi, _distvari, _dirvari] call BIS_fnc_relPos; startheli1 = createVehicle ["B_Heli_Transport_01_camo_F", _startspawni, [], 0, "FLY"]; createVehicleCrew startheli1; _spawnedi = getPos startheli1; _crewi = group startheli1; startheli1 setposATL [getpos startheli1 select 0, getpos startheli1 select 1, 80]; startheli1 flyInHeight 80; startheli1 setDir ([startheli1, (getMarkerPos "objmark7")] call BIS_fnc_dirTo); _pad1 = createVehicle ["Land_HelipadEmpty_F", _startdeployi, [], 0, "NONE"]; _pad1 setposATL [_startdeployi select 0, _startdeployi select 1, 0]; _thisunload = _crewi addWaypoint [_startdeployi, 1]; _thisunload setWaypointType "MOVE"; _crewi setCurrentWaypoint _thisunload; _dag1a = group dag1a1; _dag1b = group dag1b1; _thisunload setWaypointStatements ["true", "startheli1 land 'GETOUT'; commandGetOut [dag1a1,dag1a2,dag1a3,dag1a4]; dag1a1 leaveVehicle startheli1; dag1a2 leaveVehicle startheli1; dag1a3 leaveVehicle startheli1; dag1a4 leaveVehicle startheli1; commandGetOut [dag1b1,dag1b2,dag1b3,dag1b4]; dag1b1 leaveVehicle startheli1; dag1b2 leaveVehicle startheli1; dag1b3 leaveVehicle startheli1; dag1b4 leaveVehicle startheli1; _thisreturn = _crewi addWaypoint [getMarkerPos 'returnhelo1', 1]; _thisreturn setWaypointType 'MOVE'; _crewi setCurrentWaypoint _thisreturn;"]; dag1a1 moveInCargo startheli1; dag1a2 moveInCargo startheli1; dag1a3 moveInCargo startheli1; dag1a4 moveInCargo startheli1; dag1b1 moveInCargo startheli1; dag1b2 moveInCargo startheli1; dag1b3 moveInCargo startheli1; dag1b4 moveInCargo startheli1;
  25. Hi All I'm attempting to keep an array of units that are still operational on the field throughout a mission, which involves removing a unit from the array once it is killed. I've got the killed eventHandler working smoothly for the player, but when it comes to the AI I can't seem to carry the units name through using the event handler. For example, I have my array of units that aren't dead: potentialunits = [..., ..., ...] Previously I had been attempting to set a variable, deceased, to the units name using: this addEventHandler ["killed", {null = call {deceased = this; execVM "respawni.sqf";}}]; However when the script, respawni.sqf is run it tells me that deceased is an undefined variable. Conclusion Either this doesn't work when used in a killed eventHandler, OR the variable is for some reason not being set to the units name and/or carried through to the script. does anybody know how i can get this working? If i can't obtain the unit ID through this how else do I subtract it from the array?* * bare in mind that the units name may not be known to me as I have many units being created after mission start Thanks!
×