Jump to content
Sign in to follow this  
tophe

Closing Bar Gate command

Recommended Posts

I want to make a roadblock with a bar gate.

Is there a command to put at the init field to make it close?

Share this post


Link to post
Share on other sites

Try this to close the bargate :

this animate ["bargate",1]

and this to open it :

this animate ["bargate",0]

("this" is the name of the bargate)

Example of a small script which will close the bargate when your vehicle arrives within 10 meters of the bargate :

a is your vehicle

b is the bargate

?((a distance b)<10) : b animate ["bargate",1]

Share this post


Link to post
Share on other sites

Great!

Thank you!

I'll look at it tonight.

Share this post


Link to post
Share on other sites

what about a bargate that is allready on the map as an id is there any way of animating it.

i have tryed to get my head round this new nearestobject commands but im at a loss.

Share this post


Link to post
Share on other sites

MaHuJa  thank you for your post i know i nead to use the

nearestObject_id  

because the object  command does not work in arma 1.04

i am trying to animate on the island of sahrani at the main

airport compound bargate (object id 355) i am getting

error local variable in global space.

the comand i am entering into a trigger is _nObject =position player nearestObject 355

i know iam doing something wrong  and or missing something

else that is the reason i am asking

not that i cant be bothered reading the posts or searching hear or at the biki.

the reason is i can not get my head around this new nearestObject command

bk1276

Share this post


Link to post
Share on other sites

thanks for trying HulkingUnicorn but still nothing .  the only thing i have managed to do with it the object 355 is destroy it i still cant get the soding thing  to open or close .

if any one can give me a hand with a sample code or script

it would be great

anyway

thanks again HulkingUnicorn for trying

bk1276

Share this post


Link to post
Share on other sites

so it seams like a standard problem but if we can access it to destroy it i say its

all about fingering out what the command is to animate it with the nearest object command .

or figure out how to hide the ruins after we destroy it and just place one from the editor

that we know can be animated.

thats all i can figure to do

i think this calls for some input from any of the hardcore

scriptures and coder out there

as it is beyond the knowledge of pure novis witch iam

bk1276

Share this post


Link to post
Share on other sites

I think I found the solution I'm just not really sure how to get to it. The animation for on map bargates, supposing it exists, is probably in czech like some of the door animations for at least several buildings. I don't know how to find out what the animation is called however (I tried the method in the above post with no luck), the only thing I could think was some form of zavora because that's what the bar gate is called in the buildings and object list.

Share this post


Link to post
Share on other sites
MaHuJa  thank you for your post i know i nead to use the

nearestObject_id  

because the object  command does not work in arma 1.04

i am trying to animate on the island of sahrani at the main

airport compound bargate (object id 355) i am getting

error local variable in global space.

the comand i am entering into a trigger is _nObject =position player nearestObject 355

i know iam doing something wrong  and or missing something

else that is the reason i am asking

not that i cant be bothered reading the posts or searching hear or at the biki.

the reason is i can not get my head around this new nearestObject command

bk1276

Your problem has nothing to do with the nearestObjects command. Your problem is that you're trying to use a local variable (indicated by the underscore before it) in global space (local variables can only be used inside of scripts and certain commands, in the latter case these are special reserved variables). Get rid of the underscore in front of 'nObject' to make it global.

Share this post


Link to post
Share on other sites

KyleSarnik

thanks for replying i managed to blow some things up

via a trigger using this code

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{(position this nearestobject _x) setDammage 1} ForEach [429186]

the joy i had in OFP makeing towns,citys,camps,bases

working living areas (doors,gates,cheakpoints,lights)

you know the stuff i meen to make it a living working

enviroment.

i just cant find that joy in arma.

anyway thanks again for replying

bk1276

i miss the object command

Share this post


Link to post
Share on other sites

Have you even made sure that you're using the right animation name, if it even exists? Do you know that this particular object even is animated?

Anyway there's really nothing wrong with using the nearestObject command now instead of object:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(position player nearestObject 355) animate ["animname",1]

That syntax should work, I don't see any reason that it shouldn't. Just remember you can't use local variables in the editor (exceptions are the _X in foreach/count and the _this in EHs), only global ones:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">gate1 = (position player nearestObject 355); gate1 animate ["animname",1]

This works too, assigning global variables to island objects worked in OFP and there's no reason it shouldn't in ArmA.

Share this post


Link to post
Share on other sites

KyleSarnik

hopefully in six months or so after the bug fixes,updates,tool

releases i will be spending more time on arma than ofp.

and thanks for the heads up on the variables local/global

bk1276

Share this post


Link to post
Share on other sites
KyleSarnik

hopefully in six months or so after the bug fixes,updates,tool

releases i will be spending more time on arma than ofp.

and thanks for the heads up on the variables local/global

bk1276

I fail to see what you're getting upset about... and what bugs are you talking about? There aren't any bugs with any of these commands if that's what you mean.

Share this post


Link to post
Share on other sites

KyleSarnik

im sorry if i have gave over the impression of being upset

all i was meaning was in six months or so all the kinks and creases

will be ironed out and the community wont be trying to figour out

basic anim commands ,move commands, just like a new O/S

there will be a good knolledge base of what can and cant be done.

so we can use the editor to the extent it was intended

bk1276

Share this post


Link to post
Share on other sites

I'd say it would be a strange move of BIS to place the gates there but not make them able to open or close... That said, it's not impossible either.

I managed to destroy the gate with my trigger, but not animate it. Using the same trigger I can animate a gate I place in the editor myself.

The way I see there are three possibilities:

- The gates don't have an animation

- The gates have an animation, but we don't have a clue what it's called

- They don't move because of some bug

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  

×