OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Lucky Ed on 03 Jun 2009, 01:03:05
-
I'm trying to make an ambush with a TOW Tripod and a MG nest, but the AI spots them to soon. So I decided to use setCaptive to make them ignore the TOW and MG until I unleash the ambush.
This is what I put in the TOW INI (Group leader named Ambush1):
"{_x setCaptive true} forEach units group Ambush1; {_x setCombatMode "Blue"} forEach units group Ambush1"
And this is what I put in a trigger that is triggerd once when OPFOR is present :
"{_x setCaptive false} forEach units group Ambush1; {_x setCombatMode "Red"} forEach units group Ambush1"
The problem is that setCaptive false dosn't work. They keep being captives. I don't get an error or anything.
This is direct copy paste from my editor, so if you spot any faults that I don't see, please point them out. :D
In the new ComRef it states that setCaptive is used "setCaptive Player" and not "Player setCaptive true/false" is that the explenation and if, what do I do about it?
sry for any bad spelling, I'm Danish.
-
Aye the 'new' comref is wrong.
Syntax remains as: unit setCaptive boolean
For example: player setCaptive true
If you find that 'true' and 'false' aren't working, then use 1 and 0, per the example above that would be:
player setCaptive 1
Planck
-
Ok I'll try that, thanks.
[Edited]
Thanks a bunch, worked like a charm.
The OPFOR is a little slow to discover the "ambush units" but that's a minor problem. :D