Jump to content
Sign in to follow this  
Craig Gilliver

Using Smoke on Mil-2CH

Recommended Posts

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

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:

 

cPdBt3W.png

 

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?

 

  • Like 1

Share this post


Link to post
Share on other sites

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

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;

 

  • Like 1

Share this post


Link to post
Share on other sites

Amazing Harzach! 

 

I'll give that a try. Thanks again for your help! 👍

Share this post


Link to post
Share on other sites

Tried for hours on this. I must be missing something really stupid. 🙃

Share this post


Link to post
Share on other sites

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;

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×