Pages

Fix School Door DayZ

That guide about how to do doors of Guard house openable. But we have an 1 problem. If we open 1 door, then all doors in building is opening. o_O

Originnaly we only adding in config, user action and animation strings.

1. Extract the "config.bin" file from "structures_military.pbo"
2. Convert "config.bin" with UnRap to "config.cpp"
3. Open "config.cpp" with notepad and search for
class Land_Mil_Guardhouse : HouseNoDestruct {
        scope = 1;
        model = "\dz\structures\Mil\Mil_Guardhouse.p3d";
than rewrite like that
class Land_Mil_Guardhouse : House {
        scope = 1;
        model = "\dz\structures\Mil\Mil_Guardhouse.p3d";
than go to down and there we have
class Doors {
            class Doors1 {
than we rewrite like this
class AnimationSources {
            class Doors1 {
than, after this
class Doors4 {
                displayName = "door 4";
                component = "Doors4";
                soundPos = "doors4_action";
                animPeriod = 1;
                initPhase = 0;
                initOpened = 0.5;
                armor = 0.2;
                soundOpen = "doorMetalSmallOpen";
                soundClose = "doorMetalSmallClose";
                soundLocked = "doorWoodRattle";
            };
        };
add this
class UserActions 
        {
            class OpenDoors1
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors1_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors1"" < 0.5";
                statement = "this animate [""Doors1"", 1];";
            };
            class CloseDoors1
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors1_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors1"" >= 0.5";
                statement = "this animate [""Doors1"", 0];";
            };
            class OpenDoors2
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors2_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors2"" < 0.5";
                statement = "this animate [""Doors2"", 1];";
            };
            class CloseDoors2
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors2_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors2"" >= 0.5";
                statement = "this animate [""Doors2"", 0];";
            };
            class OpenDoors3
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors3_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors3"" < 0.5";
                statement = "this animate [""Doors3"", 1];";
            };
            class CloseDoors3
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors3_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors3"" >= 0.5";
                statement = "this animate [""Doors3"", 0];";
            };
            class OpenDoors4
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors4_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors4"" < 0.5";
                statement = "this animate [""Doors4"", 1];";
            };
            class CloseDoors4
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors4_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors4"" >= 0.5";
                statement = "this animate [""Doors4"", 0];";
            };
        };
then save file and add it to "structures_military.pbo"
go to game and be happy) Doors work

For the lazzy peoples - here is full script.
find the "class Land_Mil_Guardhouse : HouseNoDestruct" and replace all with that.
class Land_Mil_Guardhouse : House {
        scope = 1;
        model = "\dz\structures\Mil\Mil_Guardhouse.p3d";

        class AnimationSources {
            
            class Doors1 {
                displayName = "door 1";
                component = "Doors1";
                soundPos = "doors1_action";
                animPeriod = 1;
                initPhase = 0;
                initOpened = 0.4;
                armor = 0.2;
                soundOpen = "doorWoodSmallOpen";
                soundClose = "doorWoodSmallClose";
                soundLocked = "doorWoodRattle";
            };
            
            class Doors2 {
                displayName = "door 2";
                component = "Doors2";
                soundPos = "doors2_action";
                animPeriod = 1;
                initPhase = 0;
                initOpened = 0.4;
                armor = 0.2;
                soundOpen = "doorWoodSmallOpen";
                soundClose = "doorWoodSmallClose";
                soundLocked = "doorWoodRattle";
            };
            
            class Doors3 {
                displayName = "door 3";
                component = "Doors3";
                soundPos = "doors3_action";
                animPeriod = 1;
                initPhase = 0;
                initOpened = 0.2;
                armor = 0.2;
                soundOpen = "doorWoodSmallOpen";
                soundClose = "doorWoodSmallClose";
                soundLocked = "doorWoodRattle";
            };
            
            class Doors4 {
                displayName = "door 4";
                component = "Doors4";
                soundPos = "doors4_action";
                animPeriod = 1;
                initPhase = 0;
                initOpened = 0.5;
                armor = 0.2;
                soundOpen = "doorMetalSmallOpen";
                soundClose = "doorMetalSmallClose";
                soundLocked = "doorWoodRattle";
            };
        };
        class UserActions 
        {
            class OpenDoors1
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors1_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors1"" < 0.5";
                statement = "this animate [""Doors1"", 1];";
            };
            class CloseDoors1
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors1_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors1"" >= 0.5";
                statement = "this animate [""Doors1"", 0];";
            };
            class OpenDoors2
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors2_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors2"" < 0.5";
                statement = "this animate [""Doors2"", 1];";
            };
            class CloseDoors2
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors2_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors2"" >= 0.5";
                statement = "this animate [""Doors2"", 0];";
            };
            class OpenDoors3
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors3_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors3"" < 0.5";
                statement = "this animate [""Doors3"", 1];";
            };
            class CloseDoors3
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors3_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors3"" >= 0.5";
                statement = "this animate [""Doors3"", 0];";
            };
            class OpenDoors4
            {
                displayNameDefault = "Open door";
                displayName = "Open door";
                position = "Doors4_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors4"" < 0.5";
                statement = "this animate [""Doors4"", 1];";
            };
            class CloseDoors4
            {
                displayNameDefault = "Close door";
                displayName = "Close door";
                position = "Doors4_action";
                radius = 3;
                onlyForPlayer = 0;
                condition = "this animationPhase ""Doors4"" >= 0.5";
                statement = "this animate [""Doors4"", 0];";
            };
        };
    };
};
If add "class UserActions" for school building, doors work's too.

2fed
Ragezone