• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Abilities and hero levels.

Status
Not open for further replies.
Level 2
Joined
Jul 27, 2014
Messages
17
So, I am trying to do a trigger that makes it so when my hero enters a region, the level of a unit's ability is increased.

EVENTS
Unit - A unit enters [region]
CONDITIONS
Entering Unit - Equal to [hero]
ACTIONS
Unit Group - Pick every unit in [Units in [Region]] and do [Unit - Set level of [Ability Name] for [Picked Units] to [Hero level of [Hero]]

Not really working...

EDIT - I was just using an ability that didn't work. Silly me. :p
 
Last edited:
Level 26
Joined
Aug 18, 2009
Messages
4,097
Is the entering unit possibly the one to receive the ability level? Are the event region and the picking region the same?

In this case:

The pick function is borderline to the event. When the event happens, the state whether the unit would be target of the picking is changing. Therefore it's questionable whether the picking works (still deterministic though) and is object to testing. And I can say that, in this case, there is another specialty. The "unit enters a region" (GUI) function internally uses the RegionAddRect native to create a jass region from your GUI region (rect) but this function extends the max coordinates by 32 each. This is because regions consist of cells of 32*32 size, cells originate left-bottom and now it falsely uses the max coordinates of the rect as roots for another line of cells each. The consequence is that when a unit enters the rect from top or right side, the event fires earlier and the picking will succeed then, otherwise it's mentioned borderline.

Anyway, if the entering unit is meant to receive the ability level, one can avoid the pick function altogether and use the entering unit event response instead.
 
Status
Not open for further replies.
Top