HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Learns Skill" timing?

06-07-2004, 07:17 AM#1
Panto
Greetings.

I'm trying to make a trigger that gives an ability to a hero once he's at a certain level and has spent all his skill points. I thought that something like this:
Code:
Bonus Skill
    Events
        Unit - A unit Learns a skill
    Conditions
        (Hero level of (Learning Hero)) Equal to 10
        (Unspent skill points of (Learning Hero)) Equal to 0
        (Level of Bonus Skill for (Learning Hero)) Less than 1
    Actions
        Unit - Add Bonus Skill to (Leveling Hero)
would work a treat. But, in fact, it doesn't work at all. Any ideas as to why not?
06-07-2004, 08:58 AM#2
PatruX
Quote:
Originally Posted by Panto
Greetings.

I'm trying to make a trigger that gives an ability to a hero once he's at a certain level and has spent all his skill points. I thought that something like this:
Code:
Bonus Skill
    Events
        Unit - A unit Learns a skill
    Conditions
        (Hero level of (Learning Hero)) Equal to 10
        (Unspent skill points of (Learning Hero)) Equal to 0
        (Level of Bonus Skill for (Learning Hero)) Less than 1
    Actions
        Unit - Add Bonus Skill to (Leveling Hero)
would work a treat. But, in fact, it doesn't work at all. Any ideas as to why not?

Event:
Unit - A unit Learns a skill

Actions:
Unit - Add Bonus Skill to (Leveling Hero)

That doesn't really make sense?
06-07-2004, 05:30 PM#3
Panto
Indeed. Thanks.
06-07-2004, 09:01 PM#4
Panto
Sadly, I changed it to Learning Hero, and it still doesn't work. I'll try adding a Polled Wait, though I don't expect that it will work.

EDIT: Indeed, a Game Wait didn't help.
06-07-2004, 10:01 PM#5
AIAndy
I guess that this event like many others fires right before the skill is actually learned. So at that point the unspent skill points are actually 1.
06-07-2004, 11:16 PM#6
Panto
You're right. Setting it to 1 worked. Why would it fire in opposite order like that?
06-08-2004, 12:15 PM#7
AIAndy
It is the same with many events and it does help since you can actually do something about the event that fired the trigger like trying to prevent the damage on a unit is damaged event.