Jump to content
Sign in to follow this  
jimmybulmer

Help - config.cpp & model.cfg

Recommended Posts

I am trying to write a config and model.cfg for a bank im making and could do with some support. The building doesn't show up in the editor

class CfgPatches
{
	class CG_BuildingBaseClass_01
	{
		requiredAddons[] = {"A3_Structures_F"};
		requiredVersion = 0.1;
		units[] =
		{
			"Land_CG_CityBank_01_F"
		};
		weapons[] = {};
	};
};

class CfgVehicles
{
    class House;
    class House_F: House
    {
        class DestructionEffects;
    };

    class Land_CG_CityBank_01_F
    {
        scope = 2;
        displayName = "CG CityBank";
        model = "\CG_Structures\CG_Bank_01\Land_CG_CityBank_01_F";
        vehicleClass = "structures";
        mapSize = 20;
        cost = 100000;

        class animationSources
        {
            class Door01_Source
            {
                source = user;
                initPhase = 0;
                animPeriod = 1;
                sound = "GenericDoorsSound";
            };
            class Door02_Source: Door01_Source{};
            class Door03_Source: Door01_Source{};
            class Door04_Source: Door01_Source{};
            class Door05_Source: Door01_Source{};
            class Door06_Source: Door01_Source{};
            class Door07_Source: Door01_Source{};
            class Door08_Source: Door01_Source{};
            class UserActions
            {
                class Door01_Open
                {
                    displayNameDefault = "<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />'";
                    displayName = "Open Door";
                    position = Door01_Trigger;
                    priority = 0.4;
                    radius = 2;
                    onlyForPlayer = true;
                    condition = "this animationPhase ""Door01"" < 0.5";
                    statement = "this animate [""Door01"", 1];";
                };
                class Door01_Close: Door01_Open
                {
                    displayName = "Close Door";
                    condition = "this animationPhase ""Door01"" >= 0.5";
                    statement = "this animate [""Door01"", 0];";
                };
                class Door02_Open: Door01_Open
                {
                    position = Door02_Trigger;
                    condition = "this animationPhase ""Door02"" < 0.5";
                    statement = "this animate [""Door02"", 1];";
                };
                class Door02_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door02"" >= 0.5";
                    statement = "this animate [""Door02"", 0];";
                };
                class Door03_Open: Door01_Open
                {
                    position = Door03_Trigger;
                    condition = "this animationPhase ""Door03"" < 0.5";
                    statement = "this animate [""Door03"", 1];";
                };
                class Door03_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door03"" >= 0.5";
                    statement = "this animate [""Door03"", 0];";
                };
                class Door04_Open: Door01_Open
                {
                    position = Door04_Trigger;
                    condition = "this animationPhase ""Door04"" < 0.5";
                    statement = "this animate [""Door04"", 1];";
                };
                class Door04_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door04"" >= 0.5";
                    statement = "this animate [""Door04"", 0];";
                };
                class Door05_Open: Door01_Open
                {
                    position = Door05_Trigger;
                    condition = "this animationPhase ""Door05"" < 0.5";
                    statement = "this animate [""Door05"", 1];";
                };
                class Door05_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door05"" >= 0.5";
                    statement = "this animate [""Door05"", 0];";
                };
                class Door06_Open: Door01_Open
                {
                    position = Door06_Trigger;
                    condition = "this animationPhase ""Door06"" < 0.5";
                    statement = "this animate [""Door06"", 1];";
                };
                class Door06_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door06"" >= 0.5";
                    statement = "this animate [""Door06"", 0];";
                };
                class Door07_Open: Door01_Open
                {
                    position = Door07_Trigger;
                    condition = "this animationPhase ""Door07"" < 0.5";
                    statement = "this animate [""Door07"", 1];";
                };
                class Door07_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door07"" >= 0.5";
                    statement = "this animate [""Door07"", 0];";
                };
                class Door08_Open: Door01_Open
                {
                    position = Door08_Trigger;
                    condition = "this animationPhase ""Door08"" < 0.5";
                    statement = "this animate [""Door08"", 1];";
                };
                class Door08_Close: Door02_Open
                {
                    condition = "this animationPhase ""Door08"" >= 0.5";
                    statement = "this animate [""Door08"", 0];";
                };
            };

            actionBegin1 = Door01_open;
            actionEnd1 = Door01_Open;
            actionBegin2 = Door02_Open;
            actionEnd2 = Door02_Open;
            actionBegin3 = Door03_Open;
            actionEnd3 = Door03_Open;
            actionBegin4 = Door04_Open;
            actionEnd4 = Door04_Open;
            actionBegin5 = Door05_Open;
            actionEnd5 = Door05_Open;
            actionBegin6 = Door06_Open;
            actionEnd6 = Door06_Open;
            actionBegin7 = Door07_Open;
            actionEnd7 = Door07_Open;
            actionBegin8 = Door08_Open;
            actionEnd8 = Door08_Open;

            numberOfDoors = 9;
        };
    };
};

model.cfg:

class CfgSkeletons
{
    class Default
    {
        isDiscrete = 1;
        skeletonInherit = "";
        skeletonBones[] = {};
    };

    class CG_CityBank_01_F_skeleton: Default
    {
        skeletonInherit = "Default";
        skeletonBones[] =
        {
            "Door01",                   "",

            "Door02",                   "",

            "Door03",                   "",

            "Door04",                   "",

            "Door05",                   "",

            "Door06",                   "",

            "Door07",                   "",

            "Door08",                   "",

            "VaultDoor_Full",           "",
            "VaultDoor_Handle",         "VaultDoor_Full",
            "VaultDoor_Handle_Axis",    "VaultDoor_Full",
            "VaultDoor_Bottom",         "VaultDoor_Full",
            "VaultDoor_Bottom_Axis",    "VaultDoor_Full"
        };
    };
};

class CfgModels
{
    class default
    {
        sectionsInherit = "";
        sections[] = {};
        skeletonName = "";
    };

    class CG_CityBank_01_F: Default
    {
        skeletonName = "CG_CityBank_01_F_skeleton";
        sections[] = {};
        sectionsInherit = "";
        class Animations
        {
            class Door01_rot
            {
                type            = rotation;
                source          = Door01_Source;
                selection       = Door01;
                axis            = Door01_Axis;
                memory          = 1;
                minValue        = 0;
                maxValue        = 1;
                angle0          = 0;
                angle1          = (rad 110)
            };

            class Door02_rot: Door01_rot
            {
                source          = Door02_Source;
                selection       = Door02;
                axis            = Door02_Axis;
            };

            class Door03_rot: Door01_rot
            {
                source          = Door03_Source;
                selection       = Door03;
                axis            = Door03_Axis;
            };

            class Door04_rot: Door01_rot
            {
                source          = Door04_Source;
                selection       = Door04;
                axis            = Door04_Axis;
            };

            class Door05_rot: Door01_rot
            {
                source          = Door05_Source;
                selection       = Door05;
                axis            = Door05_Axis;
            };

            class Door06_rot: Door01_rot
            {
                source          = Door06_Source;
                selection       = Door06;
                axis            = Door06_Axis;
            };

            class Door07_rot: Door01_rot
            {
                source          = Door07_Source;
                selection       = Door07;
                axis            = Door07_Axis;
            };

            class Door08_rot: Door01_rot
            {
                source          = Door08_Source;
                selection       = Door08;
                axis            = Door08_Axis;
            };
        };
    };
};

Any help is appreciated

Share this post


Link to post
Share on other sites

As for the side issue, afaik, you forgot to include a side value. EG: east, west, etc. I'm not sure what you would put for a static object though. This is found in the config.hpp and goes in the same section as the scope, map size and the model path. I'm not too sure though, as I make vehicles and not static objects.

I believe this is in the wrong sub section- shouldn't it be in O2/ modelling help?

Share this post


Link to post
Share on other sites

Have you subscribed Arma3 samples where a house is present? Also, shouldn't you inherit the addon from something? As far as you're inheriting properly, there's no need to put "side" entry into config.cpp.

 

Instead:

class Land_CG_CityBank_01_F
    {
        scope = 2;
        displayName = "CG CityBank";
        model = "\CG_Structures\CG_Bank_01\Land_CG_CityBank_01_F";

I would use something loike this:

class Land_CG_CityBank_01_F: House_F
    {
        scope = 2;
        displayName = "CG CityBank";
        model = "\CG_Structures\CG_Bank_01\Land_CG_CityBank_01_F";

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  

×