OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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!
-
Remove magazines and handgrenades and try your first idea again.
-
I'll be uploading my workaround so you can take a look at it in a minute, if you like.
-
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. -_-.
-
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.
-
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?
-
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;
};