OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Tyger on 28 Dec 2008, 04:29:59

Title: setCaptive issues
Post 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?
Title: Re: setCaptive issues
Post by: Deadfast on 28 Dec 2008, 10:35:05
Hm, you could order all units in the area to engage?
Title: Re: setCaptive issues
Post by: Wolfrug on 28 Dec 2008, 11:22:50
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.
Title: Re: setCaptive issues
Post by: Tyger on 28 Dec 2008, 13:05:14
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.
Title: Re: setCaptive issues
Post by: Ext3rmin4tor on 28 Dec 2008, 13:13:32
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.
Title: Re: setCaptive issues
Post by: Tyger on 28 Dec 2008, 15:28:22
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:
Code: [Select]
[] 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.
Title: Re: setCaptive issues
Post by: Ext3rmin4tor on 29 Dec 2008, 11:02:00
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.