Jump to content
LoOni3r

Vehicle Mass / weight with cfgname

Recommended Posts

 

Hello everybody,

 

 

how can I read the mass (weight) of a vehicle without spawning it?

 

getNumber(configFile >> "CfgVehicles" >> _cfgname >> "mass");

doesn't seem to exist.

 

getmass and mass unfortunately requires an object

 

 

many thanks in advance

 

Share this post


Link to post
Share on other sites

Afaik the mass is stored in the model, so you need to get the model.. by spawning it.
Maybe you can just createSimpleObject it under the ground, far away from view?

Share this post


Link to post
Share on other sites

Sometimes this is necessary.
You can spawn the vehicle in [0,0,0]. get the mass and delete it.

Share this post


Link to post
Share on other sites
25 minutes ago, BRPVP said:

You can spawn the vehicle in [0,0,0]. get the mass and delete it.

 

yes use createVehicleLocal on server, then delete

Share this post


Link to post
Share on other sites
34 minutes ago, gc8 said:

 

yes use createVehicleLocal on server, then delete

Thanks for unintentionally reminding me.. Completely forgot that I wanted to add createSimpleObjectLocal 🤦‍♂️

Share this post


Link to post
Share on other sites
5 minutes ago, Dedmen said:

Thanks for unintentionally reminding me.. Completely forgot that I wanted to add createSimpleObjectLocal 🤦‍♂️

 

I don't see command with that name in wiki but createSimpleObject allows third parameter to define the locality.

Does simple objects have all the geometry like "normal" objects do?

Share this post


Link to post
Share on other sites
15 minutes ago, gc8 said:

Does simple objects have all the geometry like "normal" objects do?

all the geo you need.

 

15 minutes ago, gc8 said:

allows third parameter to define the locality

I also completely forgot that

  • Thanks 1

Share this post


Link to post
Share on other sites
3 minutes ago, Dedmen said:

all the geo you need.

 

should probably switch to simpleobject creation then in my mission where I need to get the vehicles size, if it's faster?

Share this post


Link to post
Share on other sites
Just now, gc8 said:

 

should probably switch to simpleobject creation then in my mission where I need to get the vehicles size, if it's faster?

yes faster and more efficient

  • Thanks 1

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

×