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 again all! Trying to make it to where a ghoul is eating a corpse I have on the ground, once in range he attacks. Haven't messed with any sort of animation trigger so I hope it's easy? Thanks.
just to make sure I understand -> whenever a ghoul is using the "cannibalize" ability -> if an enemy unit walks in range, he should stop eating the corpse and go attack the enemy? that is what you want? is this only for a specific player or some other specific circumstances?
just to make sure I understand -> whenever a ghoul is using the "exhume corpse" ability -> if an enemy unit walks in range, he should stop eating the corpse and go attack the enemy? that is what you want? is this only for a specific player or some other specific circumstances?
this should do what you want. There are some memory leaks in the last one (since I stopped using GUI I have become clinically lazy about this) which you will have to remove, but hopefully this will give you enough to go off of:
starts eating
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Cannibalize
Actions
Unit Group - Add (Triggering unit) to cannibalizegroup
done eating
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Cannibalize
Actions
Unit Group - Remove (Triggering unit) from cannibalizegroup.
preiodic distance checker
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in cannibalizegroup and do (Actions)
Loop - Actions
Set VariableSet tempGroup = (Units within (Default acquisition range of (Picked unit)) of (Position of (Picked unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit)).) Equal to True).)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in tempGroup) Greater than 0
Then - Actions
Unit - Order (Picked unit) to Attack (Random unit from tempGroup)
Else - Actions
- for cannibalizeGroup -> you don't need to worry about leaks from that group. it's just one "static" group that you are not actively creating or destroying. you just add and remove units from it.
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.