Jump to content
Sign in to follow this  
PlacidBox

Retrieving a unit's turret weapons

Recommended Posts

I'm trying to get a list of all weapons available to a unit while they are in a vehicle. "weapons player" will get the weapons of their man, not their turret, while "weapons (vehicle player)" only gets the weapons of the main turret.

The next obvious solution is to use weaponsTurret, but there doesn't seem to be an easy way to get the turret a unit is currently in, only to check if a specific unit is in a specific turret.

Is the only way to do this fetch the vehicle's config and iterate through the turrets, checking each one to see if it's the unit + turret path I want, or is there something obvious that I'm missing?

---------- Post added at 02:43 AM ---------- Previous post was at 02:38 AM ----------

Yep, missing something obvious, looks like the "assignedVehicleRole" function will return the unit's turret correctly while they're in a vehicle.

Share this post


Link to post
Share on other sites
Yep, missing something obvious, looks like the "assignedVehicleRole" function will return the unit's turret correctly while they're in a vehicle.

Nice find, im learning something new every day :)

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  

×