Make AI use of vehicle weapons
-
hi,
anyone who knows more about GTA V AI could answer this for me please:
Is it possible to make the AI use all of the vehicle weapons against you? For example the jets: Can a mod make the AI use both, gun and missile against you?
And if bombs are added to a plane or if the AI uses addon planes which has bombs, can AI use them against you ?RDE for example spawns the savage helicopter at 5 stars, but AI uses none of the weapons, which is sad
-
@shephart Less information is provided. Kindly confirm are you trying to use the script made in SHP (Script Hook) or RPH(Rage Plugin Hook).
If you are using ScriptHook plugin, did you try the natives?
Here are few natives which might be helpful for your AI weapon usage.
CONTROL_MOUNTED_WEAPON(This is a Boolean value, which checks and forces the Ped(AI) to use the mounted weapon)
For your second requirement
Is it possible to make the AI use all of the vehicle weapons against you?
Yes, it is possible, you can use SET_MOUNTED_WEAPON_TARGET native. This native uses, below parameters,
Ped shootingPed(Your AI Ped)
Ped targetPed(Your Player Character)
Vehicle targetVehiclefloat x (Seems to be Radius)
float y (Seems to be Radius)
float z (Seems to be Radius)If you are using ScriptHookV Plugin, You will find this link more helpful. It has almost all the native collections and their usage explained.
http://www.dev-c.com/nativedb/Hope this helps.
And for the future references, please try to be more elaborative so people can provide you their assistance in a better way. (:
Happy coding.
-
@ashishcw I've been having the same question about getting the AI (most specifically soldiers) to use vehicle weapons against me, during a max 5-star wanted level, i.e. manning the Menacer's roof turret, or making the Savage (or even the Hunter) fire missiles at the player. I'm asking you this, since most people won't answer my question for crap.
-
@MarineMan2016 Hello there MarineMan, Though, I didn't use the AI using weapons against me, but I am very much sure, it can be achieved. As I mentioned it earlier, the native forces the ped to use the specific weapon if it has one. Check this for instance, As I am working on my current mod, where for the testing purpose, I am using my AI assistants to use machine gun on Turreted Limo. They kill the enemy using that gun.
In your case, or OP question, the target needs to be Player-Character, and I am sure, it will work.!
-
Hi. So I also need a config for AI use vehicle weapons.Do you have it? Can you send it to me? I'musing Redux btw.
-
@shephart said in Make AI use of vehicle weapons:
Is it possible to make the AI use all of the vehicle weapons against you?
I've just tried something for my personnal dispatch, that worked.
-
First you should check this thread, it gonna leads to multiple peds spawning in the vehicle.
-
And because the 'dispatch.meta/DispatchType/' 'DT_PoliceHelicopter' can be used for cars instead of helicopters, I replaced the 'VehicleSet' named SWAT_HELI_1 in my case, by a new one I've made, with the barrage vehicle in it, and S_M_Y_Marine_03 peds using it.
-
Then in 'mpchristmas2017///vehicle.meta/barrage', i've edited the layout line from 'LAYOUT_STD_BARRAGE' to 'LAYOUT_STD'
I've got the barrage being dispatched, with x3 peds in it and 2 of them using both barrage weapons.
If this could help.
EDIT :
Open 'dispatchtuning.ymt', go on CWantedHelicopterDispatch and change <TimeBetweenSpawnAttempts value="30.00000000"/>
to any value shorter so that the vehicle spawns more frequently.Now need to find a way to not make the vehicle appear from the sky and everything would be good.
NOTE : It seems like weapons aren't being used by AI in each vehicle. barrage works, but not dune3 for example.
-