Jump to content
scifer

How to find a vehicle's mass / weight

Recommended Posts

Hello there!

I did a function that returns an array of vehicles that can be sling loaded. However some vehicles are too heavy for the current helicopter.

I'd like to know how to find the mass / weight of a vehicle given its config path so I can filter the list by its mass. Does any one know which attribute(s) determine a vehicle's mass?

Thank you so much

Share this post


Link to post
Share on other sites

Thanks for your replay :)

But getMass if for objects (spawned vehicles). I need to analyze the vehicle config.

I guess there is a mass attribute for certain vehicle parts like wheels in its config sub classes. So I'm doing a function to adds this attributes and return the total mass.

---------- Post added at 11:03 AM ---------- Previous post was at 10:49 AM ----------

Failed!

Not all vehicles have a 'mass' attribute in its config sub classes :(

Share this post


Link to post
Share on other sites

well i dont think there is a easy way to do this.

i belive you need to make this list of masses for vehicles manualy by depbo the arma files then load up the p3d's in eliteness.

in elitness you will see the models total mass.

Share this post


Link to post
Share on other sites

It's a pity that PhysX implementation is lacking at best, I really hope this will change in the future so every object will be PhysX compatible.

Other than the ways already mentioned, there's one other hacky way, you could guesstimate an objects mass and use setMass on it, no idea how this will work out for you though.

Cheers

Share this post


Link to post
Share on other sites

As a workaround I'm spawning the object and cheking with getMass in a 'while' loop. If the mass is above helo's 'slingLoadMaxCargoMass' it deletes the object and try another one.

Share this post


Link to post
Share on other sites

How about using the armor value as a quick hack? Vehicles with a higher armor value will be inherently heavier no?

_armor = getNumber (configfile >> "CfgVehicles" >> _veh >> "armor");

Share this post


Link to post
Share on other sites
How about using the armor value as a quick hack? Vehicles with a higher armor value will be inherently heavier no?

It is too inaccurate. One kg above the limit and I would end up with an object that cannot be lifted.

Roughly what I did was:

Generate SCF_cargoList with:

_vehicle	= [_this, 0, vehicle player, [objNull]] call bis_fnc_param;

_allVehicles = [configFile >> "CfgVehicles"] call bis_fnc_returnChildren;
_slingables	= [];

for [{_i = 0}, {_i < count _allVehicles}, {_i = _i + 1}] do {

_candidateConfig = _allVehicles select _i;

_slingPoints = getArray (_candidateConfig >> "slingLoadCargoMemoryPoints");
_isSlingable = count _slingPoints > 0;

_scope = getNumber (_candidateConfig >> "scope");
_isBase = _scope < 2;

if (_isSlingable && !_isBase) then {
	_slingables = _slingables + [configName _candidateConfig];
};

};

_slingables

Filter the SCF_cargoList with:

SCF_maxCargoMass = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "slingLoadMaxCargoMass");

while {_tooLight || _tooHeavy} do {

_cargoType = SCF_cargoList call bis_fnc_selectRandom;
_cargoObject = _cargoType createVehicle _cargoPosition;
_cargoMass = getMass _cargoObject;

_tooLight	= if (_cargoMass < (SCF_maxCargoMass / 2)) then {true} else {false};
_tooHeavy	= if (_cargoMass > SCF_maxCargoMass) then {true} else {false};

if (_tooLight || _tooHeavy) then {
	SCF_cargoList = SCF_cargoList - [_cargoType];
	deleteVehicle _cargoObject;
};

};

Edited by scifer

Share this post


Link to post
Share on other sites

Hmm. I suppose I don't understand what you're trying to do and exactly what the sling loading is. I figured it was for lifting vehicles (objects) and such. Armor value should more than suffice as a filter for what can and can't (shouldn't) be lifted. Glad you found a way in any case.

Share this post


Link to post
Share on other sites
I suppose I don't understand what you're trying to do and exactly what the sling loading is. I figured it was for lifting vehicles (objects) and such.

Sorry I should have said it only is in the experimental branch currently.

Share this post


Link to post
Share on other sites

You do know that

[color="#FF8040"][color="#1874CD"]_tooLight[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_cargoMass[/color] [color="#8B3E2F"][b]<[/b][/color] [color="#8B3E2F"][b]([/b][/color]SCF_maxCargoMass [color="#8B3E2F"][b]/[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

is the same as

[color="#FF8040"][color="#1874CD"]_tooLight[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#1874CD"]_cargoMass[/color] [color="#8B3E2F"][b]<[/b][/color] [color="#8B3E2F"][b]([/b][/color]SCF_maxCargoMass [color="#8B3E2F"][b]/[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

right?

Share this post


Link to post
Share on other sites

Thank you!

Yes I know. It's just a bad habit from the past that is stuck in my mind.

Share this post


Link to post
Share on other sites

vehicle -> sling hooks

["Land_WoodenBox_F",1]
["Land_MetalBarrel_F",1]
["Box_NATO_AmmoVeh_F",4]
["Box_East_AmmoVeh_F",4]
["Box_IND_AmmoVeh_F",4]
["B_supplyCrate_F",4]
["O_supplyCrate_F",4]
["I_supplyCrate_F",4]
["IG_supplyCrate_F",4]
["C_supplyCrate_F",4]
["Plane_CAS_02_base_F",4]
["O_Plane_CAS_02_F",4]
["Plane_Fighter_03_base_F",4]
["I_Plane_Fighter_03_CAS_F",4]
["I_Plane_Fighter_03_AA_F",4]
["Boat_Armed_01_base_F",6]
["Boat_Armed_01_minigun_base_F",6]
["B_Boat_Armed_01_minigun_F",6]
["O_Boat_Armed_01_hmg_F",6]
["Rubber_duck_base_F",4]
["B_Boat_Transport_01_F",4]
["O_Boat_Transport_01_F",4]
["Rescue_duck_base_F",4]
["B_Lifeboat",4]
["O_Lifeboat",4]
["C_Rubberboat",4]
["I_Boat_Armed_01_minigun_F",6]
["I_Boat_Transport_01_F",4]
["SDV_01_base_F",4]
["B_SDV_01_F",4]
["O_SDV_01_F",4]
["I_SDV_01_F",4]
["I_G_Boat_Transport_01_F",4]
["B_G_Boat_Transport_01_F",4]
["O_G_Boat_Transport_01_F",4]
["UAV_02_base_F",4]
["UAV_02_CAS_base_F",4]
["B_UAV_02_F",4]
["O_UAV_02_F",4]
["I_UAV_02_F",4]
["B_UAV_02_CAS_F",4]
["O_UAV_02_CAS_F",4]
["I_UAV_02_CAS_F",4]
["MRAP_01_base_F",4]
["MRAP_01_gmg_base_F",4]
["MRAP_01_hmg_base_F",4]
["B_MRAP_01_F",4]
["B_MRAP_01_gmg_F",4]
["B_MRAP_01_hmg_F",4]
["MRAP_02_base_F",4]
["MRAP_02_hmg_base_F",4]
["MRAP_02_gmg_base_F",4]
["O_MRAP_02_F",4]
["O_MRAP_02_hmg_F",4]
["O_MRAP_02_gmg_F",4]
["Offroad_01_base_F",4]
["C_Offroad_01_F",4]
["Offroad_01_repair_base_F",4]
["C_Offroad_01_repair_F",4]
["B_G_Offroad_01_repair_F",4]
["O_G_Offroad_01_repair_F",4]
["I_G_Offroad_01_repair_F",4]
["I_G_Offroad_01_F",4]
["Offroad_01_armed_base_F",4]
["I_G_Offroad_01_armed_F",4]
["B_G_Offroad_01_F",4]
["O_G_Offroad_01_F",4]
["B_G_Offroad_01_armed_F",4]
["O_G_Offroad_01_armed_F",4]
["Quadbike_01_base_F",4]
["B_Quadbike_01_F",4]
["O_Quadbike_01_F",4]
["C_Quadbike_01_F",4]
["I_Quadbike_01_F",4]
["I_G_Quadbike_01_F",4]
["B_G_Quadbike_01_F",4]
["O_G_Quadbike_01_F",4]
["MRAP_03_base_F",4]
["MRAP_03_hmg_base_F",4]
["MRAP_03_gmg_base_F",4]
["I_MRAP_03_F",4]
["I_MRAP_03_hmg_F",4]
["I_MRAP_03_gmg_F",4]
["Truck_01_base_F",4]
["B_Truck_01_transport_F",4]
["B_Truck_01_covered_F",4]
["Truck_02_base_F",4]
["O_Truck_02_covered_F",4]
["O_Truck_02_transport_F",4]
["I_Truck_02_covered_F",4]
["I_Truck_02_transport_F",4]
["Truck_03_base_F",4]
["O_Truck_03_transport_F",4]
["O_Truck_03_covered_F",4]
["O_Truck_03_repair_F",4]
["O_Truck_03_ammo_F",4]
["O_Truck_03_fuel_F",4]
["O_Truck_03_medical_F",4]
["O_Truck_03_device_F",4]
["Hatchback_01_base_F",4]
["C_Hatchback_01_F",4]
["C_Hatchback_01_sport_F",4]
["SUV_01_base_F",4]
["C_SUV_01_F",4]
["B_Truck_01_mover_F",4]
["B_Truck_01_box_F",4]
["B_Truck_01_Repair_F",4]
["B_Truck_01_ammo_F",4]
["B_Truck_01_fuel_F",4]
["B_Truck_01_medical_F",4]
["O_Truck_02_box_F",4]
["O_Truck_02_medical_F",4]
["O_Truck_02_Ammo_F",4]
["O_Truck_02_fuel_F",4]
["I_Truck_02_ammo_F",4]
["I_Truck_02_box_F",4]
["I_Truck_02_medical_F",4]
["I_Truck_02_fuel_F",4]
["Van_01_base_F",4]
["C_Van_01_transport_F",4]
["I_G_Van_01_transport_F",4]
["C_Van_01_box_F",4]
["C_Van_01_fuel_F",4]
["I_G_Van_01_fuel_F",4]
["B_G_Van_01_transport_F",4]
["O_G_Van_01_transport_F",4]
["B_G_Van_01_fuel_F",4]
["O_G_Van_01_fuel_F",4]
["Kart_01_Base_F",1]
["C_Kart_01_F_Base",1]
["C_Kart_01_F",1]
["C_Kart_01_Fuel_F",1]
["C_Kart_01_Blu_F",1]
["C_Kart_01_Red_F",1]
["C_Kart_01_Vrana_F",1]
["UGV_01_base_F",4]
["UGV_01_rcws_base_F",4]
["B_UGV_01_F",4]
["O_UGV_01_F",4]
["I_UGV_01_F",4]
["B_UGV_01_rcws_F",4]
["O_UGV_01_rcws_F",4]
["I_UGV_01_rcws_F",4]

Share this post


Link to post
Share on other sites
vehicle -> sling hooks

["Land_WoodenBox_F",1]
["Land_MetalBarrel_F",1]
["Box_NATO_AmmoVeh_F",4]
["Box_East_AmmoVeh_F",4]
["Box_IND_AmmoVeh_F",4]
["B_supplyCrate_F",4]
["O_supplyCrate_F",4]
["I_supplyCrate_F",4]
["IG_supplyCrate_F",4]
["C_supplyCrate_F",4]
["Plane_CAS_02_base_F",4]
["O_Plane_CAS_02_F",4]
["Plane_Fighter_03_base_F",4]
["I_Plane_Fighter_03_CAS_F",4]
["I_Plane_Fighter_03_AA_F",4]
["Boat_Armed_01_base_F",6]
["Boat_Armed_01_minigun_base_F",6]
["B_Boat_Armed_01_minigun_F",6]
["O_Boat_Armed_01_hmg_F",6]
["Rubber_duck_base_F",4]
["B_Boat_Transport_01_F",4]
["O_Boat_Transport_01_F",4]
["Rescue_duck_base_F",4]
["B_Lifeboat",4]
["O_Lifeboat",4]
["C_Rubberboat",4]
["I_Boat_Armed_01_minigun_F",6]
["I_Boat_Transport_01_F",4]
["SDV_01_base_F",4]
["B_SDV_01_F",4]
["O_SDV_01_F",4]
["I_SDV_01_F",4]
["I_G_Boat_Transport_01_F",4]
["B_G_Boat_Transport_01_F",4]
["O_G_Boat_Transport_01_F",4]
["UAV_02_base_F",4]
["UAV_02_CAS_base_F",4]
["B_UAV_02_F",4]
["O_UAV_02_F",4]
["I_UAV_02_F",4]
["B_UAV_02_CAS_F",4]
["O_UAV_02_CAS_F",4]
["I_UAV_02_CAS_F",4]
["MRAP_01_base_F",4]
["MRAP_01_gmg_base_F",4]
["MRAP_01_hmg_base_F",4]
["B_MRAP_01_F",4]
["B_MRAP_01_gmg_F",4]
["B_MRAP_01_hmg_F",4]
["MRAP_02_base_F",4]
["MRAP_02_hmg_base_F",4]
["MRAP_02_gmg_base_F",4]
["O_MRAP_02_F",4]
["O_MRAP_02_hmg_F",4]
["O_MRAP_02_gmg_F",4]
["Offroad_01_base_F",4]
["C_Offroad_01_F",4]
["Offroad_01_repair_base_F",4]
["C_Offroad_01_repair_F",4]
["B_G_Offroad_01_repair_F",4]
["O_G_Offroad_01_repair_F",4]
["I_G_Offroad_01_repair_F",4]
["I_G_Offroad_01_F",4]
["Offroad_01_armed_base_F",4]
["I_G_Offroad_01_armed_F",4]
["B_G_Offroad_01_F",4]
["O_G_Offroad_01_F",4]
["B_G_Offroad_01_armed_F",4]
["O_G_Offroad_01_armed_F",4]
["Quadbike_01_base_F",4]
["B_Quadbike_01_F",4]
["O_Quadbike_01_F",4]
["C_Quadbike_01_F",4]
["I_Quadbike_01_F",4]
["I_G_Quadbike_01_F",4]
["B_G_Quadbike_01_F",4]
["O_G_Quadbike_01_F",4]
["MRAP_03_base_F",4]
["MRAP_03_hmg_base_F",4]
["MRAP_03_gmg_base_F",4]
["I_MRAP_03_F",4]
["I_MRAP_03_hmg_F",4]
["I_MRAP_03_gmg_F",4]
["Truck_01_base_F",4]
["B_Truck_01_transport_F",4]
["B_Truck_01_covered_F",4]
["Truck_02_base_F",4]
["O_Truck_02_covered_F",4]
["O_Truck_02_transport_F",4]
["I_Truck_02_covered_F",4]
["I_Truck_02_transport_F",4]
["Truck_03_base_F",4]
["O_Truck_03_transport_F",4]
["O_Truck_03_covered_F",4]
["O_Truck_03_repair_F",4]
["O_Truck_03_ammo_F",4]
["O_Truck_03_fuel_F",4]
["O_Truck_03_medical_F",4]
["O_Truck_03_device_F",4]
["Hatchback_01_base_F",4]
["C_Hatchback_01_F",4]
["C_Hatchback_01_sport_F",4]
["SUV_01_base_F",4]
["C_SUV_01_F",4]
["B_Truck_01_mover_F",4]
["B_Truck_01_box_F",4]
["B_Truck_01_Repair_F",4]
["B_Truck_01_ammo_F",4]
["B_Truck_01_fuel_F",4]
["B_Truck_01_medical_F",4]
["O_Truck_02_box_F",4]
["O_Truck_02_medical_F",4]
["O_Truck_02_Ammo_F",4]
["O_Truck_02_fuel_F",4]
["I_Truck_02_ammo_F",4]
["I_Truck_02_box_F",4]
["I_Truck_02_medical_F",4]
["I_Truck_02_fuel_F",4]
["Van_01_base_F",4]
["C_Van_01_transport_F",4]
["I_G_Van_01_transport_F",4]
["C_Van_01_box_F",4]
["C_Van_01_fuel_F",4]
["I_G_Van_01_fuel_F",4]
["B_G_Van_01_transport_F",4]
["O_G_Van_01_transport_F",4]
["B_G_Van_01_fuel_F",4]
["O_G_Van_01_fuel_F",4]
["Kart_01_Base_F",1]
["C_Kart_01_F_Base",1]
["C_Kart_01_F",1]
["C_Kart_01_Fuel_F",1]
["C_Kart_01_Blu_F",1]
["C_Kart_01_Red_F",1]
["C_Kart_01_Vrana_F",1]
["UGV_01_base_F",4]
["UGV_01_rcws_base_F",4]
["B_UGV_01_F",4]
["O_UGV_01_F",4]
["I_UGV_01_F",4]
["B_UGV_01_rcws_F",4]
["O_UGV_01_rcws_F",4]
["I_UGV_01_rcws_F",4]

Thank you but what is the point?

Share this post


Link to post
Share on other sites

I am trying to get the theoretical mass of a vehicle class by looking into its config via the built-in config viewer, and I still can not find anything that could remind mass, weight or something like that. The game engine is known to support PhysX which works with mass parameter, but vehicle classes do not store it. Why ?

Share this post


Link to post
Share on other sites

My personal feeling is that the devs tried to simulate everything without the use of weights. I had my own experience with that while i tried to predict the flight path of rockets without any information bout their mass.

 

You should not ask why there is no reliable mass entry but ask how you can solve ur problem without the use of mass.

Share this post


Link to post
Share on other sites

For now I see one way, but it is an ugly hack. I can create a vehicle somewhere in the sky, far from the player, try to use 'getMass' on it, and then to delete the vehicle. But this hack may make some mess if several players will do it at the same time ... I should create a mess controller to avoid several vehicles in the sky ... Oh... This is weird 🙂

Share this post


Link to post
Share on other sites

again. I recommend to try to solve the problem completly without the use of mass...

Share this post


Link to post
Share on other sites
1 minute ago, sarogahtyp said:

again. I recommend to solve the problem completly without the use of mass...

To find the mass without any mass ? What do you mean ?

Share this post


Link to post
Share on other sites

You need the mass to just have it and to show someone that you are the one who knows vehicles masses?

Or why do you need to know it?

  • Like 1

Share this post


Link to post
Share on other sites

In other words, what are you trying to do, not only specifically, but in the abstract? And why necro an eight-year old post to ask about it?

 

34ZQ5LJ.jpg

  • Like 1

Share this post


Link to post
Share on other sites

I want to be able to view vehicle mass for the same purposes as for 'getMass' function.

These purposes may be different:

  • loading vehicles into aircrafts;
  • sling loading vehicles;
  • calculating the probability to tow;
  • calculating the probability to be towed;
  • something else.

Share this post


Link to post
Share on other sites

 

Quote

8 year olds, Dude.

LOL. I can say the same to game developers who introduced vehicle towing functions (setTowParent and disableBrakes) in the game version 2.08, which came out March 8, 2022.

Knowing that Steam says that Arma 3 was released on 12 Sep, 2013, we can calculate that the ability to use towing appeared more than 8 years after the game was released.

Greetings to the Bohemia Interactive Studios.

Share this post


Link to post
Share on other sites

We get it, you hate Arma 3. It's getting pretty boring.

  • Like 3

Share this post


Link to post
Share on other sites
21 minutes ago, Harzach said:

We get it, you hate Arma 3. It's getting pretty boring.

LOL. If I hated it, I wouldn't play Op. Flashpoint, Armed Assault, Arma 2 and Arma 3. Arma 3 is the top of my games in Steam.

Looks like I have to invent the wheel again. This is Arma 😂

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

×