Jump to content
Sign in to follow this  
Guest

Adding a Door to an object

Recommended Posts

Guest

Ok first to explain what im trying to do...

I have an stone archway model and a gate/door model.

The Gate/door model has both a frame and the gate/door.

I would like the Gate/door model to work like a normal door as seen in bressebs tut. But something in ARMA is not allowing it to work. The idea is to be able to knock it down and out of the arch.

A friend has help me with the cfgskeleton set up. But its still not working....

Is there a special class new to ARMA that allows it to work?

I really have very limited config experience...please keep this in mind.

I have heard about a way to handle it via the init line, but this will rotate the entire object. In my case both the frame and the gate.

gatescreen.jpgfound this.... but still not working

Share this post


Link to post
Share on other sites
Guest
Quote[/b] ]

// basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0

#define WeaponSlotPrimary 1

#define WeaponSlotSecondary 16

#define WeaponSlotItem 256

#define WeaponSlotBinocular 4096

#define WeaponHardMounted 65536

class CfgPatches

{

class EXTRAS

{

units[] = {"testdoor"};

weapons[] = {};

requiredVersion = 1.00;

};

};

class cfgVehicleClasses

{

class TESTDOOR

{

displayName="testdoor";

};

};

class CfgVehicles

{

class House;

class testdoor: HOUSE

{

model="\testdoor\testdoor.p3d";

vehicleclass="TESTDOOR"

armor=10000;

scope=2;

mapsize=2.2;

displayName="testdoor";

};

};

class CfgSkeletons

{

class house; //Define base class.

class testdoorBones: house

{

isDiscrete=1;

skeletonInherit = ""; //Inherit all bones from class Car.

skeletonBones[]=

{

"door","case"

};

};

};

class cfgModels

{

class house;

class testdoor: house

{

skeletonName = "testdoorBones";

sectionsInherit="";

sections[]=

{

};

class Animations

{

class door

{

type ="rotation";

initPhase=1;

source = "Doors";

animPeriod =3;

sourceAddress = "clamp";

selection ="door";

axis ="osaDoor";

angle0 =0;

angle1 =-1.574387;

};

};

};

};

class AnimationSources

{

class Doors // Should be the same as your selection name.

{

source = "user"; //The controller is defined as a user animation.

animPeriod = 1; //The animation period used for this controller.

initPhase=0; //Initial phase when object is created. 0 = CLOSED

};

};

class UserActions

{

class opendoor

{

displayName="Open Door";

position="osadoor";

onlyforplayer=1;

radius=4;

condition= "this animationphase ""door"" < 0.5";

statement = "this animate [""door"", 0]";

};

class closedoor

{

displayName="Close Door";

position="osadoor";

onlyforplayer= false;

radius=5;

condition= "this animationphase ""door"" > 0.5";

statement = "this animate [""door"", 1]";

};

};

Share this post


Link to post
Share on other sites

Your AnimationSources (and UserAction) section(s) is in the wrong place, it should be in the CfgVehicle class:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles

{

    class House;

    class testdoor: HOUSE

    {

         model="\testdoor\testdoor.p3d";

         vehicleclass="TESTDOOR"

         armor=10000;

         scope=2;

         mapsize=2.2;

         displayName="testdoor";

         class AnimationSources

         {

              class  Doors

              {

                   source = "user";

                   animPeriod = 1;

                   initPhase=0;

              };

         };

         class UserActions

         {

              class opendoor

              {

                   displayName="Open Door";

                   position="osadoor";

                   onlyforplayer=1;

                   radius=4;

                   condition= "this animationphase ""door"" < 0.5";

                   statement = "this animate [""door"", 0]";

              };

              class closedoor

              {

                   displayName="Close Door";

                   position="osadoor";

                   onlyforplayer= false;

                   radius=5;

                   condition= "this animationphase ""door"" > 0.5";

                   statement = "this animate [""door"", 1]";

              };

         };

    };

};

The other sections are all fine as they are.

Share this post


Link to post
Share on other sites
Guest

how do i get your new config into mine.... Thing is im not sure what goes first...do the cfgmodels go above the cfg vehicles or vice versa.

I feel really ashamed but really am not able to get my head around bits of code.

I want to learn it, but am only getting more confused... banghead.gif

Could you please post the config with the sections reordered so i can see what the complete config needs to look like. I think at this point i can compare my broken version to the fixed version.

ribbit crazy_o.gif

Share this post


Link to post
Share on other sites

djfrogstar, if you haven't solved it by sunday, send it to me and i help you out.

Share this post


Link to post
Share on other sites
Guest

banghead.gif yeah no luck.... i think the bottom line is I havnt got a clue on configs... and am not even able to comprehend the help im getting. So far 4 people have all tried and no success... I really dont like wasting peoples time...

unfotunately it will need to stay a static nonworking door for now

Its a shame that BIS is holding out the tools and knowledge which would come with it. Where is bresseb for ARMA?

Share this post


Link to post
Share on other sites

Typically the CfgSkeletons and CfgModels sections are written first, however I don't think it makes any difference in terms of how the game reads it. Here I'll rearrange your entire config for you:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0

#define WeaponSlotPrimary 1

#define WeaponSlotSecondary 16

#define WeaponSlotItem 256

#define WeaponSlotBinocular 4096

#define WeaponHardMounted 65536

class CfgPatches

{

class EXTRAS

{

units[] = {"testdoor"};

weapons[] = {};

requiredVersion = 1.00;

};

};

class CfgSkeletons

{

class house; //Define base class.

class testdoorBones: house

{

isDiscrete=1;

skeletonInherit = ""; //Inherit all bones from class Car.

skeletonBones[]=

{

"door",

"case"

};

};

};

class cfgModels

{

class house;

class testdoor: house

{

skeletonName = "testdoorBones";

sectionsInherit="";

sections[]={door};

class Animations

{

class door

{

type ="rotation";

initPhase=1;

source = "Doors";

animPeriod =3;

sourceAddress = "clamp";

selection ="door";

axis ="osaDoor";

angle0 =0;

angle1 =-1.574387;

};

};

};

};

class cfgVehicleClasses

{

class TESTDOOR

{

displayName="testdoor";

};

};

class CfgVehicles

{

class House;

class testdoor: HOUSE

{

model="\testdoor\testdoor.p3d";

vehicleclass="TESTDOOR"

armor=10000;

scope=2;

mapsize=2.2;

displayName="testdoor";

class AnimationSources

{

class Doors

{

source = "user";

animPeriod = 1;

initPhase=0;

};

};

class UserActions

{

class opendoor

{

displayName="Open Door";

position="osadoor";

onlyforplayer=1;

radius=4;

condition= "this animationphase ""door"" < 0.5";

statement = "this animate [""door"", 0]";

};

class closedoor

{

displayName="Close Door";

position="osadoor";

onlyforplayer= false;

radius=5;

condition= "this animationphase ""door"" > 0.5";

statement = "this animate [""door"", 1]";

};

};

};

};

This is the proper layout of your config, your animations should work now.

Share this post


Link to post
Share on other sites
Guest

when i walk up to the object no option appears to open door.

in my p3d file the geometry is named 'door'

in memory lod I have two vetexs named 'osadoor'

what else could be missing....?

Share this post


Link to post
Share on other sites

Well the thing is you don't know right now whether it's the UserActions or the animations that's not working (or both). Try animating it in the editor with a trigger or script. Ex, try this code in the init field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this animate ["door",1]

If the animations work it should open right away when you preview the mission.

And just to clear things up, are you using that modified config I posted?

Share this post


Link to post
Share on other sites
Guest

Yes I put in your config. I just tried the code snippet in the init line and nothing happened.... So mabey its my base class?

... I have tried using Viewtower instead of House...nothing happened... also using Building.

I checked my o2 model again and everything seems fine....

Share this post


Link to post
Share on other sites

animations dont work from init lines , try it in a radio trigger and name your door in editor.

door animate ["door",1]

door animate ["door",0]

On the whole subject i have yet to see one addon that has not used a workaround in the config useraction of [this] exec "closedoor.sqs and or a combination of the czech name dvere for selection name.

Share this post


Link to post
Share on other sites

Indeed it appears to be a problem with the UserActions, not necessarily the animations. Try the radio trigger, and first make sure the animations work, then we'll try to resolve the problem with the UserActions.

Share this post


Link to post
Share on other sites
Guest

Not sure how to do it with the radio trigger either...

when i try i get a msg saying wrong bool

I named my door X

and put this in the editor

X animate ["door",1]

I really appreciate your patience...

but

Im at the point where i am only damaging my entire interest with modding... A simple door has defeated me and I realize that my nervous system is screaming for me to stop. Configs are not my thing, I feel like im reading Brail with my feet and its a japanese translation of some arabic poems written by african bushman with clicks...like in the gods must be crazy.

Share this post


Link to post
Share on other sites
Quote[/b] ]  {

            class opendoor

            {

                 displayName="Open Door";

                 position="osadoor";

                 onlyforplayer=1;

                 radius=4;

                 condition= "this animationphase ""door"" < 0.5";

                 statement = "this animate [""door"", 0]";

            };

            class closedoor

            {

                 displayName="Close Door";

                 position="osadoor";

                 onlyforplayer= false;

                 radius=5;

                 condition= "this animationphase ""door"" > 0.5";

                 statement = "this animate [""door"", 1]";

            };

       };

If this is what you are using then maybe do a switch in the statement

as it works atm is if door is open then open door - that's why nothing is happening.

                 condition= "this animationphase ""door"" < 0.5";

                 statement = "this animate [""door"", 1]"; //change 0 to 1

                 condition= "this animationphase ""door"" > 0.5";

                 statement = "this animate [""door"", 0]"; // change 1 to 0

Share this post


Link to post
Share on other sites

Still even with that the UserActions would have at least appeared, he says he doesn't even see the actions.

Share this post


Link to post
Share on other sites

If they User Actions don't appear then it may be the Named Selections in the p3d need checking, sometimes even retyping in their names can help.

Share this post


Link to post
Share on other sites

I've tryed it before and animations on objects no way. BIS has changed the animation codes on ArmA, for sure. The command is displayed ingame but nothing happens when you activate it sad_o.gif

Share this post


Link to post
Share on other sites

The doors on my bird open and shut, admittedly I have not got the time factor working yet but the animation does.

AAdoor2.jpg

AAdoor1.jpg

Share this post


Link to post
Share on other sites

I can see, and it works smile_o.gif

Is your bird a vehicle or a static object? Can you show us your config?

I' was referring to static objects. I've used the same code i used before with OFP and nothing happens:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

class CfgPatches

{

class MiG_objects

{

units[] =

{

MiG_windmill,

MiG_windmill1

};

weapons[] = {};

requiredVersion = 0.1;

};

};

class CfgSounds

{

class mill

{

name="mill sound";

sound[]={"\MiG_objects\sounds\mill.wav",1.000000,1.000000};

titles[]={};

};

class wdooropen

{

name="Wood Door Open";

sound[]=

{"\MiG_objects\sounds\wdooropen.wav",1.000000,1.000000};

titles[]={};

};

class wdoorclose

{

name="Wood Door Close";

sound[]=

{"\MiG_objects\sounds\wdoorclose.wav",1.000000,1.000000};

titles[]={};

};

};

class CfgModels

{

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

class MiG_windmill: Default {};

}

class CfgVehicleClasses

{

class Objects;// External class reference

class MiG_objects: Objects

{

displayName = "MiG Objects";

};

};

class CfgVehicles

{

class HouseBase; // External class reference

class House : HouseBase {

class DestructionEffects; // External class reference

};

class Ruins; // External class reference

class MiG_windmill: House

{

model="\MiG_objects\MiG_windmill";

displayname="Windmill";

vehicleClass="MiG_objects";

icon="\MiG_objects\icon\objects.paa";

scope=2;

side=3;

animated= true;

class AnimationSources

{

class MiG_wind

{

type="rotation";

animPeriod=20000

selection="ukaz_radar";

axis="osa_radar";

angle0=0

angle1=50000;

};

};

class EventHandlers

{

init = "[(_this select 0)] exec ""\MiG_objects\scripts\Windmill.sqs""";

};

};

class MiG_windmill1: MiG_windmill

{

model="\MiG_objects\MiG_windmill1";

displayname="Big Windmill";

destrType = "DestructBuilding";

armor = 150;

scope=2;

side=3;

class DestructionEffects : DestructionEffects {

class Ruin1 {

simulation = "ruin";

//type =

"\ca\buildings\ruins\bouda3_ruins.p3d";

type = "\MiG_objects\mill.p3d";

position = "";

intensity = 1;

interval = 1;

lifeTime = 1;

};

};

animated= true;

class AnimationSources

{

class MiG_wind

{

type="rotation";

animPeriod=20000

selection="ukaz_radar";

axis="osa_radar";

angle0=0

angle1=50000;

};

class Dvere1

{

animPeriod = 1;

};

};

class UserActions

{

class OpenDoors

{

displayNameDefault =

$STR_DN_OUT_O_DOOR_DEFAULT;

displayName = $STR_DN_OUT_O_DOOR;

position = "osa_dvere1";

radius=2.5;

onlyForPlayer = 1;

condition = "this animationPhase ""Dvere1"" < 0.5";

statement="this say ""wdooropen"";this animate

[""Dvere1"", 1]";

};

class CloseDoors

{

displayNameDefault = $STR_DN_OUT_C_DOOR_DEFAULT;

displayName = $STR_DN_OUT_C_DOOR;

position = "osa_dvere1";

radius=2.5;

onlyForPlayer = 1;

condition = "this animationPhase ""Dvere1"" >=

0.5";

statement="this say ""wdoorclose"";this animate

[""Dvere1"", 0]";

};

};

//actionBegin1 = "OpenDoors";

//actionEnd1 = "OpenDoors";

};

};

If anyone has a working door animation that works with static objects classes with ArmA, pls post the confi code here, and let us now if there are changings in the memory lod as well. I've tryed it ofp way and didn't work mad_o.gif

Share this post


Link to post
Share on other sites

Agreed with mig something has changed .I did my own experiment last night and got the door on a static building to open and close

with the radio trigger animate ["dvere",0] etc .

but user action simply would not appear .

I notice that for vehicles you can alter the getin radius which helps in locating the action but for statics we only have one radius , also even with default bis ladders unless i go to scope and look at the ladder or ammo crate for that matter , the action wont appear does the view geo lod have something to do with it ?

Share this post


Link to post
Share on other sites

the problem is with static unmanned addons..

i got it working with all my aircraft and ground vehicles but the problem are with buildings and gates.

Share this post


Link to post
Share on other sites
Guest

Has anyone had any luck with this?

Is there a solution? Will i have to make my doors vehicles? And if i do that, is there anything i need to know about which will happen in a negativ way from doing this.?

Share this post


Link to post
Share on other sites

The simplest workaround is to add an action in the config

remove the open door when actioned and add closdoor action

and vice versa.

This will need you to get the radio thing working that kyle spoke about earlier, this way you know when the action is clicked it will work in game.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class EventHandlers

{

Init="_this exec ""\MyDoor\init.sqs""";

};

init.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0

opndoor = _unit AddAction ["opendoor","MyDoor\scripts\open.sqs"];

open.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0;

_unit removeaction opndoor;

_unit animate ["door",1];

clsdoor = _unit addaction ["closedoor","MyDoor\scripts\close.sqs"];

close.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this select 0;

_unit removeaction clsdoor;

_unit animate ["door",0];

opndoor = _unit AddAction ["opendoor","MyDoor\scripts\open.sqs"];

This is a rough draft of one workaround i havent proof read it , there is a chance for multiple doors and mp etc you need to change things ,but i am sure some here will have a more cleaner sqf or presice sqs.

Share this post


Link to post
Share on other sites

Since you aren't even getting the UserActions to appear I believe it may have to do with the fact that in ArmA actions only appear to the player when their cursor is over a visible part of the object (I'm thinking it's actually determined by view geometry). Does your model have all proper geometry and view geometry LODs? If not make sure it does.

MiG, of course you can't use the same syntax from OFP, we already know animations have changed in ArmA (to become more flexible), you can check the wiki for information on the new animation system.

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  

×