Jump to content
✪₁₃₃₇ |  Google Translate?

Help With Linking Multiple Gates to One Opening Script

Recommended Posts

Hello,

 

 

yourbargatename animate ["Door_1_rot", 1] //this open the bargate

This is for opening the Bargate along with addAction and an infostand or whatever, and i am curious if it is possible to link multiple gates together like so: 

gate1 gate2 gate3 gate4 animate ["Door_1_rot", 1] //this open the bargate

So that they all open from the one action on the object (Infostand) for example: "Open Gates" > When clicked all 4 gates open together.

 

I have tried a couple of methods and none have worked, if anyone can provide some assistance I would greatly appreciate it ❤️

 

 

Edited by ✪₁₃₃₇ | Google Translate?

Share this post


Link to post
Share on other sites

Do you want a complex way or a simple way?

 

Complex way :

_gates = [gate1, gate2, gate3];

{

_x animate ["Door_1_rot", 1];

} forEach _gates;

 

Simple way:

gate1 animate ["Door_1_rot", 1] ;

gate2 animate ["Door_1_rot", 1] ;

gate3 animate ["Door_1_rot", 1] ;

gate4 animate ["Door_1_rot", 1] ;

 

  • Like 1

Share this post


Link to post
Share on other sites
40 minutes ago, Maihym said:

Do you want a complex way or a simple way?

 

Complex way :

_gates = [gate1, gate2, gate3];

{

_x animate ["Door_1_rot", 1];

} forEach _gates;

 

Simple way:

gate1 animate ["Door_1_rot", 1] ;

gate2 animate ["Door_1_rot", 1] ;

gate3 animate ["Door_1_rot", 1] ;

gate4 animate ["Door_1_rot", 1] ;

 

I was using this for single gates:

 

this addAction ["<t color='#0caa41'>OpenGate</t>", {tmp1 animate ["Door_1_move", 1]}, nil, 1, false, true]; this addAction ["<t color='#ff0000'>Close Gate</t>  
", {tmp1 animate ["Door_1_move", 0]}, nil, 1, false, true]; 

 

But i want to get all four gates into the one action.

😉

Edited by ✪₁₃₃₇ | Google Translate?

Share this post


Link to post
Share on other sites
32 minutes ago, ✪₁₃₃₇ | Google Translate? said:

I was using this for single gates:

 

this addAction ["<t color='#0caa41'>OpenGate</t>", {tmp1 animate ["Door_1_move", 1]}, nil, 1, false, true]; this addAction ["<t color='#ff0000'>Close Gate</t>  
", {tmp1 animate ["Door_1_move", 0]}, nil, 1, false, true]; 

 

But i want to get all four gates into the one action.

😉

You could try:

this addAction ["<t color='#0caa41'>Open Gates</t>", {private _gates = [gate1, gate2, gate3, gate4]; {_x animate ["Door_1_rot", 1];} forEach _gates;}, nil, 1, false, true]; this addAction ["<t color='#ff0000'>Close Gate</t>", {private _gates = [gate1, gate2, gate3, gate4]; {_x animate ["Door_1_rot", 0];} forEach _gates;}, nil, 1, false, true];

I'm not sure how Arma handles blocks and loops in an addAction. I'd personally make a new function to do this with a argument you could pass for what gates you want in an array or a number for what "mode".

Share this post


Link to post
Share on other sites
28 minutes ago, imthatguyhere said:

You could try:

this addAction ["<t color='#0caa41'>Open Gates</t>", {private _gates = [gate1, gate2, gate3, gate4]; {_x animate ["Door_1_rot", 1];} forEach _gates;}, nil, 1, false, true]; this addAction ["<t color='#ff0000'>Close Gate</t>", {private _gates = [gate1, gate2, gate3, gate4]; {_x animate ["Door_1_rot", 0];} forEach _gates;}, nil, 1, false, true];

I'm not sure how Arma handles blocks and loops in an addAction. I'd personally make a new function to do this with a argument you could pass for what gates you want in an array or a number for what "mode".

Thank you,

 

Theres some variable errors but ill try what you said ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×