Jump to content

Is it possible to change the weight of a helicopter via SSE?


609_Relentov

Recommended Posts

I wrote some helo scripts to do some transporting of troops, light vehicles, etc., as part of my exercise to learn DCS SSE and lua.  One thing I was not able to figure out was how to adjust the weight of the helicopter after "loading" these units.  Thus, currently anything loaded has no impact on helo weight/performance.  Are there some SSE API functions that would allow you to change the weight of a helicopter unit?

 

Link to comment
Share on other sites

For reasons beyond my understanding it isn't part of the unit class. Instead it is in trigger. Fun part is it works with most aircraft. 

https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo

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

Link to comment
Share on other sites

One follow-up question:  Say I use the function as follows to add the weight of 6 troops (e.g. 200lb/91kg each):

trigger.action.setUnitInternalCargo('helo 1', 546)

After I unload the troops, can I use negative values to reduce the weight by the same amount?  e.g.:

trigger.action.setUnitInternalCargo('helo 1', -546)

Or would I just set the cargo weight to 0, such as?:

trigger.action.setUnitInternalCargo('helo 1', 0)

Seems to be the latter, as the description says "Overrides any previously set value".


Edited by 609_Relentov
Link to comment
Share on other sites

It is setting the value, its not adding or subtracting at all.  You set the weight back to zero if you want there to be no cargo weight. 

It also sets in gradually over a second or so. 

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

Link to comment
Share on other sites

6 hours ago, Grimes said:

It is setting the value, its not adding or subtracting at all.  You set the weight back to zero if you want there to be no cargo weight. 

It also sets in gradually over a second or so. 

Thanks - I was testing last night and came to that conclusion.  Works great!

One observation: I noticed that after I loaded troops (via scripting) and then added the cargo weight as described above, when I tried the rearm menu the weight/max weight at the bottom of the rearm pop up doesn’t show the adjusted weight after calling setUnitInternalCargo().  Not a huge deal, but it would be cool to see that adjusted weight, so you could adjust the load-out and fuel accordingly.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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