Jump to content
Sign in to follow this  
Naiss

Detecting trees?

Recommended Posts

im trying to detect the closes tree to the player but i just can't seems to find any post or info how i would do this

Share this post


Link to post
Share on other sites

whats the point of detecting the tree or nearby objects? 

Share this post


Link to post
Share on other sites

whats the point of detecting the tree or nearby objects? 

You're not the creative type, are you?

 

Cheers

  • Like 5

Share this post


Link to post
Share on other sites

Can't hug a tree if you can't find one.

  • Like 7

Share this post


Link to post
Share on other sites

whats the point of detecting the tree or nearby objects?

Yesterday I made a script that removed all trees in a certain radius, they were in the way for the sniper position I wanted to use. So that is one example at least :)

Share this post


Link to post
Share on other sites

Thanks for the help :D

Share this post


Link to post
Share on other sites

Trees in a 20m radius of player.  http://prntscr.com/bwlu1y

nearTrees = nearestTerrainObjects [player, ["TREE","SMALL TREE"], 20];

timberrrrrr!  (at least one tree model doesn't actually fall over on Tanoa. It is a cluster of a few trees in 1 mode.: t_inocarpus_f.p3d) 

{_x setDamage 1} forEach nearTrees;

go away trees...

{_x remoteExecCall ["hideObjectGlobal",2]} forEach nearTrees;
  • Like 1

Share this post


Link to post
Share on other sites

Ok here's a challenge. How to remove fallen trees (terrain object)?

 

Tree (terrain object) does not change ATL/ASL position on the map when it falls.

 

So how to detect fallen tree? 

 

And yes I was there when it fell so I can confirm it made a noise. :wacko:

Share this post


Link to post
Share on other sites

If a remote fallen tree is removed in a forest ... does it make a sound ?

Share this post


Link to post
Share on other sites

Ok here's a challenge. How to remove fallen trees (terrain object)?

 

Tree (terrain object) does not change ATL/ASL position on the map when it falls.

 

So how to detect fallen tree? 

 

And yes I was there when it fell so I can confirm it made a noise. :wacko:

Get all the trees in vicinity, find the damaged ones and hideObject them?

Share this post


Link to post
Share on other sites

@teeend3r - yep your logical suggestion worked - thanks.

 

The solution turned out to be simple and trees like other terrainobjects sustain damage (as expected) they however don't trigger when dead - !alive but do when damage ==1 or partial.

Also the tree collision hull is removed from the object when damage ==1 presumably to prevent AI pathing issues. AI appear to be able to see and shoot through fallen trees. 

 

So a very simple solution to clear all fallen trees (damage ==1) in an area is to drop a logic down and on it's init put :

trees = nearestTerrainObjects [this, ["TREE". "SMALL TREE" "BUSH"], 500];  

Then run a trigger, cond = true

{if (damage _x ==1) then {hideobject _x}} foreach trees; 

I tried to script it but that got a little tricky and I ended up being stumped (excuse the pun) when processing the object array.

Perhaps someone with better array knowledge could write something that's more elegant than a simple trigger / logic combo. 

 

Also maybe slowly sinking the tree below the surface would be less dramatic than sudden removal. 

 

The trees made no noise when removed even though I was there at the time - virtually speaking.

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  

×