Jump to content
Sign in to follow this  
ringoray

Custom composition bar gate help.

Recommended Posts

Hello guys, I am in the process of making a few custom compositions with the object grabber.sqf. I have made a small checkpoint that contains a bar gate. Is it possible via some scripting to have these bar-gates open and close when approached? I already know the code to make editor placed gates open and close but doing it for these compositions is beyond my knowledge. Any help would be appreciated.

Share this post


Link to post
Share on other sites

After creating the composition you can reference the bargate with nearestObject or something similar.

_bargate = nearestObject [somePosition, "bar_gate_class"];
if (!isNull _bargate) then {
    _id = _bargate addAction ["operate", {call Tag_fnc_barGateAnim}]; //add the action or w/e
};

Edited by Iceman77
Fixed typos

Share this post


Link to post
Share on other sites

Cheers IceMan, will try it out. Very disappointed with your monster pc by the way haha very funny, I like it.

Share this post


Link to post
Share on other sites

Yeah Alky seen those already and they do indeed work very well indeed. I was just trying to build my own and see if I could get them working. Mine is working fine but, when i spawn the composition now the checkpoint faces the way that i made it in the editor, as in a cant rotate it to suit where I want it place, any ideas guys why this is happening?

Share this post


Link to post
Share on other sites

I use a simple trigger to activate the gate.

Put this into the trigger:

\\Activation:
Blufor
\\Condition:
this
\\On Act:
tor1 animate ["Door_1_rot", 1]; off1
\\On Dea:
tor1 animate ["Door_1_rot", 0]; off1

Name the gate:

tor1

Then in the gate init line put:

this allowdamage false;

Then whenever a unit goes into the trigger area the gate opens until all units leave the area.

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  

×