OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Ext3rmin4tor on 01 Jul 2011, 17:24:50
-
I'm opening this post because I'm convertin an ArmA mission into ArmA 2 for caa1 and I had no issue at all in the previous game.
I have this mission were you are an agent under cover. There are restricted areas around the map where, if you walk in, you blew your cover. The agent has a "captive" status, and when the cover is blown for any reaon, his "captive" status changes into "false". I read in the Biki that there is a bug that causes an AI unit not to fire an enemy unit which changes its captive status from captive to non-captive. So I' vetried the following workaround without success:
1. Instead of using captive mode, I created two different groups, one for "west", which is enemy to the resistance and represents the blown cover, so you become an enemy at all effects, and one for west, which represents the low profile status.
2. When you blow your cover, you switch to the western group.
3. While you are in the west group I force all the enemies which has you as a target within 50 meters to aim and fire at you with doTarget and doFire, but they still don't attack you, and this is trange because those commands should work even if you tell the unit to fire at a friendly unit.
The problem is that the AI still doesn't shoot the enemy. The guys who never saw you before shoot you properly, but those who have already seen you don't, according to the bug.
Does anybody of you know something to make the AI fire properly?
EDIT: I discovered that they need some time (like 30 seconds or so) to "understand" that you are an enemy. My new question is now how you make them react faster.
-
agentname setcaptive false gave me about a 5 second delay
agentname setcaptive false; enemyname dofire agentname is around 1 second delay
Better than naming all units just place a trigger over the area where some units are to open fire on the agent
Set up like this
OPFOR PRESENT
condition this and triggeractivated trig1
On act {_x dofire agentname} foreach thislist
Name the trigger that sets agentname setcaptive false to trig1
I've tested it and it works well in Arma2 and OA.
-
Reveal (http://www.ofpec.com/COMREF/index.php?action=details&id=272&game=All) certainly works in OFP for situations where the AI needs a nudge to recognise stuff like freshly spawned vehicles etc. May work for Arma too.
Use F2kSel's trigger idea (could be the old whole-island trigger trick) to avoid having to name each loon.
-
Looks like it was fixed some time back.
[76664] Fixed: SetCaptive doesn't stop AI shooting at a unit/player
-
Looks like they didn't fix it at all since I have the latest version :D. The problem is not they don't shoot at the agent, but that it takes ages to acquire him as an enemy.
Anyway I tried with setFriendly and it appears they have a slightly faster reaction time.
-
Just tested it and this seems to work all the time:
_captive = _this select 0;
_executioner = _this select 1;
_captive setCaptive true;
sleep 5;
_captive setCaptive false;
_executioner setBehaviour "COMBAT";
_executioner reveal _captive;
_executioner doTarget _captive;