Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Hello! I am making a troll which can attack trees. Every attack the troll s owner player gets 2 lumber. When the troll stops from attacking the owner player will stop getting lumber, untill the next time when the troll will attack a tree
Create a channeling ability that targets Trees. Then using one of the many options for creating MUI triggers/spells, trigger the effects of the ability.
Unit Indexing comes to mind here as the easiest GUI method for tracking the Troll/Tree and managing the periodic nature of the ability.
Every 1 second -> Pick every unit in TrollChannelGroup -> Set CV = Custom value of (Picked unit) -> Set life of Tree[CV] = Life of Tree[CV} - 2, Add 2 Lumber to (Owner of (picked unit))
Units that begin channeling the ability are added to TrollChannelGroup (unit group) and units that stop casting the ability are removed from the group. You can enable the periodic trigger once the first unit is added to the group and disable it once the group is empty.
Tree[] is a Destructible variable array that you Set when you cast the ability:
Set Variable CV = Custom value of (Casting unit)
Set Variable Tree[CV] = Target destructible of ability being cast
Might be possible to use a jank/hacky work around and have the troll harvest lumber like a peasant/peon/ghoul but instead of returning to a drop off building they instead return instantly to themselves or a dummy unit near them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.