Jump to content
Sign in to follow this  
jimmybulmer

Custom Building - Windows - HELP please!!!

Recommended Posts

Hi, I have been making a custom building and am on the final few stages of it, However I cant seem to get the windows to work (I have never done windows before and am a bit lost)

If anyone could link me to a guide on how to do windows that would be much appreciated or tell me what I need to do in the comments.

Config.cpp

#include "config_macros_glass.hpp"

class CfgPatches
{
    class CG_CityBank
    {
        unit[] = {"CG_CityBank"};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Structures_F"};
    };
};

class CfgVehicles
{
    class House;
    class House_F: House{};
    class CG_CityBank : House_F
    {
        scope = 2;
        model = "\CG_Buildings\CG_CityBank.p3d";
        displayName = "City Bank";
        vehicleClass = "CG_Category";
        editorCategory = "CG_Category";
        edtiorSubcategory = "CG_Structures";
        cost = 50000;
        author = "CG_JimmyBulmer";

        class AnimationSources
        {
            class Door_01_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 2;
            };
            class Door_02_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 2;
            };
            class Door_03_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 2;
            };
            class Door_04_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 2;
            };
            class Door_05_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 1;
            };
            class Door_06_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 1;
            };
            class Door_07_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 1;
            };
            class Door_08_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 1;
            };
            class VaultDoor_Handle_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 10;
            };
            class VaultDoor_Full_Rotation
            {
                source = "user";
                initPhase = 0;
                animPeriod = 10;
            };
            class Glass_1_Source
            {
                source="Hit";
                hitpoint = "Glass_1_";
            };
        };

        class UserActions
        {
            class VaultDoor_Open
            {
                displayName = "Open Vault Door";
                position = "VaultDoor_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""VaultDoor_Handle_Rotation"" < 0.5";
                statement = "this animate [""VaultDoor_Handle_Rotation"", 1]; this animate[""VaultDoor_Full_Rotation"", 1];";
            };
            class VaultDoor_Close
            {
                displayName = "Close Vault Door";
                position = "VaultDoor_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""VaultDoor_Handle_Rotation"" >= 0.5";
                statement = "this animate [""VaultDoor_Full_Rotation"", 0]; this animate [""VaultDoor_Handle_Rotation"",0];";
            };
            class Front_Door_Right_Open
            {
                displayName = "Open Doors";
                position = "FrontDoor_Right_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_01_Rotation"" < 0.5";
                statement = "this animate [""Door_01_Rotation"", 1]; this animate [""Door_02_Rotation"", 1];";
            };
            class Front_Door_Right_Close
            {
                displayName = "Close Doors";
                position = "FrontDoor_Right_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_01_Rotation"" >= 0.5";
                statement = "this animate [""Door_01_Rotation"", 0]; this animate [""Door_02_Rotation"", 0];";
            };
            class Front_Door_Left_Open
            {
                displayName = "Open Doors";
                position = "FrontDoor_Left_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_03_Rotation"" < 0.5";
                statement = "this animate [""Door_03_Rotation"", 1]; this animate [""Door_04_Rotation"", 1];";
            };
            class Front_Door_Left_Close
            {
                displayName = "Close Doors";
                position = "FrontDoor_Left_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_03_Rotation"" >= 0.5";
                statement = "this animate [""Door_03_Rotation"", 0]; this animate [""Door_04_Rotation"", 0];";
            };
            class Door_05_Open
            {
                displayName = "Open Door";
                position = "Door_05_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_05_Rotation"" < 0.5";
                statement = "this animate [""Door_05_Rotation"", 1];";
            };
            class Door_05_Close
            {
                displayName = "Close Door";
                position = "Door_05_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_05_Rotation"" >= 0.5";
                statement = "this animate [""Door_05_Rotation"", 0];";
            };
            class Door_06_Open
            {
                displayName = "Open Door";
                position = "Door_06_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_06_Rotation"" < 0.5";
                statement = "this animate [""Door_06_Rotation"", 1];";
            };
            class Door_06_Close
            {
                displayName = "Close Door";
                position = "Door_06_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_06_Rotation"" >= 0.5";
                statement = "this animate [""Door_06_Rotation"", 0];";
            };
            class Door_07_Open
            {
                displayName = "Open Door";
                position = "Door_07_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_07_Rotation"" < 0.5";
                statement = "this animate [""Door_07_Rotation"", 1];";
            };
            class Door_07_Close
            {
                displayName = "Close Door";
                position = "Door_07_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_07_Rotation"" >= 0.5";
                statement = "this animate [""Door_07_Rotation"", 0];";
            };
            class Door_08_Open
            {
                displayName = "Open Door";
                position = "Door_08_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_08_Rotation"" < 0.5";
                statement = "this animate [""Door_08_Rotation"", 1];";
            };
            class Door_08_Close
            {
                displayName = "Close Door";
                position = "Door_08_Trigger";
                radius = 2;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Door_08_Rotation"" >= 0.5";
                statement = "this animate [""Door_08_Rotation"", 0];";
            };
        };
    };
};

Model.cfg

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

    class CG_CityBank_bones : Default
    {
        skeletonInherit = "Default";
        skeletonBones[] =
        {
            "Door_01","",
            "Door_02","",
            "Door_03","",
            "Door_04","",
            "Door_05","",
            "Door_06","",
            "Door_07","",
            "Door_08","",
            "VaultDoor_Full","",
            "VaultDoor_Handle","VaultDoor_Full",
            "VaultDoor_Handle_Axis","VaultDoor_Full",
            "Glass_1_Hide","",
            "Glass_1_Unhide",""
        };
    };
};

class CfgModels
{
    class Default
    {
        sectionsInherit = "";
        sections[] = {};
        skeletonName = "";
    };
    class CG_CityBank : Default
    {
        skeletonName = "CG_CityBank_bones";
        sections[] =
        {
            "Glass_1_Hide"
        };
        sectionsInherit = "";

        class Animations
        {
            class VaultDoor_Handle_Rotation
            {
                type="rotationZ";
                source="user";
                selection="VaultDoor_Handle";
                axis="VaultDoor_Handle_Axis";
                memory=1;
                minValue=0;
                maxValue=0.25;
                animPeriod=0;
                angle0=0;
                angle1="rad 360";
            };
            class VaultDoor_Full_Rotation
            {
                type="rotation";
                source="user";
                selection="VaultDoor_Full";
                axis="VaultDoor_Full_Axis";
                memory=1;
                minValue=0.25;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad 90";
            };
            class Door_01_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_01";
                axis="Door_01_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad -100";
            };
            class Door_02_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_02";
                axis="Door_02_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad 100";
            };
            class Door_03_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_03";
                axis="Door_03_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad 100";
            };
            class Door_04_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_04";
                axis="Door_04_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad -100";
            };
            class Door_05_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_05";
                axis="Door_05_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad -105";
            };
            class Door_06_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_06";
                axis="Door_06_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad 105";
            };
            class Door_07_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_07";
                axis="Door_07_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad -100";
            };
            class Door_08_Rotation
            {
                type="rotation";
                source="user";
                selection="Door_08";
                axis="Door_08_Axis";
                memory=1;
                minValue=0;
                maxValue=1;
                animPeriod=0;
                angle0=0;
                angle1="rad 100";
            };

            class Glass_1_Hide
            {
                type="hide";
                source="Glass_1_Source";
                selection="Glass_1_Hide";
                minValue=0;
                maxValue=1;
                hideValue=0.99999;
            };
            class Glass_1_Unhide: Glass_1_Hide
            {
                selection="Glass_1_unhide";
                hideValue=0;
                unhideValue=0.99999;
            };
        };
    };
};

config_macros_glass.hpp

#define DOOR_GLASS_HITPOINT(glassID,arm,rad) \
			class Glass_##glassID##_hitpoint \
			{ \
				armor = arm; \
				material = -1; \
				name = Glass_##glassID; \
				visual = Glass_##glassID##_hide; \
				passThrough = 0; \
				radius = rad; \
				convexComponent = Glass_##glassID##_hide; \
				class DestructionEffects \
				{ \
					class BrokenGlass1 \
					{ \
						simulation = "particles"; \
						type = "BrokenGlass1ND"; \
						position = Glass_##glassID##_effects; \
						intensity = 0.15000001; \
						interval = 1; \
						lifeTime = 0.05; \
					}; \
					class BrokenGlass2: BrokenGlass1 \
					{ \
						type = "BrokenGlass2ND"; \
					}; \
					class BrokenGlass3: BrokenGlass1 \
					{ \
						type = "BrokenGlass3ND"; \
					}; \
					class BrokenGlass4: BrokenGlass1 \
					{ \
						type = "BrokenGlass4ND"; \
					}; \
					class BrokenGlass5: BrokenGlass1 \
					{ \
						type = "BrokenGlass5ND"; \
					}; \
					class BrokenGlass6: BrokenGlass1 \
					{ \
						type = "BrokenGlass6ND"; \
					}; \
					class BrokenGlass7: BrokenGlass1 \
					{ \
						type = "BrokenGlass7ND"; \
					}; \
					class BrokenGlass1S: BrokenGlass1 \
					{ \
						type = "BrokenGlass1SD"; \
					}; \
					class BrokenGlass2S: BrokenGlass1 \
					{ \
						type = "BrokenGlass2SD"; \
					}; \
					class BrokenGlass3S: BrokenGlass1 \
					{ \
						type = "BrokenGlass3SD"; \
					}; \
					class BrokenGlass4S: BrokenGlass1 \
					{ \
						type = "BrokenGlass4SD"; \
					}; \
					class BrokenGlass5S: BrokenGlass1 \
					{ \
						type = "BrokenGlass5SD"; \
					}; \
					class BrokenGlass6S: BrokenGlass1 \
					{ \
						type = "BrokenGlass6SD"; \
					}; \
					class BrokenGlass7S: BrokenGlass1 \
					{ \
						type = "BrokenGlass7SD"; \
					}; \
				}; \
			};

#define BIG_GLASS_HITPOINT(glassID,arm,rad) \
			class Glass_##glassID##_hitpoint \
			{ \
				armor = arm; \
				material = -1; \
				name = Glass_##glassID; \
				visual = Glass_##glassID##_hide; \
				passThrough = 0; \
				radius = rad; \
				convexComponent = Glass_##glassID##_hide; \
				class DestructionEffects \
				{ \
					class BrokenGlass1 \
					{ \
						simulation = "particles"; \
						type = "BrokenGlass1NB"; \
						position = Glass_##glassID##_effects; \
						intensity = 0.15000001; \
						interval = 1; \
						lifeTime = 0.05; \
					}; \
					class BrokenGlass2: BrokenGlass1 \
					{ \
						type = "BrokenGlass2NB"; \
					}; \
					class BrokenGlass3: BrokenGlass1 \
					{ \
						type = "BrokenGlass3NB"; \
					}; \
					class BrokenGlass4: BrokenGlass1 \
					{ \
						type = "BrokenGlass4NB"; \
					}; \
					class BrokenGlass5: BrokenGlass1 \
					{ \
						type = "BrokenGlass5NB"; \
					}; \
					class BrokenGlass6: BrokenGlass1 \
					{ \
						type = "BrokenGlass6NB"; \
					}; \
					class BrokenGlass7: BrokenGlass1 \
					{ \
						type = "BrokenGlass7NB"; \
					}; \
					class BrokenGlass1S: BrokenGlass1 \
					{ \
						type = "BrokenGlass1SB"; \
					}; \
					class BrokenGlass2S: BrokenGlass1 \
					{ \
						type = "BrokenGlass2SB"; \
					}; \
					class BrokenGlass3S: BrokenGlass1 \
					{ \
						type = "BrokenGlass3SB"; \
					}; \
					class BrokenGlass4S: BrokenGlass1 \
					{ \
						type = "BrokenGlass4SB"; \
					}; \
					class BrokenGlass5S: BrokenGlass1 \
					{ \
						type = "BrokenGlass5SB"; \
					}; \
					class BrokenGlass6S: BrokenGlass1 \
					{ \
						type = "BrokenGlass6SB"; \
					}; \
					class BrokenGlass7S: BrokenGlass1 \
					{ \
						type = "BrokenGlass7SB"; \
					}; \
				}; \
			};

#define NORMAL_GLASS_HITPOINT(glassID,arm,rad) \
			class Glass_##glassID##_hitpoint \
			{ \
				armor = arm; \
				material = -1; \
				name = Glass_##glassID; \
				visual = Glass_##glassID##_hide; \
				passThrough = 0; \
				radius = rad; \
				convexComponent = Glass_##glassID##_hide; \
				class DestructionEffects \
				{ \
					class BrokenGlass1 \
					{ \
						simulation = "particles"; \
						type = "BrokenGlass1NN"; \
						position = Glass_##glassID##_effects; \
						intensity = 0.15000001; \
						interval = 1; \
						lifeTime = 0.05; \
					}; \
					class BrokenGlass2: BrokenGlass1 \
					{ \
						type = "BrokenGlass2NN"; \
					}; \
					class BrokenGlass3: BrokenGlass1 \
					{ \
						type = "BrokenGlass3NN"; \
					}; \
					class BrokenGlass4: BrokenGlass1 \
					{ \
						type = "BrokenGlass4NN"; \
					}; \
					class BrokenGlass5: BrokenGlass1 \
					{ \
						type = "BrokenGlass5NN"; \
					}; \
					class BrokenGlass6: BrokenGlass1 \
					{ \
						type = "BrokenGlass6NN"; \
					}; \
					class BrokenGlass7: BrokenGlass1 \
					{ \
						type = "BrokenGlass7NN"; \
					}; \
					class BrokenGlass1S: BrokenGlass1 \
					{ \
						type = "BrokenGlass1SN"; \
					}; \
					class BrokenGlass2S: BrokenGlass1 \
					{ \
						type = "BrokenGlass2SN"; \
					}; \
					class BrokenGlass3S: BrokenGlass1 \
					{ \
						type = "BrokenGlass3SN"; \
					}; \
					class BrokenGlass4S: BrokenGlass1 \
					{ \
						type = "BrokenGlass4SN"; \
					}; \
					class BrokenGlass5S: BrokenGlass1 \
					{ \
						type = "BrokenGlass5SN"; \
					}; \
					class BrokenGlass6S: BrokenGlass1 \
					{ \
						type = "BrokenGlass6SN"; \
					}; \
					class BrokenGlass7S: BrokenGlass1 \
					{ \
						type = "BrokenGlass7SN"; \
					}; \
				}; \
			};

Im sure that those configs aren't right (the macros is just copied from the ARMA samples. If anyone could show me how to A - remove the need for macros and have it done inside the config.cpp and B how to get it working, or link me a guide I will be very grateful 

 

I would like to also note at the moment only one window is in the p3d I have the visual lod defined as Glass_1_Hide and Glass_1_Unhide, the GEO lod has just Glass_1_Hide (as well as physX) There is no memory lod for it (that ive put anyway) and the hitpoints are Glass_1 there is only 4 vertices in each corner(between each two vertices in top right, left ect) 

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  

×