Jump to content
Sign in to follow this  
wass24

Opening a double gate?

Recommended Posts

I have a gate that I have configured to open in the center.  Currently I have to open one side and then the other and close one then the other.  How can I configure it to open and close both sides at the same time using the action menu?

This is my current user action config:

class CfgVehicles

{

class All{};

class Static: All{};

class Building: Static{};

class Strategic: Building{};

class Fortress1: Strategic{};

class Gate3_anim : Fortress1

{

model="\Gate3_anim\Gate3_anim";

armor=2000;

scope=2;

displayName="Gate3_anim";  

animated=1;

class Animations

{

// gate1 animation class

class ani_gate1

{

type="rotation";

animPeriod=5;

selection="gate1";

axis="gate1_axis";

angle0=0;

angle1=-1.5;

};

// gate2 door

class ani_gate2

{

type="rotation";

animPeriod=5;

selection="gate2";

axis="gate2_axis";

angle0=0;

angle1=1.5;

};

}; /* Animation class end */

// Useraction class

class UserActions

{

class Opengate1

{

displayName="Open Gate 1";

position="pos_gate";

radius=2.000000;

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

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

};

class Closegate1

{

displayName="Close Gate 1";

position="pos_gate";

radius=2.000000;

condition="this animationPhase ""ani_gate1"" >= 0.5";

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

};

class Opengate2

{

displayName="Open Gate 2";

position="pos_gate";

radius=2.000000;

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

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

};

class Closegate2

{

displayName="Close Gate 2";

position="pos_gate";

radius=2.000000;

condition="this animationPhase ""ani_gate2"" >= 0.5";

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

};

Share this post


Link to post
Share on other sites
Guest

You mean one action that opens both gates simultaineously, and then can close them both simultaineously? No idea to be honest...but my guess would be to have a user action that activates a script which contains the animations, rather than having the animations in the config. I don't recall an object that has two animations running at the same time from one Action...but I've been wrong before tounge_o.gif

Share this post


Link to post
Share on other sites

How would you configure a user action to activate a script? In my case, how do you configure it to activate two animations?

Share this post


Link to post
Share on other sites

You can use a semicolon to seperate the commands for your statement, and And for your condition:

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

{

displayName="Open Gates";

position="pos_gate";

radius=2.000000;

condition="(this animationPhase ""ani_gate1"" < 0.5) And (this animationPhase ""ani_gate2"" < 0.5)";

statement="this animate [""ani_gate1"", 1]  ; this animate [""ani_gate2"", 1]";

};

Share this post


Link to post
Share on other sites

Thanks for your help, but only one side of the gate would open. Any other ideas?

Share this post


Link to post
Share on other sites

Dont know, unless for some reason OFP cant play two anims at the same time. If not sounds like something else is screwed.

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  

×