OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods Beta Testing => Topic started by: Maverick2002 on 25 Jan 2006, 10:07:10

Title: AI open gate/barrier?
Post by: Maverick2002 on 25 Jan 2006, 10:07:10
As written in subject, is there a way to get an AI soldier to open a gate/barrier? I`m using the Barracken addon with the barrier that opens and closes. Tried the action command, but found out that there wasn`t any for open/close gate! :P
Title: Re:AI open gate/barrier?
Post by: XCess on 25 Jan 2006, 10:20:35
object animate ["openAnimation",x]

where object is the gate's name
where openAnimation is the animation name
where x is an integar from 1 to 0 (0 will be beginning of animation phase while 1 will be end)

All required details should be included in the readMe. If not, try contacting the authors or if you're feeling a bit more patient I'm sure somebody will come along here sooner or later to tell you.
Title: Re:AI open gate/barrier?
Post by: Maverick2002 on 25 Jan 2006, 14:58:52
what do you mean by animation name? like "open" or "close"?
can you give me an example?
Title: Re:AI open gate/barrier?
Post by: nominesine on 25 Jan 2006, 15:07:35
For a regular BIS_Resistance buildings the syntax to open and close a door is:
Open:
Code: [Select]
building animate ["dvere1", 0]Close:
Code: [Select]
building animate ["dvere1", 1]
The animation name in the example above is dvere1 (czech meaning door1). I don't know what animation name is used in the baracken addons gates. But as XCess says: It should be in the readme or you can contact the addonmaker and ask.

EDIT: In the FDF-mod the animation name for gates is keppi. Try the german words for gate or barrier. I think it's gatter or sperre, but my german is extremely rusty.
Title: Re:AI open gate/barrier?
Post by: Maverick2002 on 25 Jan 2006, 15:23:33
Okidok!

I`ll try when I get home!

Thanks! ;)

By the way, is it possible to open/close BIS Resistance gates?
Title: Re:AI open gate/barrier?
Post by: Planck on 25 Jan 2006, 15:52:35
For Baracken:

this animate ["Component02", 1]

and

this animate ["Component02", 0]

I think thats right.....according to the config anyway.  
 ;D


Planck
Title: Re: AI open gate/barrier?
Post by: Victor1234 on 28 Jun 2006, 04:31:50
This is on a related note, but what's the code for getting the AI soldier to open the gate when you approach and close it when you move away?
Title: Re: AI open gate/barrier?
Post by: h- on 28 Jun 2006, 11:04:08
The same..
???

Are we borderlining into off-topic?
Anyway, if you mean that there's an AI standing next to the gate and the gate opens when you approach it, you need the following:
- A trigger covering the close vicinity of the gate
- the gate's object id (show ID's in the editor, zoom close)

Set the trigger to 'repeatedly', your own side present..
In it's 'on activation' field you type
Code: [Select]
(object XXXXXX) animate ["Component02", 1]In 'on deactivation' field
Code: [Select]
(object XXXXXX) animate ["Component02", 0]Or vice versa, depending on what animation states the 1 and 0 represent..
The XXXXXX means the object id number..

If you are using editor placeable gates the instead of object id you just name the gate and do the above thing except instead of yousing (object XXXXXX) you use the name you gave to the gate..

Should work, not tested nor guaranteed though.. :)