HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Hero Leveling Event

12-07-2006, 10:25 PM#1
Rising_Dusk
Just curious...
If I level up a unit from level 1 to level 18, does the event trigger only once or does it trigger 17 times?

And also, if it triggers only once --
Would it trigger 17 times if I did a loop to level the hero in increments of one or since when jass runs it spends no game-time would it still only trigger once?
12-07-2006, 10:27 PM#2
wyrmlord
You could probably figure out the answer faster if you just experimented instead of waiting for a reply.
12-07-2006, 10:29 PM#3
Rising_Dusk
That requires access to a world editor.
12-07-2006, 10:31 PM#4
TaintedReality
Quote:
If I level up a unit from level 1 to level 18, does the event trigger only once or does it trigger 17 times?

I would guess only once, because if you use a Tome of Power which adds more than 1 level, then it only fires once despite gaining several levels.

Quote:
And also, if it triggers only once --
Would it trigger 17 times if I did a loop to level the hero in increments of one or since when jass runs it spends no game-time would it still only trigger once?

It should trigger 17 times, because when the events are triggered they are probably placed into a queue and then read one at a time. I might be wrong, but that's my guess. And as wyrm said, it would probly be faster just to test it ;).

Edit: Didn't read your second post in time.
12-07-2006, 10:39 PM#5
shadow1500
TaintedReality's assumptions are all correct.
12-07-2006, 10:42 PM#6
Anopob
Agreed with above.

EDIT: Er, I meant TaintedReality, but I guess agreeing with shadow1500 means the same thing.
12-08-2006, 01:37 AM#7
Vexorian
It WILL trigger 17 times, but I am unsure that it the level of (Triggering unit) would be accurate I guess testing is needed.
12-08-2006, 03:36 AM#8
Rising_Dusk
Alright, well I'll run some tests on it and post my results when they come in.
Thanks for the help guys.
12-08-2006, 02:22 PM#9
masda70
After a couple of mins of testing:
Whether you use Add experience - <enough experience for level 18> - or Set hero level to - 18 - it will trigger only once.

Hero level of - Triggering Unit - works perfectly fine in the event callback if you do the loop.
12-09-2006, 10:40 PM#10
Anitarf
Quote:
Originally Posted by masda70
Hero level of - Triggering Unit - works perfectly fine in the event callback if you do the loop.
As it should, at least in my experience that makes sense. When another trigger causes your trigger's event to fire with one of it's actions, your trigger interrupts that trigger at that action. I learned this when globals got overwritten in one of my triggers even if I didn't have any waits in it - it turned out that when a "damage unit" action in my trigger killed a unit another trigger with the "a unit dies" event would immediately run.