Jump to content
Sign in to follow this  
Icaruk

How to open a door with a script.

Recommended Posts

I was trying to use this:

buildingID animate ["IDontKnowTheNameOfTheDoor", 1]

But I don't know the door ID or the building ID.

This is why I can't see the door ID.

Any thoughts? Thanks

Share this post


Link to post
Share on other sites

Try this out

_theBuilding = nearestBuilding someObject;
_theBuilding animate ["door_1_rot", 1]; // open - the number in door_1_rot changes according to the door?
//_theBuilding animate ["door_1_rot", 0]; //close

---------- Post added at 15:47 ---------- Previous post was at 15:44 ----------

Could also look here.

Share this post


Link to post
Share on other sites
Try this out

_theBuilding = nearestBuilding someObject;
_theBuilding animate ["door_1_rot", 1]; // open - the number in door_1_rot changes according to the door?
//_theBuilding animate ["door_1_rot", 0]; //close

---------- Post added at 15:47 ---------- Previous post was at 15:44 ----------

Could also look here.

Nothing happens :(

Btw, where did you got the door's name?

Share this post


Link to post
Share on other sites
Btw, where did you got the door's name?

Somewhere on google. Can't remember the url.

---------- Post added at 03:07 ---------- Previous post was at 03:06 ----------

In the editor, did you place an object on / near the building and give it a name? IE; an empty Hpad named someObject

Share this post


Link to post
Share on other sites
Somewhere on google. Can't remember the url.

---------- Post added at 03:07 ---------- Previous post was at 03:06 ----------

In the editor, did you place an object on / near the building and give it a name? IE; an empty Hpad named someObject

I placed a game logic named "a" near the building then I created a trigger near the door (so when you are near the door, the door will open):

null = [] execVM "scripts\door.sqf";

door.sqf

_theBuilding = nearestBuilding a; 
_theBuilding animate ["door_1_rot", 1];

Share this post


Link to post
Share on other sites

And the results are not working? try using door_2_rot, door_3_rot etc etc.

---------- Post added at 04:45 ---------- Previous post was at 04:44 ----------

Also, i believe thre are different doors for hangars, bubble building (or wtfe they're called). What type of building are you referencing?

Share this post


Link to post
Share on other sites

Hello,

Door Standard:

"door_X_rot"

Door Automatic: (Exemple: Airport Altis)

"door_XA_move" //Side Left

"door_XB_move" //Side Right

  • Like 1

Share this post


Link to post
Share on other sites

I can't make it working, example mission maybe? :P

Share this post


Link to post
Share on other sites

You can look into "Splendid Config Viewer" in sub-class "UserActions" of building

Exemple with the side right Airport Altis :

"configfile >> 
"CfgVehicles" >> 
	"Land_Airport_right_F" >> 
		"UserActions"
			OpenDoor_1
						condition = "((this animationPhase 'Door_1_rot') < 0.5) && ((this getVariable ['bis_disabled_Door_1',0]) != 1)";
						displayName = "Ouvrir portes";
						displayNameDefault = "<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
						onlyForPlayer = 0;
						position = "Door_1_trigger";
						priority = 0.4;
						radius = 1.5;
						statement = "([this, 'Door_1_rot', 'Door_Handle_1_rot_1', 'Door_Handle_1_rot_2'] execVM "\A3\Structures_F\scripts\Door_open.sqf")";

Here you have all informations of action used, the name, icon, Priority of action, the condiftion, ....

In statement you can see the animation name "Door_1_rot" and the script used.

Steam\SteamApps\common\Arma 3\Addons\structures_f.pbo

Door_open.sqf

// Open a door with an animated doorhandle.

// _this select 0		object pointer
// _this select 1		door animation
// _this select 2		doorhandle up->down animation
// _this select 3		doorhandle down->up animation

(_this select 0) animate [(_this select 1), 1];
(_this select 0) animate [(_this select 2), 1];
(_this select 0) animate [(_this select 3), 1];

Share this post


Link to post
Share on other sites

Yeah the config viewer & pbos are very handy. All info you could ever need is in there. :)

Share this post


Link to post
Share on other sites

Thank you all! The door that I needed to open is called "door_7A_move", these are the sliding doors on the airport terminal.

I'm learning a lot with you guys <3

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  

×