What's the point of `#include`? - pennyworth12345/A3_MMSI GitHub Wiki

What's the point of #include?

Often in example configs you'll see the use of #include like the following:

class CfgWorlds
{
    // more stuff before this
    class yourTag_terrainName: SomeInheritedIsland
    {
        // more stuff before this
        #include "clutter.hpp"
    };
    // more stuff after this
};

#include is commonly used in configs to split them into more organized and manageable parts. If the clutter.hpp file mentioned in the previous code block contained the following:

class clutter
{
    class yourTag_someClutterName: DefaultClutter
    {
        // more stuff in here
    };
};

When this PBO is packed and read by the game, it will look like this

class CfgWorlds
{
    // more stuff before this
    class yourTag_terrainName: SomeInheritedIsland
    {
        // more stuff before this
        class clutter
        {
            class yourTag_someClutterName: DefaultClutter
            {
                // more stuff in here
            };
        };
    };
    // more stuff after this
};