Jump to content
Sign in to follow this  
Thrash

object size

Recommended Posts

How would i go about getting/setting the size of an object (in %) on the map (eg, a tree).

When an object in visitor is placed, it's possible to set the size of that object. I want to know if it's possible to read this size ingame

I've done a search and looked in the bis wiki but i cant seem to make any headway. Maybe someone here will know if it's possible or not.

Edit1: sizeOf gives me an x-axis size, but it doesnt quite do what i need.

Edit2: boundingBox does similar, but not a % of the original size.

Edited by Thrash

Share this post


Link to post
Share on other sites

I use this code to get object size when deciding how much fire to apply to an object:

_XTree = ((_TreeBoundingBox select 1 select 0) - (_TreeBoundingBox select 0 select 0))/2;
_YTree = ((_TreeBoundingBox select 1 select 1) - (_TreeBoundingBox select 0 select 1))/2;
_ZTree = ((_TreeBoundingBox select 1 select 2) - (_TreeBoundingBox select 0 select 2))/2;
_XTreeHalf = _XTree / 4;
_YTreeHalf = _YTree / 4;
_ZTreeHalf = (_ZTree / 4)-4;

_TreeVolume = _XTree * _YTree * _ZTree;

However, there is an inherent problem with trying to get tree sizes: random scaling.

When making a map, you can ranomly scale your placed trees to get a more natural look. However there doesn't seem to be a way to get that scaled information, when you get the bounding box info for any specific tree, you get the absolute P3D bounding box with no regard to how it's been scaled. So a tree 7m tall might return exactly the same information as a tree 15m tall.

So unfortunately we both seem to be in the same situation :(

Share this post


Link to post
Share on other sites
...However, there is an inherent problem with trying to get tree sizes: random scaling.

When making a map, you can ranomly scale your placed trees to get a more natural look. However there doesn't seem to be a way to get that scaled information, when you get the bounding box info for any specific tree, you get the absolute P3D bounding box with no regard to how it's been scaled. So a tree 7m tall might return exactly the same information as a tree 15m tall.

So unfortunately we both seem to be in the same situation :(

haha, that's exactly what i'm trying to do, get the scaled size.

What about getting the 'sizeOf' size and comparing it to the 'boundingBox' size? Might give it a go.

Share this post


Link to post
Share on other sites

Via v3 scripting, it should be doable. Try contacting Sy. He might be able to help you here.

Share this post


Link to post
Share on other sites

hi there,

DMarkwick

I have played with fire in arma1 and had a nice one quite realistic that was growing like in reality, you could extinguish it, it was propagating properly.

well acting like a real fire does.

My main script out of seven was about 9700 lines ... planes and chopper where able to extinguish dependently of the amount of water dropped on it, you had hot spot ..etc., etc.

:angryfire: But in your case as you just have a fire appearing, above you gave yourself the answer:

When making a map, you can randomly scale your placed trees to get a more natural look.

;) I explain with your own words :

When making a fire, you can randomly scale your placed flames to get a more natural look.

_TreeVolume = Rnd (_XTree * _YTree * _ZTree);

:flamethrower:

That could do the job :)

=DST= Ocramweb

Edited by ocramweb

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
Sign in to follow this  

×