Jump to content

Add mass to Helo when picking up infantry. How to get the 'current' mass before you add to it?


Recommended Posts

Posted

So there's the great function

DCS func setUnitInternalCargo - DCS World Wiki - Hoggitworld.com

But that overrides the existing amount. 

If you are picking up 3 passengers at different times/locations, you need to add them incrementally. So ideally you need to know the helo's current cargo mass to add on each pax as they get picked up.

But there is no 'getUnitInternalCargo' for some really, really crazy reason...

 

The only thing I've found is the 'getDesc()' that has a:

 ["massEmpty"] = 34000,

So, is this the only way?

DCS func getDesc - DCS World Wiki - Hoggitworld.com

And use the empty weight and then add on each 'passenger'? Which unfortunately means you have to remember how many pax it loaded and how much their individual masses are...

 

Posted

Internal cargo is added mass. If you used setUnitInternalCargo with the empty mass value then the total mass of the aircraft would be emptymass * 2 + weapon + fuel. So don't do that unless you want to make them super heavy. The values within getDesc are static and do not change. 

To answer your question you gotta keep track of it on your own. The value outright sets the mass, assuming each passenger weighs the same you do something like  

currentPassangers = currentPassangers + 1
trigger.action.setUnitInternalCargo("heli" , currentPassangers * passangerMass )

 

  • Thanks 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted
2 hours ago, Grimes said:

Internal cargo is added mass. If you used setUnitInternalCargo with the empty mass value then the total mass of the aircraft would be emptymass * 2 + weapon + fuel. So don't do that unless you want to make them super heavy. The values within getDesc are static and do not change. 

To answer your question you gotta keep track of it on your own. The value outright sets the mass, assuming each passenger weighs the same you do something like  

currentPassangers = currentPassangers + 1
trigger.action.setUnitInternalCargo("heli" , currentPassangers * passangerMass )

 

Yeah, that is what I figured and changed my data structures to manage that. 
 

thanks though. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...