Jump to content

Recommended Posts

Posted

I want to know how much payload a helicopter has and how much more he can carry. If I know that I can dynamically set the maximum of units a medevac helicopter should be allowed to carry.

Posted

Have you tried having a vulgar amount of troops attempt to load up in a helo then count how many are missing?

It's a good thing that this is Early Access and we've all volunteered to help test and enhance this work in progress... despite the frustrations inherent in the task with even the simplest of software... otherwise people might not understand that this incredibly complex unfinished module is unfinished. /light-hearted sarcasm

Posted

I already count _my_ units, but I want to know how many weapons, how much fuel, etc the Hueys have. I want that a huey with 4 miniguns can't carry 6 guys.

Posted (edited)

local u = Group.getByName("A10C-1"):getUnit(1)
local KG_TO_LBS = 2.2046226
local mass = u:getDesc().massEmpty
mass = mass + u:getFuel()*u:getDesc().fuelMassMax
if u:getAmmo() then
    for _, item in pairs(u:getAmmo()) do
        mass = mass + item.count*item.desc.warhead.mass
    end
end
return mass * KG_TO_LBS

Thank you for the link! That snippet here is almost perfect. I'll just ignore the fuel load and have to look around how to calculate a proper load from this informations for the Hueys and Mi-8s.

 

Next improvement to the Medevac script is in the pipeline :D

Edited by audax
Posted

I was under the impression that warhead.mass was directly related to the explosive power of the warhead and not the actual mass of the weapon.

 

 

For what its worth I have a feature request created view and modify the cargo mass of objects. Specifically I requested 3 functions:

 

Unit.getCargoMass -- returns mass of cargo in kg

Unit.setCargoMass -- sets the mass of cargo to a specific value

Unit.addCargoMass -- adds the given mass to the cargo. If mass is a negative value it subtracts the mass.

 

If you guys can think of any other useful functions for the scripting engine with regard to cargo, let me know and I'll add it to the feature request. Keep in mind that I can't guarantee that devs will add it.

 

 

However, getFuel() is bugged in multiplayer right now.
The good news its been fixed for a while, the bad news is the fix must wait until 2.0 due to incompatibilities between it and current version.

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
Ian;2396435']Take a look at Unit.getAmmo()' date=' Unit.getFuel(), and Unit:getDesc().fuelMassMax (see this thread for example code and output).

 

However, getFuel() is bugged in multiplayer right now.

Thanks for that link! Very helpful!

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Posted (edited)
I was under the impression that warhead.mass was directly related to the explosive power of the warhead and not the actual mass of the weapon.

 

 

For what its worth I have a feature request created view and modify the cargo mass of objects. Specifically I requested 3 functions:

 

Unit.getCargoMass -- returns mass of cargo in kg

Unit.setCargoMass -- sets the mass of cargo to a specific value

Unit.addCargoMass -- adds the given mass to the cargo. If mass is a negative value it subtracts the mass.

 

If you guys can think of any other useful functions for the scripting engine with regard to cargo, let me know and I'll add it to the feature request. Keep in mind that I can't guarantee that devs will add it.

 

 

The good news its been fixed for a while, the bad news is the fix must wait until 2.0 due to incompatibilities between it and current version.

Off topic but do you know if cargo naming is fixed internally?

Edited by Ciribob

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

  • Recently Browsing   0 members

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