Naiss 28 Posted July 20, 2016 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
Grumpy Old Man 3545 Posted July 20, 2016 nearestTerrainObjects And it's pretty fast too. Cheers Share this post Link to post Share on other sites
sarogahtyp 1108 Posted July 20, 2016 this command should lead the way:https://community.bistudio.com/wiki/nearestTerrainObjectsninjad... Share this post Link to post Share on other sites
veles-zv 176 Posted July 20, 2016 whats the point of detecting the tree or nearby objects? Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted July 20, 2016 whats the point of detecting the tree or nearby objects? You're not the creative type, are you? Cheers 5 Share this post Link to post Share on other sites
Tajin 349 Posted July 20, 2016 Can't hug a tree if you can't find one. 7 Share this post Link to post Share on other sites
Taxen0 15 Posted July 20, 2016 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
Naiss 28 Posted July 20, 2016 Thanks for the help :D Share this post Link to post Share on other sites
bottledhate 11 Posted July 23, 2016 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; 1 Share this post Link to post Share on other sites
Rick0Shay 4 Posted October 2, 2016 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
kremator 1065 Posted October 2, 2016 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
theend3r 83 Posted October 2, 2016 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
Rick0Shay 4 Posted October 2, 2016 @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