Jump to content
Teutch

Module condition of presence

Recommended Posts

Hello,

I would like to create a script that is able to desactivate or activate a module present on the map.

 

I thought about :                      _moduleName enableSimulation false;

or :                                             Variable == true;           Inside the condition of presence of the specific module.

 

But nothing seems to work.

Any ideas ?

 

Thanks in advance !

Share this post


Link to post
Share on other sites

You can't do that. You need to spawn the module. The condition of presence (if any) is always checked at start and not further.

 

Some modules, like BI support must be synced with player(s). So you can sync/desync with specific commands/functions like BIS_fnc_addSupportLink

It's a specific case anyway.

 

Perhaps you can script something equivalent, along with conditions.

(The reason why I usually add a (looped) condition field in my own MGI modules).

  • Like 1

Share this post


Link to post
Share on other sites

What module specifically? Some can be de/activated via triggers.

Share this post


Link to post
Share on other sites

Thanks again Pierremgi !

 

7 hours ago, pierremgi said:

The condition of presence (if any) is always checked at start and not further

 

So is there a way of ensuring that a module present in the scenario, is enabled/disabled at the very begining thanks to variable checked at the start ?

 

4 hours ago, Larrow said:

What module specifically?

 

It's a module from the mod arma commander.

Share this post


Link to post
Share on other sites

I think I've found how to do it, for anyone looking to do something similar.

 

As a trigger leading to the script with execVM wouldn't have worked, (because made after the game start)

I used the description.ext file which is read before the start of the mission, and in it I added :
 

class CfgFunctions {
    class Addon {
        class Function {
            class preInit {
                file = "script.sqf";
                preInit = 1;
            };
        };
    };
};

 

There may be a simpler technique, but all that's needed is for a variable in the script.sqf to be set to true,

Variable = true; then in the module condition Variable == true;

 

and this will make the module work or not !

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

×