• 🏆 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!

Leveling abilities through triggers.

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
Well.
  • Psychic Flow
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Psychic Flow [Learn]
    • Actions
      • Unit - Set level of Psychic Flow [Ability] for (Triggering unit) to ((Level of Psychic Flow [Ability] for (Triggering unit)) + 1)
This doesn't seem to work, i guess it's the "a unit learns a skill" event that fails.
How do i make a trigger that applies when the hero level up a certain skill?
(Long time since i was in the WE, seem to have lost some knowledge:eekani:)
 
Level 11
Joined
Jun 20, 2009
Messages
880
  • Ability
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Skill [Learn]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AbilityLvl[(Player number of (Owner of (Triggering unit)))] Less than 1
        • Then - Actions
          • Unit - Add Skill [Ability] to (Triggering unit)
        • Else - Actions
          • Unit - Set level of Skill [Ability] for (Triggering unit) to ((Level of Skill [Ability] for (Triggering unit)) + 1)
          • Set AbilityLvl[(Player number of (Owner of (Triggering unit)))] = (AbilityLvl[(Player number of (Owner of (Triggering unit)))] + 1)
How about this then? :D
 
Level 25
Joined
Mar 23, 2008
Messages
1,813
And why should you level abilities with triggers?

It's a dummy ability, so when i learn the [Learn] version, the other ability (that can't be seen) should be upgraded as well. I need the trigger to apply when i level the [Learn] ability and not when i learn i. (or if that is the same, i need to know what's wrong with my trigger). Beacuse now, it doesn't work.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Is Psychic Flow [Ability] already on your unit? Because if it's not, then Kala's way should work, since you can't set the level of an ability that doesn't exist on that unit. Kala's trigger doesn't actually need that variable though since it makes the trigger MPI.

A version of Kala's trigger without any variable.
  • Psychic Flow
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Psychic Flow [Learn]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Psychic Flow [Learn] for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Psychic Flow [Ability] to (Triggering unit)
        • Else - Actions
          • Unit - Set level of Psychic Flow [Ability] for (Triggering unit) to ((Level of Animate Dead for (Triggering unit)) + 1)
 
Level 25
Joined
Mar 23, 2008
Messages
1,813
Is Psychic Flow [Ability] already on your unit? Because if it's not, then Kala's way should work, since you can't set the level of an ability that doesn't exist on that unit. Kala's trigger doesn't actually need that variable though since it makes the trigger MPI.

A version of Kala's trigger without any variable.
  • Psychic Flow
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Psychic Flow [Learn]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Psychic Flow [Learn] for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Psychic Flow [Ability] to (Triggering unit)
        • Else - Actions
          • Unit - Set level of Psychic Flow [Ability] for (Triggering unit) to ((Level of Animate Dead for (Triggering unit)) + 1)

This is how the whole trigger looks:
  • Psychic Flow
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Psychic Flow [Learn]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Psychic Flow [Learn] for (Triggering unit)) Greater than or equal to 1
        • Then - Actions
          • Unit - Set level of Psychic Flow [Ability] for (Triggering unit) to ((Level of Psychic Flow [Ability] for (Triggering unit)) + 1)
        • Else - Actions
          • Unit - Add Psychic Flow [Ability] to (Triggering unit)
Same as yours in another way, so this should work you say?. Hmm.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
  • (Level of Psychic Flow [Learn] for (Triggering unit)) Greater than or equal to 1
This is the problem with your trigger. It will never add the ability to the unit since when you learn a skill for the first time, the level of that ability will be 1. The solution is to use my condition or replace Psychic Flow [Learn] with Psychic Flow [Ability].
 
Level 25
Joined
Mar 23, 2008
Messages
1,813
  • (Level of Psychic Flow [Learn] for (Triggering unit)) Greater than or equal to 1
This is the problem with your trigger. It will never add the ability to the unit since when you learn a skill for the first time, the level of that ability will be 1. The solution is to use my condition or replace Psychic Flow [Learn] with Psychic Flow [Ability].

Actually it works, it adds the ability when i learn it for the first time, it's when i upgrade it that it doesn't work. Or am i'm getting you wrong now? :/
 
Status
Not open for further replies.
Top