Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Open/close bar gate

  1. #1
    Is there a way to open and close the bar gates with a script or command? I've searched the forum, google, and ofpec but haven't been able to find anything. The bar gates that are placeable in the editor can be opened and closed by the player. I'd like to figure out a way to make AI guards open/close the gate or at least appear to with some kind of trigger.

    I found this:

    House1=position this nearestObject 12345

    The Name of the ID is now House1

    House1 animate ["dvere1",0]

    For houses from here:

    http://www.flashpoint1985.com/cgi-bin....se+gate

    But can't seem to make it work for the gates. Anyone know if there's a solution?

    Thanks!

  2. #2
    Quote Originally Posted by [b
    Quote[/b] ] I'd like to figure out a way to make AI guards open/close the gate or at least appear to with some kind of trigger
    this is one way you can do it.

    place a trigger around or close to the bargate,

    lets name the bargate MYBARGATE!

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    Activation&#58;YOURSIDE
    Contition&#58; this
    On Act&#58; MYBARGATE animate &#91;&#34;barGate&#34;,0&#93;
    On Dea&#58; MYBARGATE animate &#91;&#34;barGate&#34;,1&#93; ***
    [/QUOTE]

    now. when a unit is close to the gate it opens and closes when he leavs the trigget area.


    if you put this on the gates init feald it will close itself on start:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    MYBARGATE animate &#91;&#34;barGate&#34;,1&#93;
    [/QUOTE]




    -- BEC, Battleye Extended Controls --
    -- BEC Forum Thread --

    Spoiler:

  3. #3
    Private First Class
    Join Date
    Sep 24 2004
    Posts
    12
    Author of the Thread
    Thanks so much&#33; I&#39;ll try it and get back to you.

    A related question: I notice that there are a number of fixed bar gates on the road in Corazol. When you stand next to them, I don&#39;t get the same open/close icon as with bar gates I place myself with the editor. Anyone know if they are movable?




  4. #4
    Not sure if this works.
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Activation&#58;YOURSIDE
    Contition&#58; this
    On Act&#58; &#40;position MYTRIGGER nearestObject 123456&#41; animate &#91;&#34;barGate&#34;,0&#93;
    On Dea&#58; &#40;position MYTRIGGER nearestObject 123456&#41; animate &#91;&#34;barGate&#34;,1&#93;[/QUOTE]

    Try putting that into your trigger and name the trigger MYTRIGGER, then change the 123456 to the ID of the bargate.
    You can find the ID by pushing the Show ID button in the editor now everyobject on the map will have its ID shown on the map simply zoom in on the bargate and get its ID.
    Having problems with editing missions try the following sites:
    http://www.ofpec.com/
    http://community.bistudio.com/wiki/Main_Page

  5. #5
    Private First Class
    Join Date
    Sep 24 2004
    Posts
    12
    Author of the Thread
    Nuxil, your recommendation worked like a charm. Thanks so much. Unknown, I tried your script out but without success. I have a feeling that the bargates planted at the border crossings in Corazol are fixed objects that are not moveable like the ones you can place with the editor. When you stand next to them, there&#39;s no open/close icon.

    I am able to destroy the fixed bargate by using set dammage. It tips over. What I&#39;d like to do now is remove the damaged object and place one in its place with the editor. Would really like to have the gates down when the player approaches, then raised when they are allowed through.

    I tried using deletevehicle to remove the damaged bargate as the nearest object as here:

    http://www.flashpoint1985.com/cgi-bin....+object

    and here:

    http://www.flashpoint1985.com/cgi-bin....+object

    But no luck. Anyone know if there should be a way to remove the damaged bargate?

    Thanks again&#33;

  6. #6
    Quote Originally Posted by [b
    Quote[/b] ]But no luck. Anyone know if there should be a way to remove the damaged bargate?
    Just move it out of the way via a setPos command (be aware though, that if you do this for a MP game, you have to execute the command on all machines).

    P.S. I have also recently updated my Vehicle Browser, so that it will also show you any possible user actions and their syntax for objects. This may also help you in finding out how to operate specific objects.




  7. #7
    Private First Class
    Join Date
    Sep 24 2004
    Posts
    12
    Author of the Thread
    Kronzky,

    Thank you for the reply. ***Still trying to get this to work. So far I have:

    1. ***Game logic over the bargate named "bg1"

    to test:

    2. ***A proximity trigger on initialization does

    bg1pos = (position bg1 nearestobject 3195);
    bg1pos setdammage 1; (***note:works so far to destroy the bargate)
    bg1pos setPos [getPos bg1pos select 0, (getPos bg1pos select 1) + 10, getpos bg1pos select 2]


    But the bargate doesn&#39;t move. I&#39;ve tried it on other fixed objects to the same effect. ***Do I need something else in the setpos statement to recognize the ruined object? ***What else am I doing wrong? ***Thank you for helping out




  8. #8
    Oh sorry...
    I guess I should never assume that things work the same way in ArmA as they do in VBS (where I just had to do the same thing).

    So I&#39;m afraid you&#39;re out of luck...

    Perhaps you can just place a movable gate on the opposite side of the existing one, and use that instead. Not pretty, but probably the best you can do.

  9. #9
    Master Gunnery Sergeant
    Join Date
    Dec 18 2005
    Location
    Adelaide, Australia
    Posts
    1,306
    I&#39;ve found you can "wiggle" a pre-placed object to be completely underground using a series of setVectorDir and setVectorUp commands.

    The big problem is they seem to stay that way until the island gets reloaded (ie, over following missions until the island is changed)
    [self-promotion]
    OFP:R Island : Rezina
    [/self-promotion]

  10. #10
    Private First Class
    Join Date
    Sep 24 2004
    Posts
    12
    Author of the Thread
    Quote Originally Posted by (fasad @ Oct. 01 2008,00:28)
    I&#39;ve found you can "wiggle" a pre-placed object to be completely underground using a series of setVectorDir and setVectorUp commands.

    The big problem is they seem to stay that way until the island gets reloaded (ie, over following missions until the island is changed)
    I could live with it staying that way since I just want to disappear the fixed bargate and replace with a movable one in the editor. By chance do you have script sample for how to do this?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •