Bladesfist 1 Posted March 8, 2013 I want to detect if the player has placed an AT Mine on the road before I send a convoy in. I have tried using a trigger and putting count (nearestObjects [position this, ["ATMine_Range_Mag"], 10]) > 0 but without any luck. This method would also give me a circular check when I want to know if the mine is inside the triggers rect. Does anyone have any ideas? Share this post Link to post Share on other sites
Kydoimos 915 Posted January 5, 2014 Does anybody know how to resolve this? I have exactly the same problem. I want to have a trigger fire when a mine is placed on (not around or near) a certain stretch of road. Share this post Link to post Share on other sites
Larrow 2817 Posted January 5, 2014 (edited) Could use the "FIRED" eventHandler ? this addEventHandler ["FIRED", {if ( (_this select 4) isKindOf "TimeBombCore") then { hint "mine planted"}; }]; This placed in the players init will hint everytime you place a mine. Then just check the players location. or ({(typeOf _x) isKindOf "TimeBombCore"}count (nearestObjects [thistrigger,[],1]) > 0) in a trigger condition will fire when a mine has been planted within 1m of the trigger. Edited January 5, 2014 by Larrow Share this post Link to post Share on other sites
2nd ranger 282 Posted January 5, 2014 EDIT: Never mind, ninja'd! Share this post Link to post Share on other sites
Kydoimos 915 Posted January 5, 2014 Thanks Larrow - trouble is, the 'within 1m of the trigger'. I don't know if it's even possible to do, but I was looking for a way to detect the mine within the boundaries of a road. A square trigger works - but the within 1m etc. creates a circular trigger effect. Any ideas? Thanks for your suggestion though. As I said, I may well be looking for the impossible! Share this post Link to post Share on other sites
Larrow 2817 Posted January 5, 2014 ({ ((typeOf _x) isKindOf "TimeBombCore") && {[thisTrigger, _x] call BIS_fnc_inTrigger}}count (nearestObjects [thistrigger, [], ( ((((triggerArea thisTrigger) select 0)/2)*(((triggerArea thisTrigger) select 0)/2)) + ((((triggerArea thisTrigger) select 1)/2)*(((triggerArea thisTrigger) select 1)/2)) ) ]) > 0) Looks long and complicated but is a cover all condition. Basically it will look for all "TimeBombCore" objects with in a radius of the corner distance of the trigger, then check whether this object is actually within the triggers area. No need to change anything just chuck it in any size/shape trigger and it should be good to go. A little bit of overscan maybe on the nearestObjects but its late and im too tired to think up a better solution atm. :D Share this post Link to post Share on other sites
Kydoimos 915 Posted January 6, 2014 Thanks man - seems to do the job perfectly! Guess if I want to set a specific mine, I'd just need to change "TimeBombCore" to the relevant classname? Again, many thanks! Share this post Link to post Share on other sites
Larrow 2817 Posted January 6, 2014 Guess if I want to set a specific mine, I'd just need to change "TimeBombCore" to the relevant classname? Correct. "TimeBombCore" is a parent class that i used for testing as it catches the majority of mines/charges. Share this post Link to post Share on other sites
Kydoimos 915 Posted January 6, 2014 Nice one Larrow! Spectacular help - really, really appreciated! Share this post Link to post Share on other sites