Jump to content
Sign in to follow this  
ArmedBoy

Vehicle weapon selection

Recommended Posts

Hi all!

I'm writing a very simple fsm script used by some vehicles(ah64d in this case), for choosing wich weapon the vehicle must use to attack enemy targets. I have an array that contains a list of targets the vehiacle can engage.

At a specific time the apache must process this array, choose the more convenient target(eg. first a tank and then a soldier), approach and attack it by using the weapon i want(eg. M230 for soldiers or fixed MGs, FFAR for ligth tanks etc).

The script seems to run correctly(i debug it by displaying informations like: name, type etc. of the chosen target),

but the apache seems to ignore my switching weapon commands, engaging the given targets using the weapon he wants(mostly hellfire).

this is the sample code i use for targeting/weapon switching:

_ah64;		// vehicle used
_currTarget;	// target of the ah64;

(gunner _ah64) doTarget currTarget;
(gunner _ah64) action ["SWITCHWEAPON", _ah64, _ah64, 1];

_ah64 action ["USEWEAPON", _ah64, gunner _ah64, 1];

could someone tell me what i'm doing wrong?

MOD:

Using

 gunner _ah64 selectWeapon "FFAR_Launcher"

the apache load the FFAR and slowly approaches the enemy target, but at the last second, he switches to Hellifire missile and destroys the enemy, without using the FFAR.

Edited by ArmedBoy

Share this post


Link to post
Share on other sites

If you want that the AH64 uses his FFAR you can remove his other weapons and add them after the attack again.

Share this post


Link to post
Share on other sites

Thank you, i was thinking about it, the only boring thing is that - as you said - i have to add/remove other weapons, each time the AH64 fires something. I was searching for a more natural implementation but i will try it.

Another thing i noticed is that also the driver gives attack/target orders, so i don't know if this behaviour depends from an order issued by the driver to the gunner.

The last question i got is:

Is there a method to overwrite for some units, the "core" scripts/fsm defining some combat behaviour(like formation, danger etc), with custom written scripts?

Edited by ArmedBoy

Share this post


Link to post
Share on other sites

never mind.. didnt read the hole post.

remove other weapons or magz-

or try set behavoure to careless.

Edited by nuxil

Share this post


Link to post
Share on other sites

At last i tried the removeWeapon trick but sadly, the ah64 miss the target in a shameful way.

Maybe, the combat with rockets(where the driver manages the fire direction) is not so well implemented.

Thank you.

Edited by ArmedBoy

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  

×