Jump to content
Sign in to follow this  
bennie1983nl

open doors

Recommended Posts

Hi to all!

I am working on a Jurassic Park mission.

And it got as empty objects alot of fences and gates.

can the AI open a gate?

André de Jong

i found this in a config

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

{

class JP_cardoor

{

units[] = {JP_cardoor,JP_fench};

weapons[] = {};

requiredVersion = 1.0;

};

};

class CfgVehicles

{

class All {};

class Static: All {};

class Building: Static {};

class NonStrategic: Building {};

class TargetTraining: NonStrategic {};

class TargetGrenade: TargetTraining {};

class JP_fench: TargetGrenade

{

model="\JP_cardoor\JP_fench";

armor=20000;

scope=2;

vehicleClass="Jurassic Park";

displayName="Perimiter Fence";

};

class JP_cardoor: TargetGrenade

{

model="\JP_cardoor\JP_cardoor";

armor=20000;

scope=2;

icon="\JP_cardoor\fench1.paa";

vehicleClass="Jurassic Park";

displayName="Perimiter Fence"; animated=1

class Animations

{

class door1

{

type="rotation";

animPeriod=3

selection="door1";

axis="a_door1";

angle0=0

angle1=1.60000;

};

class door2

{

type="rotation";

animPeriod=3

selection="door2";

axis="a_door2";

angle0=0

angle1=-1.60000;

};

class door3

{

type="rotation";

animPeriod=3

selection="door3";

axis="a_door3";

angle0=0

angle1=-1.60000;

};

class door4

{

type="rotation";

animPeriod=3

selection="door4";

axis="a_door4";

angle0=0

angle1=1.60000;

};

};

class UserActions

{

class OpenDoors

{

displayName="Open Doors";

position="mitte";

radius=20.500000;

condition="((this animationPhase ""door1"") <= 0.5) && ((this animationPhase ""door2"") <= 0.5) && ((this animationPhase ""door3"") <= 0.5) && ((this animationPhase ""door4"") <= 0.5)";

statement="this animate [""door1"", 1]; this animate [""door2"", 1]; this animate [""door3"", 1]; this animate [""door4"", 1]";

};

class CloseDoors

{

displayName="Close Door";

position="mitte";

radius=20.500000;

condition="((this animationPhase ""door1"") >= 0.5) && ((this animationPhase ""door2"") >= 0.5) && ((this animationPhase ""door3"") >= 0.5) && ((this animationPhase ""door4"") >= 0.5)";

statement="this animate [""door1"", 0]; this animate [""door2"", 0]; this animate [""door3"", 0]; this animate [""door4"", 0]";

};

};

}

}

Share this post


Link to post
Share on other sites

Hi,

look here in the config :

Quote[/b] ]this animate [""door1"", 1]; this animate [""door2"", 1]; this animate [""door3"", 1]; this animate [""door4"", 1]

"this" is the object, the "JP_cardoor".

So, you can set a trigger near the door, activable by the AI (west or east present for example), that will open the door.

If the door is an object that you've place on the map, name it whatever you like (mydoor for example), and write this in the on activation line of the trigger :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mydoor animate ["door1", 1]; mydoor animate ["door2", 1]; mydoor animate ["door3", 1]; mydoor animate ["door4", 1]

If it is an object of the map, then you must get the object id in the mission editor ("show id"), then replace "mydoor" by "object 125255" (if '125255' is the id of the object).

Regards,

ProfT

Share this post


Link to post
Share on other sites

THX ProfT  notworthy.gif   wink_o.gif

above is for the Fence and cargate fence!

below is the BIG cargate with JP logo

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

opening closing with script:

doorname animate ["Dvere1", 1]   //opens the door

doorname animate ["Dvere2", 0]   //closes the door

Dvere1 is door on the left side

Dvere2 is the door on the right side  crazy_o.gif

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  

×