- Joined
- Jan 9, 2005
- Messages
- 2,127
I'm trying to make a sort of fancy way of harvesting lumber - the worker goes up to the tree, starts channeling, and after X seconds, the tree turns into a treant. The treant then waddles to the nearest town hall and deposits itself as lumber, dying in the process.
Few problems:
I thought about using something like Eat Tree to make the worker target the tree easier and have a trigger run whenever the spell is cast (giving a cast time equivalent to the time it would generally take to harvest a whole tree), but that's kind of... inellegant.
An alternative would be to give the worker a modified lumber harvest that peasants/orcs/ghouls have that deals 0 damage to the tree. Each time they hit the tree, an integer goes +1 and when reaching 20 or something, gets reset and the tree dies and a treant spawns in it's place. Use something like GetClosestUnit to pick nearest town hall and ask treant to go sacrifice itself. The problem with this solution is I can't find a way to detect when the tree in question is being struck to count up the integer.
Any alternate solution would be welcome.
PS: Didn't they have something like that in Creep Revolution?
Few problems:
I thought about using something like Eat Tree to make the worker target the tree easier and have a trigger run whenever the spell is cast (giving a cast time equivalent to the time it would generally take to harvest a whole tree), but that's kind of... inellegant.
An alternative would be to give the worker a modified lumber harvest that peasants/orcs/ghouls have that deals 0 damage to the tree. Each time they hit the tree, an integer goes +1 and when reaching 20 or something, gets reset and the tree dies and a treant spawns in it's place. Use something like GetClosestUnit to pick nearest town hall and ask treant to go sacrifice itself. The problem with this solution is I can't find a way to detect when the tree in question is being struck to count up the integer.
Any alternate solution would be welcome.
PS: Didn't they have something like that in Creep Revolution?