Features:
-- Can be toggled on and off
-- Setting is stored and loaded with the game.
How it works:
-- Instead of changing the terrain by adding a tree as an attachment,
the tree and the terrain is locked so it cannot be moved.
-- The tree registers for callback when there is a collision.
-- A map from the tree to a set of bases that collide with the tree is kept.
When the set is empty the tree is shown, when non-empty the tree
is hidden. Making the tree hidden and visisble is done by calling
Object:setInvisibleTo.
-- The map is kept up to date at all times, so we can just adjust
the visibility when toggling of hiding terrain.
-- The map is saved and loaded with the game.
Bug:
https://github.com/leberechtreinhold/dba3_tts/issues/19
The size of the trees returned in the API is too small, so collisions
are not detected if a tree's branches hang over a base. Since there
is no collision, the tree is not hidden.
Features: -- Can be toggled on and off -- Setting is stored and loaded with the game.
How it works: -- Instead of changing the terrain by adding a tree as an attachment, the tree and the terrain is locked so it cannot be moved.
-- The tree registers for callback when there is a collision.
-- A map from the tree to a set of bases that collide with the tree is kept. When the set is empty the tree is shown, when non-empty the tree is hidden. Making the tree hidden and visisble is done by calling Object:setInvisibleTo.
-- The map is kept up to date at all times, so we can just adjust the visibility when toggling of hiding terrain.
-- The map is saved and loaded with the game.
Bug: https://github.com/leberechtreinhold/dba3_tts/issues/19 The size of the trees returned in the API is too small, so collisions are not detected if a tree's branches hang over a base. Since there is no collision, the tree is not hidden.
See: https://www.youtube.com/watch?v=R8Iq862mrdw