Craig Gilliver 36 Posted May 24, 2023 Hello everyone. Please forgive me, incoming stupid question. I'm trying to get an AI Mil-2CH to dispense smoke and found the code - Quote [this] call gm_countermeasures_fnc_engine_smoke_toggle; Can I add this to the init section on the object? I've tried without success. A get "missing ;" error. Would anyone have a really simple description as to how I might make this work? I'm 100% noob at this! Thank you! Share this post Link to post Share on other sites
Harzach 2507 Posted May 24, 2023 The error is due to a corrupt/invisible character in your code. Use code blocks when pasting code to the forum -these characters will appear as red dots: Just delete any dots and re-copy your code. That said, placing this in the init of your heli should turn the smoke on at mission start. Turning it off will require calling the function on the heli again, with second param set to "true" as per the GM Wiki. What is it you actually want to do? 1 Share this post Link to post Share on other sites
Craig Gilliver 36 Posted May 24, 2023 Thank you for replying, Harzach. I appreciate it. At this moment in time, I'm just wanting to create some screenshots, so that would work fine for now. In a perfect world, I'd like to switch the smoke on via a trigger if that's possible, then use another trigger to switch it off. Or just have the smoke used over a certain area of a map/scenario. My guess that is going to be more complicated? Or I'm looking at the problem and trying the wrong solution? 😁 Share this post Link to post Share on other sites
Harzach 2507 Posted May 24, 2023 Using a trigger should be easy. Just give the heli a variable name (heli1 for example), then in your trigger: //Condition: heli1 inArea thisTrigger //On Activation: [this] call gm_countermeasures_fnc_engine_smoke_toggle; //On Deactivation: [this, true] call gm_countermeasures_fnc_engine_smoke_toggle; 1 Share this post Link to post Share on other sites
Craig Gilliver 36 Posted May 24, 2023 Amazing Harzach! I'll give that a try. Thanks again for your help! 👍 Share this post Link to post Share on other sites
Craig Gilliver 36 Posted May 30, 2023 Tried for hours on this. I must be missing something really stupid. 🙃 Share this post Link to post Share on other sites
Harzach 2507 Posted May 30, 2023 That's because I forgot to change the param being passed to the function. //Condition: heli1 inArea thisTrigger //On Activation: [heli1] call gm_countermeasures_fnc_engine_smoke_toggle; //On Deactivation: [heli1, true] call gm_countermeasures_fnc_engine_smoke_toggle; 1 1 Share this post Link to post Share on other sites
Craig Gilliver 36 Posted May 30, 2023 Ahhhhhh! Yes, that would make sense. Thank you! I thought I was going mad! I'll try this later. Share this post Link to post Share on other sites
Craig Gilliver 36 Posted June 5, 2023 This worked perfectly. Thanks again Harzach. 1 Share this post Link to post Share on other sites