usbstuck 10 Posted February 10, 2015 (edited) Hi all, I'm trying to figure out the best way to keep track of players (MP compatible) entering and exiting an area. When they are entering I want to add actions to the unit, when exiting i want to remove them. I've been fiddling around with triggers for the better part of yesterday :) but it's quite tricky. I wonder if a trigger is actually the best way to do this, because the onDeactivation will only fire if all units are out of the area.. To sum up, my questions: - Is a trigger the right tool? - If it is, how can I fire the deactivate trigger for units leaving the area? (see all the way below @ PROBLEM) More info: Currently I'm not at home so I can't share the code I have so far, but I'll write it down in pseudo code below: (the adding part works) UNITS_IN_AREA = []; RESET_TRIGGER = true; // this makes it repeatable areaTrigger = [Repeating trigger set in mission builder, so it has static position and triggerArea] areaTrigger condition = ({_x in thisList} count (playableUnits + switchableUnits) > 0) && RESET_TRIGGER areaTrigger onActivation = [thisList] call addScript.sqf; RESET_TRIGGER = false; // bottom of addScript sets RESET_TRIGGER = true; areTrigger onDeactivation = [thisTrigger] call removeScript.sqf; addScript.sqf - adds units in thisList to UNITS_IN_AREA - adds actions to the units removeScript.sqf - should remove units from UNITS_IN_AREA that are no longer in the trigger area - should remove actions from these units PROBLEM: Issue here is we don't have a thisList magic variable. A workaround is using nearestObjects with range of triggerArea, but range is circular and a trigger can be ellipse or rectangular Edited February 10, 2015 by usbStuck Share this post Link to post Share on other sites
Schatten 287 Posted February 10, 2015 You can use https://community.bistudio.com/wiki/BIS_fnc_inTrigger for triggers or my function for markers. Share this post Link to post Share on other sites
usbstuck 10 Posted February 10, 2015 Thanks Schatten, I'll give that a try! It's probably best though to combine it with a trigger and onAct check if there's a player in the trigger/marker area. Otherwise I'd have to continuously do the check and that feels like a waste of system resources. Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 10, 2015 use tr triggerAttachVehicle [player] activation -> present on act -> add action ondeact -> remove action Share this post Link to post Share on other sites
usbstuck 10 Posted February 10, 2015 Hmm looks like that would considerably reduce my current code.. (still a lot to learn) triggerAttachVehicle seems to take an array, so I could add an array of all playables. Will this trigger deactivation for each? Well guess I find out tonight. Thanks Killzone_Kid! Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 10, 2015 use tr triggerAttachVehicle [player] activation -> present on act -> add action ondeact -> remove action Does triggerAttachVehicle work if the player enters the cargo seat of another vehicle? Have experienced issues with that a long time ago. Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 10, 2015 Hmm looks like that would considerably reduce my current code.. (still a lot to learn)triggerAttachVehicle seems to take an array, so I could add an array of all playables. Will this trigger deactivation for each? Well guess I find out tonight. Thanks Killzone_Kid! No, you can only attach single unit even though it looks like it should be more. Welcome to Arma. Share this post Link to post Share on other sites
usbstuck 10 Posted February 10, 2015 (edited) Eventually got it to work using Schatten's suggestion. Still had to do a lot of coding though! Thanks all for the help If ur interested, this is the result: UNITS_IN_LONG_RANGE_AREA = []; // `longRangeArea` is created in editor because it is in static position // only the `triggerArea` is set in editor // TODO: For MP missions with several factions, change first argument to "ANY" and change condition to // this && {_x in thisList} count (playableUnits + switchableUnits) > 0 longRangeArea setTriggerActivation [format ["%1", side player], "PRESENT", true]; // SETTING longRangeArea setTriggerStatements [ "this", "[thisTrigger] spawn checkLongRangeArea", "[] spawn clearLongRangeArea" ]; /** * Responsible for updating global UNITS_IN_LONG_RANGE_AREA * and calling the respective add/remove functions if needed * @param {Object:trigger} */ checkLongRangeArea = { private ["_trg", "_units", "_unit", "_inTriggerArea", "_unitAreaIndex", "_initialised"]; _trg = _this select 0; _units = (playableUnits + switchableUnits); // SETTING diag_log "=> checkLongRangeArea"; while {triggerActivated _trg} do { for "_i" from 0 to (count _units)-1 do { _unit = _units select _i; _inTriggerArea = [_trg, _unit] call BIS_fnc_inTrigger; _unitAreaIndex = [name _unit, UNITS_IN_LONG_RANGE_AREA] call arrayFindByFirstIndex; _initialised = _unitAreaIndex >= 0; // Unit has entered if (_inTriggerArea && !_initialised) then { _actions = [_unit] call addLongRangeActions; _unitArray = [name _unit, _unit, _actions]; diag_log format ["Unit entered trigger area, add _unitArray: %1", _unitArray]; UNITS_IN_LONG_RANGE_AREA = UNITS_IN_LONG_RANGE_AREA + [_unitArray]; ["Long range options active", "hint", _unit] call BIS_fnc_MP; }; // Unit has left if (!_inTriggerArea && _initialised && _unitAreaIndex >= 0) then { _unitArray = UNITS_IN_LONG_RANGE_AREA select _unitAreaIndex; [_unit, _unitArray select 2] spawn removeActions; diag_log format ["Unit left area, remove _unitArray: %1", _unitArray]; UNITS_IN_LONG_RANGE_AREA = UNITS_IN_LONG_RANGE_AREA - [_unitArray]; ["Long range options deactivated (leave)", "hint", _unit] call BIS_fnc_MP; }; }; sleep 1; }; }; /** * Remove all unit arrays from global UNITS_IN_LONG_RANGE_AREA * @return {void} */ clearLongRangeArea = { private ["_unit", "_actions"]; diag_log "=> clearLongRangeArea"; { if (typeName _x == "ARRAY" && count _x == 3) then { _unit = _x select 1; _actions =_x select 2; [_unit, _actions] spawn removeActions; ["Long range options deactivated (deac trigger)", "hint", _unit] call BIS_fnc_MP; }; } forEach UNITS_IN_LONG_RANGE_AREA; UNITS_IN_LONG_RANGE_AREA = []; }; /** * Add actions to unit that are needed in "long range" area * @param {Object} Unit that were set in `checkLongRangeArea` */ addLongRangeActions = { private ["_unit", "_actions"]; _unit = _this select 0; diag_log format ["=> addLongRangeActions: for unit %1", _unit]; _actions = [ _unit addAction ["<t color='#ffff00'>Reset target vehicles</t>", "scripts\resetVehicles.sqf", nil, 0, false, true, "", "(_target == _this)"] ]; _actions }; /** * Remove actions that unit needs in "long range" area * @type {Object} */ removeActions = { private ["_unit", "_actions"]; _unit = _this select 0; _actions = _this select 1; diag_log format ["=> removeActions: for unit %1", _unit]; if (typeName _actions == 'ARRAY') then { for "_j" from 0 to (count _actions)-1 do { _unit removeAction (_actions select _j); }; }; }; Referenced function arrayFindByFirstIndex.sqf: /** * Searches array (1) and returns the index of nested array of which the first element matches search (0) * Example: * arr = [ * ['one', 1], * ['two', 2] * ] * * ['one', arr] call arrayFindByFirstIndex; // returns 1 * * @params {any} search this * @params {array} in multi-dimensional array * @return {scalar} index If not found: -1 */ private ["_search", "_array", "_index"]; _search = _this select 0; _array = _this select 1; _index = -1; if (count _array > 0 && typeName (_array select 0) != 'ARRAY') exitWith { diag_log format ["ERROR => arrayFindByFirstIndex: array is not multi-dimensional: (%1)", _array]; _index; }; { scopeName "loop"; if ((_x select 0) == _search) then { _index = _forEachIndex; breakOut "loop"; }; } forEach _array; _index Edited February 10, 2015 by usbStuck Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 11, 2015 [color="#FF8040"]playerAddActions [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b][[/b][/color] [color="#000000"]player[/color] [color="#191970"][b]addAction[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"<t color='#ffff00'>Reset target vehicles 1</t>"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"scripts\resetVehicles.sqf"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]nil[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]false[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]""[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"(_target == _this)"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]player[/color] [color="#191970"][b]addAction[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"<t color='#ffff00'>Reset target vehicles 2</t>"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"scripts\resetVehicles.sqf"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]nil[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]false[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]""[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"(_target == _this)"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]player[/color] [color="#191970"][b]addAction[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"<t color='#ffff00'>Reset target vehicles 3</t>"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"scripts\resetVehicles.sqf"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]nil[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]false[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]""[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"(_target == _this)"[/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] longRangeArea [color="#191970"][b]setTriggerActivation[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"VEHICLE"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"PRESENT"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] longRangeArea [color="#191970"][b]triggerAttachVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]player[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] longRangeArea [color="#191970"][b]setTriggerStatements[/b][/color] [color="#8B3E2F"][b][[/b][/color] [color="#7A7A7A"]"this"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"thisTrigger setVariable ['actions', call playerAddActions]"[/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"{player removeAction _x} forEach (thisTrigger getVariable ['actions', []])"[/color] [color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter I don't know if you seen this: http://killzonekid.com/arma-scripting-tutorials-triggers/ Share this post Link to post Share on other sites
usbstuck 10 Posted February 11, 2015 I did read the post on your blog. Your blog is a great resource btw, cheers. Your code above is awesomely simple, but do I understand it correctly if this will be executed on every users computer? The command reference states this: NOTE: Triggers in multiplayer are global objects and therefore should only be created on the server. Creating trigger on a client will result in trigger becoming a dead weight transferred to the server when client logs out. In terms of performance, wouldn't it be better to create all triggers on the server? Still, I might have focussed on this too much, especially since your code is written in a fraction of the time that I spend writing mine.. :) Share this post Link to post Share on other sites
jshock 513 Posted February 11, 2015 Yes triggers should be created on the server, but trigger are "arguments global" meaning (at least in this context) that when any player enters this trigger it should execute the given code, however, triggers are "effects local", meaning that the code executed in onAct will only be ran on that specific client that executed the trigger. Now the playerAddActions function should be defined locally for each player (not on the server) so they have access to that information when they execute the given code from the trigger Share this post Link to post Share on other sites
usbstuck 10 Posted February 11, 2015 Thanks that cleared things up. Well, writing all that code, even though I might not use it now, at least gave me a thorough understanding of sqf :) Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 11, 2015 Just a note, triggers created in the editor will be created on every clients machine and the server machine, in a dedicated environment. Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 11, 2015 editor triggers are created on server only Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 11, 2015 editor triggers are created on server only One would think so, but they fire locally when triggered by players, this is not possible if server-only. Mission.sqm is global and they load on the client during init process. Share this post Link to post Share on other sites
Schatten 287 Posted February 11, 2015 http://killzonekid.com/arma-scripting-tutorials-triggers-v3/. Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 11, 2015 One would think so, but they fire locally when triggered by players, this is not possible if server-only. Mission.sqm is global and they load on the client during init process. One would know so. Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 11, 2015 (edited) Interesting ... I hope you are right. :) http://feedback.arma3.com/view.php?id=16923 This is intended behavior and it's consistent with those of other objects, like soldiers or vehicles. createTrigger is analogous to createVehicle, not createVehicleLocal. It makes sense the trigger is created on every computer including server, but remains local to whoever created it. Once that machine disconnects, locality is naturally passed to the server. As for trigger statements - one must remember that while trigger is created globally, setTriggerStatements and other trigger commands are local. Runs contrary to: Editor based triggers (mission.sqm Sensors) are indeed created only on the server How does this work then: A single server trigger can be used by all clients as well as the server So this server-side trigger from mission.sqm is evaluating only on the server when I--the client--activate it (say by entering the radius), then its sending me over the network, the onAct code to run locally on my machine only? This does not quite make sense... EDIT: I can slow a server right down (1-3 fps), yet the trigger sensor has no scheduling delay at all. One would expect, if the evaluation is server-side only, that I would expect some delay. This is not the case, leading me to suspect the evaluation thread is running on each client irrespective of server. Edited February 11, 2015 by MDCCLXXVI Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 12, 2015 I see where the confusion comes from. Every global object is obviously 1 master object at the location where it was created and many slave copies at other locations. But it is still ONE object. Your note seemed to imply that editor trigger will be a separate object on every client. At least this is how it came across, and this is what I would have thought from reading it if I didn't know better. Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 12, 2015 I see where the confusion comes from. Every global object is obviously 1 master object at the location where it was created and many slave copies at other locations. But it is still ONE object. Your note seemed to imply that editor trigger will be a separate object on every client. At least this is how it came across, and this is what I would have thought from reading it if I didn't know better. Yes I was on a different page. One thing that is unclear to me: On which machine(s) is the evaluation thread? I believe there is an evaluation thread running on each clients machine, for triggers created through mission.sqm. Share this post Link to post Share on other sites
killzone_kid 1330 Posted February 12, 2015 conditions are local and independent. it is all on my blog Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 12, 2015 Hmm... So are editor-defined triggers evaluating also on the server machine? I see now that createTrigger is only called on the server machine and it creates the EmptyDetector mission object, but you are saying the client reads the mission.sqm and then an evaluation thread is spawned with the defined conditions? This makes sense, and is how I'd expect it to work. createTrigger in mission.sqm, spawns evaluation thread for each client (and server machine too?). createTrigger in initServer.sqf, spawns evaluation thread only on server. This is a slight digression, but if my goal is to reduce the number of evaluation threads, primarily on the server machine, it seems reasonable to only create the trigger where necessary (and if necessary), such as in initServer or initPlayerLocal root. Say I create a scenario with 250 editor-created triggers in the mission.sqm. Is this 250 evaluation threads? (I expect so). And, is each connected machine (incl server) running these threads independently? I would hope the server machine is not running 250 eval threads if they are meant to be player conditional. There are other benefits to using editor triggers, such as ease of use and being good enough for most purposes, the above is just an area I am unclear about, and also concerned about. Share this post Link to post Share on other sites
onedigita 17 Posted February 17, 2015 I am trying to make a script that would tell opfor players with a hint 5 minutes after any west players enter a defined area. im not sure if a marker is possible or a trigger but ive never fooled around with triggers at all and im completely in the dark on this one. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted February 17, 2015 (edited) I haven't followed the discussion and just saw this thread, so pardon me if this might not be on the spot, but as I wanted to solve this very problem described in the thread title some while ago already, I've created this trigger condition thingy. [color=#FF8040]fnc_triggerUnitsChanged [color=#8B3E2F][b]=[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#1874CD]_thisList[/color] [color=#8B3E2F][b]=[/b][/color] [color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]0[/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_thisListPrev[/color] [color=#8B3E2F][b]=[/b][/color] [color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]1[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#006400][i]//for each entering unit[/i][/color] [color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#1874CD]_thisList[/color] [color=#8B3E2F][b]-[/b][/color] [color=#1874CD]_thisListPrev[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#006400][i]//for each leaving unit[/i][/color] [color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#1874CD]_thisListPrev[/color] [color=#8B3E2F][b]-[/b][/color] [color=#1874CD]_thisList[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_trigger[/color] [color=#8B3E2F][b]=[/b][/color] [color=#191970][b]createTrigger[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"EmptyDetector"[/color][color=#8B3E2F][b],[/b][/color] [color=#191970][b]getPosATL[/b][/color] [color=#000000]player[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerArea[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#FF0000]10[/color][color=#8B3E2F][b],[/b][/color] [color=#FF0000]10[/color][color=#8B3E2F][b],[/b][/color] [color=#FF0000]0[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerActivation[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"ANY"[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]"PRESENT"[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]true[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setVariable[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"toggle"[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerStatements[/b][/color] [color=#8B3E2F][b][[/b][/color] [color=#7A7A7A]" isServer && { comment 'if thisList changed compared to previous check, do stuff'; if !(thisList isEqualTo (thisTrigger getVariable ['thisList', []])) then { comment 'set list of last check to thisListPrev and thisList to current list'; thisTrigger setVariable ['thisListPrev', +(thisTrigger getVariable ['thisList', []])]; thisTrigger setVariable ['thisList', +thisList]; comment 'toggle variable state'; thisTrigger setVariable ['toggle', !(thisTrigger getVariable ['toggle', false])]; }; thisTrigger getVariable 'toggle' } "[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]" [thisList, thisTrigger getVariable 'thisListPrev'] call fnc_triggerUnitsChanged; systemChat 'toggle activation'; "[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]" [thisTrigger getVariable 'thisList', thisTrigger getVariable 'thisListPrev'] call fnc_triggerUnitsChanged; systemChat 'toggle deactivation'; "[/color] [color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [/color] Kudos to Killzone_Kid for his SQF to BBCode Converter. I've updated the code performance wise and couldn't test it yet, so if anyone should find this doesn't work properly, just fire away. :) As for your problem, onedigita, this should be relatively easy if I understand you correctly: [color=#FF8040][color=#1874CD]_trigger[/color] [color=#8B3E2F][b]=[/b][/color] [color=#191970][b]createTrigger[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"EmptyDetector"[/color][color=#8B3E2F][b],[/b][/color] [color=#191970][b]getPosATL[/b][/color] [color=#000000]player[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#006400][i]//replace "getPosASL player" with any desired position[/i][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerArea[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#FF0000]10[/color][color=#8B3E2F][b],[/b][/color] [color=#FF0000]10[/color][color=#8B3E2F][b],[/b][/color] [color=#FF0000]0[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#006400][i]//circle with a 10m radius; tilted by 0°; "false" for being a circle and not a rectangle[/i][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerActivation[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"WEST"[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]"PRESENT"[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#006400][i]//activated by "WEST" aka blufor units; activated only once (hence repeating is "false")[/i][/color] [color=#1874CD]_trigger[/color] [color=#191970][b]setTriggerStatements[/b][/color] [color=#8B3E2F][b][[/b][/color] [color=#7A7A7A]"isServer && this"[/color][color=#8B3E2F][b],[/b][/color] [color=#006400][i]//using the keyword "this", the above statements will be considered for checking whether the trigger is (de)activated[/i][/color] [color=#7A7A7A]" comment 'This happens when the trigger is activated'; 0 = [] spawn { uiSleep 300; [['Blufor units have entered the area!', {hint _this;}], 'BIS_fnc_call', opfor, false, true] call BIS_fnc_MP; }; "[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]"comment 'This happens when the trigger is deactivated';"[/color] [color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color][/color] Edited February 19, 2015 by Heeeere's Johnny! typo correction Share this post Link to post Share on other sites
onedigita 17 Posted February 17, 2015 Thanks for the reply! too clarify, I wanted say 1000m circular trigger around feruz abad, that when an opfor landed or drove into that area 5 minutes after that my opfor, which in my case is actually an indy faction would get a hint 5 minutes after and maybe even possibly a marker only visible to that side that bluf were spotted somewhere in that area. which looks right for most of it, im just not sure about the first part with the SetTriggerArea will it be the size of the marker i put in the editor or will it by those dimensions? ive never ever done a trigger before so its pretty new to me. regardless thank you for taking your time to help me! Share this post Link to post Share on other sites