Jump to content
Sign in to follow this  
juleshuxley

Can you put a variable in a cfg?

Recommended Posts

I'n an addon that gives vehicles more smoke grenades, I've patched the smokeLauncherMag to contain 16 smokes:

config.cpp:

class CfgMagazines{
    class VehicleMagazine;
    class CA_Magazine;
    class Default;
    class SmokeLauncherMag: Default
    {
        count = 16;
    };
};

I'm wondering, can that 16 be a variable? And can that variable be changed during a mission, so that on reload, smoke launchers now contain a different number of smokes by default?

Share this post


Link to post
Share on other sites

I presume count is a variable handle.  The 16 assignment is the initialization of the variable.  The configs are not exactly c++, but the syntax is similar.

http://www.cplusplus.com/doc/tutorial/variables/

http://www.cplusplus.com/doc/tutorial/classes/

To change a variable in an instance of a class during runtime requires a setter method that writes to it, like the sqf command https://community.bistudio.com/wiki/setVehicleAmmoDef.

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  

×