Play3r   143 Posted June 1, 2019 I want to check if a player has detonated a DemoCharge_f close to the vanilla SubMarine so i can finish a task. I have done it once where i used a gamelogic to see if player did it to a gastank, but i can't find that old mission anymore.  Anyone got a idea how i can solve this BIG problem for me. 🤔 Share this post Link to post Share on other sites
GEORGE FLOROS GR   4206 Posted June 1, 2019 4 hours ago, Play3r said: Anyone got a idea how i can solve this BIG problem for me. 🤔  Hello there Play3r !  If there are no other explosions except the certain , then you can use an evenhandler from the start in this object or else you can add this in the certain time that you want , probably with a trigger.  You can use this : https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion 1 1 Share this post Link to post Share on other sites
pierremgi   4739 Posted June 1, 2019 or a simple trigger with: {_x inArea thisTrigger} count allMissionObjects "#explosion" > 0 2 Share this post Link to post Share on other sites
Tankbuster   1733 Posted June 4, 2019 allmissionobjects? nearestObjects would be much cheaper on the CPU and can find "#explosion" or "#krater". 1 Share this post Link to post Share on other sites
haleks   8206 Posted June 4, 2019 But what if something else explodes, like a grenade? Shouldn't we use the "fired" EH to track placed charges instead with the "put" weapon type?   Untested : this addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; if (_weapon isEqualTo "Put" && _mag isEqualTo "DemoCharge_f") exitWith { waitUntil {sleep 0.1; !alive _projectile}; /*code*/ }; }];  Share this post Link to post Share on other sites
Tankbuster   1733 Posted June 4, 2019 Although the Submarine, last time I looked couldn't take damage, it would be worth adding an explosion EH to it and seeing if any useable results came back, just as George suggested earlier.  Share this post Link to post Share on other sites
pierremgi   4739 Posted June 4, 2019 26 minutes ago, Tankbuster said: allmissionobjects? nearestObjects would be much cheaper on the CPU and can find "#explosion" or "#krater". Did u test it or it's a simple supposition? Share this post Link to post Share on other sites
Tankbuster   1733 Posted June 4, 2019 1 minute ago, pierremgi said: Did u test it or it's a simple supposition? Oh yes, tested. I use it to sense explosions near bridge objects. I do other things too, such as the explosion EH, plus checking for kraters (sic) on the ground underneath the object. 2 Share this post Link to post Share on other sites
Play3r   143 Posted June 5, 2019 The trigger solution somehow not always work. my trigger is this: cond: {_x inArea thisTrigger} count allMissionObjects "#explosion" > 0 Act: Subtask setdamage 1; Subtask is a variable that see if trigger is fire so the SubTasktrigger succeeded can fire and nothing more.. The sub is in the water and i have made a trigger that is the same length a the sub + 10 in each end, the trigger is 25 width and is 150 high but it will not fire every time i try the task.  The EH i have never used before and i don't know where to put it Is it on the sub ? that gives me a error something about a global variable on a local something if i put inside the trigger nothing happens??  any idea what i do wrong.. Share this post Link to post Share on other sites
pierremgi   4739 Posted June 5, 2019 29 minutes ago, Play3r said: The sub is in the water and i have made a trigger that is the same length a the sub + 10 in each end, the trigger is 25 width and is 150 high but it will not fire every time i try the task. The EH i have never used before and i don't know where to put it any idea what i do wrong..  Try your trigger with a simple hint as activation code. At least you will see (read) something. If it doesn't work every time, that means the explosion is not inside the trigger (volume) The problem with a EH "fired" is that you need to apply it on all the units supposed to blow this charge (and it's an unscheduled scope btw, so forget waitUntil w/o spawning the inner code). For the EH "explosion", you need to apply it on submarine (init field is OK)... but it works if there is some damage on it. not tested. Read and follow BIKI. If you use this EH (not tested), you don't need a trigger to detect the explosion. Share this post Link to post Share on other sites