NotMyActualName 4 Posted January 22, 2022 Is it possible to set up a "smoke grenade trap" in the editor? So basically like a "tripwire" that when anybody (or anything like a vehicle) passes it activates a smoke grenade. I already looked around in the editor but the only thing I found was the normal APERS tripwire mine. I know that you can activate stuff when someone passes through a trigger. Maybe that would be the way to do this? Is there a way to "activate" a smoke grenade that is placed with the editor from the "OnActivation" script field of the trigger? Any help would be appreciated. Share this post Link to post Share on other sites
Gunter Severloh 4070 Posted January 23, 2022 4 hours ago, NotMyActualName said: I know that you can activate stuff when someone passes through a trigger. Maybe that would be the way to do this? Is there a way to "activate" a smoke grenade that is placed with the editor from the "OnActivation" script field of the trigger? Yes! I had this in a mission i was building except i was using a flare, check it out: Create a trigger, set the size you want and name it tr1 then and put the following code in on activation: nul = thisTrigger spawn { _alt = 80; sleep (_alt/25); _pos = position _this; _pos set [2,_alt]; _flare = "F_40mm_White_Infinite" createVehicle _pos; _br = 6; _lt = "#lightpoint" createVehicle _pos; _lt setLightUseFlare true; _lt setLightDayLight true; _lt setLightBrightness _br; _lt setLightAmbient [0.7,0.7,0.8]; _lt setLightColor [0.7,0.7,0.8]; _lt setLightFlareSize 10; _lt setLightFlareMaxDistance 2000; _lifeTime = 60; _begin = time; _drop = 0.02 * (15/_lifeTime) * (_alt/50); _brA = _br; waitUntil { _lPos = getPosASL _lt; _flare setPosASL _lPos; _lPos set [2,(_lPos select 2) - _drop]; _lt setPosASL _lPos; if ((random (_br * 1.1)) > _brA) then { _brA = random [(random [(_br * 0.7),(_br * 0.9),_br]),_br,_br]; _lt setLightBrightness _brA; }; ((time - _begin) > _lifeTime) }; deleteVehicle _lt; deleteVehicle _flare; };} swap the flare out for a smoke grenade. Set the trigger to who will be entering it, and then set it to repeatable if you want. 3 Share this post Link to post Share on other sites
Harzach 2518 Posted January 23, 2022 Here's a simple-ish way to do it: Place an APERS tripwire mine and give it a variable name (I'll use "trip1"), DISABLE SIMULATION Place a trigger - Rectangular 1 x 1.5 (this creates a 2 x 3 trigger area) Anyone (or whatever you prefer) non-repeatable OnAct: null = "SmokeShellRed" createVehicle (trip1 getRelPos [1.5,270]); deleteVehicle trip1; The APERS tripwire is 3 meters wide, so the trigger fits right inside. The trigger is 2 meters "long" to make sure that it activates if someone runs through it (triggers evaluate every .5 seconds, and even though now you can change this value, having many triggers that evaluate at a high frequency may impact performance, depending on certain factors.) If you can definitely predict the direction of travel of the "tripper," you might want to offset the trigger so that the majority of it is behind the wire (first picture), other wise just center it (second picture). 3 Share this post Link to post Share on other sites
NotMyActualName 4 Posted January 23, 2022 7 hours ago, Gunter Severloh said: Yes! I had this in a mission i was building except i was using a flare, check it out: Create a trigger, set the size you want and name it tr1 then and put the following code in on activation: nul = thisTrigger spawn { _alt = 80; sleep (_alt/25); _pos = position _this; _pos set [2,_alt]; _flare = "F_40mm_White_Infinite" createVehicle _pos; _br = 6; _lt = "#lightpoint" createVehicle _pos; _lt setLightUseFlare true; _lt setLightDayLight true; _lt setLightBrightness _br; _lt setLightAmbient [0.7,0.7,0.8]; _lt setLightColor [0.7,0.7,0.8]; _lt setLightFlareSize 10; _lt setLightFlareMaxDistance 2000; _lifeTime = 60; _begin = time; _drop = 0.02 * (15/_lifeTime) * (_alt/50); _brA = _br; waitUntil { _lPos = getPosASL _lt; _flare setPosASL _lPos; _lPos set [2,(_lPos select 2) - _drop]; _lt setPosASL _lPos; if ((random (_br * 1.1)) > _brA) then { _brA = random [(random [(_br * 0.7),(_br * 0.9),_br]),_br,_br]; _lt setLightBrightness _brA; }; ((time - _begin) > _lifeTime) }; deleteVehicle _lt; deleteVehicle _flare; };} swap the flare out for a smoke grenade. Set the trigger to who will be entering it, and then set it to repeatable if you want. For some reason that code does not work. It gives me an error (missing "{" ). EDIT: Nvermind, I figured it out: The last } was not needed. Share this post Link to post Share on other sites
NotMyActualName 4 Posted January 23, 2022 6 hours ago, Harzach said: Here's a simple-ish way to do it: Place an APERS tripwire mine and give it a variable name (I'll use "trip1"), DISABLE SIMULATION Place a trigger - Rectangular 1 x 1.5 (this creates a 2 x 3 trigger area) Anyone (or whatever you prefer) non-repeatable OnAct: null = "SmokeShellRed" createVehicle (trip1 getRelPos [1.5,270]); deleteVehicle trip1; The APERS tripwire is 3 meters wide, so the trigger fits right inside. The trigger is 2 meters "long" to make sure that it activates if someone runs through it (triggers evaluate every .5 seconds, and even though now you can change this value, having many triggers that evaluate at a high frequency may impact performance, depending on certain factors.) If you can definitely predict the direction of travel of the "tripper," you might want to offset the trigger so that the majority of it is behind the wire (first picture), other wise just center it (second picture). Thanks! That works fine! Share this post Link to post Share on other sites
Gunter Severloh 4070 Posted January 23, 2022 1 hour ago, NotMyActualName said: It gives me an error (missing "{" ). Because i missed it, some reason the editor likes to add call at the beginning of the codes, and end it with its brackets when i didn't put them there, but glad you seen it. Hope it helps otherwise. Btw no need to quote entire posts, quote something specific from a post or just reply as i know what i said, unless were discussing something from 5yrs ago something. Also the code i posted was a little idea i had for my mission as i mentioned in my previous post, the code was actually put together by my good friend Rydygier, credits to him 👍 Share this post Link to post Share on other sites
NotMyActualName 4 Posted January 23, 2022 3 hours ago, Gunter Severloh said: Btw no need to quote entire posts, quote something specific from a post or just reply as i know what i said, unless were discussing something from 5yrs ago something. Also the code i posted was a little idea i had for my mission as i mentioned in my previous post, the code was actually put together by my good friend Rydygier, credits to him 👍 Ok, sorry .... I am new to this forum. I don't intend to publish the mission that has this in it, it is just for personal use. But if I ever do, I will credit him. Share this post Link to post Share on other sites
Joe98 92 Posted January 26, 2022 On 1/24/2022 at 2:56 AM, NotMyActualName said: Ok, How to make a trip flare = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = In a trigger in the field named On Activation type this: flare = "F_40mm_White" createVehicle [getPos (thislist select 0) select 0, getPos (thislist select 0) select 1,150]; How to use a trigger to fire smoke = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = In a trigger in the field named On Activation type this: smokeshell = "G_40mm_Smoke" createVehicle [getPos (thislist select 0) select 0, getPos (thislist select 0) select 1,150]; In both examples above: “150” is meters above ground level. Trip flare is good at "150" and Smoke is best at “25” Share this post Link to post Share on other sites