OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Oberleutnant35 on 07 Nov 2005, 08:43:43

Title: Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Oberleutnant35 on 07 Nov 2005, 08:43:43
All I need to do is get the AI foot soldiers to fire a LAW or RPG at say, an empty car.

Shouldn't be that tough, right?  Looked all about and found many others with the same problem... but no answers!

I can get the AI to target the said car and blast away with small arms (including hand grenades).  But I can only get them to fire their LAWs and RPGs straight up into the air... which isn't particularly helpful!    :o

Here's what I've got so far...

(This one has the loon equipping his LAW launcher only to put it back up without actually firing any LAW rounds.  He then commences to fire on the car with his M16):

LAWMan doTarget _car
~.5
LAWMan selectWeapon "LAWLauncher"
LAWMan playmove "Weapon"
LAWMan dofire _car

(And this one has him fire one LAW round at the moon):    ???

LAWMan doTarget _car
~.5
LAWMan selectWeapon "LAWLauncher"
LAWMan playmove "Weapon"
LAWMan fire ["LAWLauncher","LAWLauncher"]

Any ideas?  Thanks is advance!

Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Trapper on 07 Nov 2005, 11:16:08
Remove magazines and handgrenades and try your first idea again.
Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Dagon on 07 Nov 2005, 11:28:01
I'll be uploading my workaround so you can take a look at it in a minute, if you like.
Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Dagon on 07 Nov 2005, 11:37:39
Note that this while this will work on "soft" vehicles, it won't work on human targets.

OFP's loons are apparently hague convention obeying boyscouts. Damn.

If I was more scriptwise I'd change the script to simply do a logic test to find all ammos of not the "LAWlauncher" type and remove them, but since I'm not, I won't. -_-.
Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Terox on 07 Nov 2005, 17:15:41
the use on an invisible target addon would be helpful here, such as the ones in the bas island pack

these targets come as infantry, armour, IR etc so using the correct invis target will cause the ai to react with the correct weapon.

Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Oberleutnant35 on 08 Nov 2005, 09:03:44
Thanks!  Tried out removing ammo and the BAS invisible targets and both ways do the trick.  ;D

Of course, neither are as nice as if there were a simple "fire rpg at object X regardless of ammo" but hey, I ain't complaining!

Anyone know the difference between "Armour" and "Heavy" BAS invisible targets?  I'm assuming "Laser" has something to do air attacks?

Title: Re:Getting the AI to fire LAWs/RPGs at neutral objects
Post by: Terox on 08 Nov 2005, 15:39:55
following configs are identiocal almost to the bas configs

   class WGL_Target_EHvy:WGL_Target
   {
      side=0;
      scope=2;
      displayName="East Heavy Invis Target";
      threat[]={1,1,1};
      armor=1500;
      irtarget=1;
   };
   


class WGL_Target_EArm:WGL_Target
   {
      side=0;
      scope=2;
      displayName="East Armour Invis Target";
      threat[]={1,1,1};
      armor=500;
   };