Jump to content
juleshuxley

Get a unit's vehicle weapon.

Recommended Posts

I can get an array of units onboard a vehicle:

fullCrew _vehicle;

How do I get the weapon each unit is controlling? I tried currentWeapon but that returns the unit's rifle that he's carrying.

I tried currentMuzzle and that has more success. It does return the current muzzle of the vehicle weapon the unit is controlling! How do I turn that into the class name of the weapon, rather than the muzzle? Not sure if possible. You can get the muzzles a weapon can have from the config but I don't think you can get the weapon a muzzle belongs to.

Grateful for any ideas, maybe I can get all the weapons of a vehicle, and then find out which unit is using what weapon? Can we do it that way round? Just want an array of all weapons aboard a vehicle and what unit is using what. Remember there can be more than one weapon per turret path!

If anyone's interested I'm making a HUD mod that gives a better overview of what a vehicle's crewmates are doing. And what weapon is selected by who is very useful in the case of AI crewmates or beginner human crewmates.

Thank you

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

×