OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Tyger on 28 Dec 2008, 04:29:59
-
I have a slight issue with the setCaptive command. I have a BLUFOR who is captive, and he can move freely around several areas klicks appart (we're talking Corazol to Bagango). Now, if he holds a primary weapon (aka runs over some one and picks it up, etc) then he is not captive anymore (setCaptive false). This part I have working. But, my issue is, if the player is moving around say Corazol, and the OPFOR have seen him already as a captive, when he is suddenly setCaptive false in front of them, they do not react. I can then drive to another area with the setCaptive false unit, and the groups in say Bagango WILL react.
My idea was to then just reveal the captive/uncaptive BLUFOR to the local units, but in my testing, this does not work. The OPFOR just sit there an look at me.
How can I get the AI to respond to this sudden change?
-
Hm, you could order all units in the area to engage?
-
I'm guessing they're just being slow at recognizing him - also recognition inside a vehicle (particularly at night) is sketchy at best! What I suggest is that you, upon unsetcaptivating him, also reveal him to the OPFOR (using the reveal command) - that should have them reacting a bit quicker! Once revealed he should be treated quite normally, I think. Try it out!
Wolfrug out.
-
My idea was to then just reveal the captive/uncaptive BLUFOR to the local units, but in my testing, this does not work. The OPFOR just sit there an look at me.
:) Already tried that. I also tried making him join a new WEST group, and that didn't work as well.
Grrr, stupid AI.
-
If units have a "safe" behaviour they need a while to recognize you're an enemy. You must stand in front of them for about 3 seconds.
-
Hmmm. I stood in front of them for about 30-40 seconds, and still no recognition. I'll try switching them to aware for a brief moment though, and see if they recognize me...
Thanks guys... I'll keep trying ::)
[EDIT]
Why do something with a script, when you can do something with a trigger, eh?
I was originally running a script spawned in the init.sqf that looked like this:
[] spawn {
while {(TYG_MISSION_VARS select 0) == 1} do {
sleep 0.5;
if ((primaryWeapon player != "") && (captive player)) then { player setCaptive false; };
};
};
My reason for doing that was because from OFP, the more triggers the more lag. Call me an idiot. A simple trigger fixed it. It still has issues triggering if say i pick up a weapon, drop it, and then pick it up again.
-
Ah ok because some months ago I made a mission for my campaing that was basically the same thing, i.e. you're a west sided civilian in a RACS town and you're captive as soon as you don't have any weapons. I did with triggers and everything worked.