Jump to content
Sign in to follow this  
masterfulninja

Set AI vehicle weapon choice per waypoint.

Recommended Posts

I'm trying to get two attack helis to take down a defensive tower (killing the static defenses on top) but they keep strafing using the guns primarily.

Ive seen them use rockets occasionally, sometimes they do take the building down, but not reliably.

Im sure there's a script to limit the vehicles AI weapon choice, anyone know what it is?

Share this post


Link to post
Share on other sites

Ive looked at the link you provided and Ive tried running

heli1 fireAtTarget [mg1,"HellfireLauncher"];

from a called script. I know the script is activating because of the help text byt im still not seeing any missiles or rockets.

Have i got the syntax wrong?

Share this post


Link to post
Share on other sites

Try using the same method I used with GKB_fnc_randomAAFire:

_unit doWatch _direction;

_unit fire (_unit weaponsTurret [0] select 0);

(use your static object instead of position [_direction in my example] when using doWatch)

Not sure if it works with helicopters, and unfortunately can't test this right now...

Edited by Gekkibi

Share this post


Link to post
Share on other sites

_unit fire (_unit weaponsTurret [0] select 0);

The default order on the gunship is gun, missiles, rockets. So a 2 instead of a 0? In which place?

Share this post


Link to post
Share on other sites

Sigh, well i got my script working but even though i have the pilots target and look at the mg, then fire a missile, it still doesn't track. I'm guessing i will have to use a fireattarget like Tajin suggested... But I still cant get that command to work.

heli1 fireAtTarget [mg1,"HellfireLauncher"]; is the syntax im using, im not sure "HellFirelauncher" is the right operand for the Skalpel ATGM but my searches havent turned up a Skalpel classname...

Share this post


Link to post
Share on other sites

Skalpel ATGM is not a rocket. Try to create a laser marker where the CSW is located...

PS. What helicopter are you using?

Share this post


Link to post
Share on other sites

MI-48

I know its not a rocket, initially i wanted rockets to destroy a tower but since the heli needs to be perfectly aligned to fire rockets ive given up on that idea and ill just missile the thing. The missiles track and follow where the gunner is looking, when i have the script fire them and im the gunner they curve to where im looking, so no need for a laser pointer. (i guess?) I thought a dowatch and dotarget followed by a manual missile fire would lead to a hit.

Sometimes the AI autofires missiles from a distance on their own, when they do they hit. So i know the vehicle is capable of hits. But they dont always fire missiles and dont always fire at all -_-

Edited by masterfulninja

Share this post


Link to post
Share on other sites

The classname for the weapon is "missiles_SCALPEL".

Edit: Damn, ninja'd... ;)

Share this post


Link to post
Share on other sites

Alright, Ive got the fireattarget command working with "missiles_SCALPEL", the missiles fire on command but still aren't tracking. Ive tried using dowatch, dotarget, assignedTarget, and laserTarget, none seem to be working.

heli1 doWatch mg1;

mg1 = assignedTarget heli1;

heli1 dotarget mg1;

mg1 = laserTarget heli1;

Share this post


Link to post
Share on other sites

Well, I've even tried just scripting the cannon to fireattarget to see if it would aim at my targets and it wont even do that, just fires blindly into nothing.

I don't get what I'm missing here, i guess ill just give up on helicopters...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×