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!
This trigger doesnt seem to work. Every second the dummy casts invisibility even though theres a condition for it. I have to create 'Unit - Enter Region' triggers for each hiding spot and then it works.
The condition isn't the problem; how you've structured your if statements is. Every second it checks if the unit in each of 5 regions, but if has the buff and hidingspot[(Integer A)] contains protagonist ever evaluates to false while it has the buff, the buff is then removed. The unit can't be in all 5 regions simultaneously unless they all overlap, so one of those checks will always evaluate to false and it will always clear the buff, then attempt to re-add it. Instead you need to check that all of the regions as a whole don't contain the unit (not just that a least 1 of them doesn't contain it). I would structure this check like this:
Set IsHiding = false
For each (Integer A) from 1 to 5 do (Actions)
Loop - Actions
If (All conditions are true) then do...
If - Conditions
(hidingspot[(Integer A)] contains protagonist) equal to true
Then - Actions
Set IsHiding = true
Else - Actions
If (All conditions are true) then do...
If - Conditions
IsHiding = false
(protagonist has buff Invisibility) equal to true
Then - Actions
Unit - Remove Invisibility buff from protagonist
Else - Actions
If (All conditions are true) then do...
If - Conditions
IsHiding = true
(protagonist has buff Invisibility) equal to false
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.