Home   Help Search Login Register  

Author Topic: setCaptive issues  (Read 1626 times)

0 Members and 1 Guest are viewing this topic.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
setCaptive issues
« 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?
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Deadfast

  • Members
  • *
Re: setCaptive issues
« Reply #1 on: 28 Dec 2008, 10:35:05 »
Hm, you could order all units in the area to engage?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: setCaptive issues
« Reply #2 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.
"When 900 years YOU reach, look as good you will not!"

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: setCaptive issues
« Reply #3 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.
« Last Edit: 28 Dec 2008, 13:10:13 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Ext3rmin4tor

  • Members
  • *
Re: setCaptive issues
« Reply #4 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.
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: setCaptive issues
« Reply #5 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.
« Last Edit: 28 Dec 2008, 19:32:36 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Ext3rmin4tor

  • Members
  • *
Re: setCaptive issues
« Reply #6 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.
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!