Home   Help Search Login Register  

Author Topic: Getting AI to shoot a friendly unit?  (Read 1019 times)

0 Members and 1 Guest are viewing this topic.

Offline gezegond

  • Members
  • *
Getting AI to shoot a friendly unit?
« on: 03 May 2010, 13:00:28 »
Question: How to make an AI open fire on a friendly unit when a trigger is activated?

More Details:
Hey, I've been thinking about something like this:

You know how Soviet officers would kill other Soviet soldiers in WWII if they were to abandon the mission???

I want to do something like that, like if you do something that's not appreciated by an officer (like running into the woods) he would shoot & kill you.

I place a trigger in the woods that would detect the player, then I sync it with a waypoint that tells an officer to "DESTROY" him. but when the trigger is activated, the officer just runs towards the player and starts running around him instead of actually shooting him.

Is it possible to put a certain script in the "Script" field of the waypoint that would tell the AI to shoot the unit disregarding it's side???
« Last Edit: 03 May 2010, 13:11:18 by gezegond »

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: Getting AI to shoot a friendly unit?
« Reply #1 on: 03 May 2010, 14:30:24 »
There are at least two ways to do this, which aren't mutually exclusive.

You can also use doTarget and doFire together to force a unit to fire on anybody. You can place the commands, separated  by a semicolon, in the On Activation field of a trigger or waypoint, in a unit's initialization, or in an external script file.

Also, AIs will automatically shoot at men from their own side whose rating has dropped below a certain level. That's what's happening when the AIs kill you after you shoot two friendlies. So, you can use the addRating command with a large negative number (say -10000) to make a soldier into a renegade.
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)