• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Ability not Working

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Why is this ability not working?
[Archers training] Does not get increased levels

  • Ambush Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Spellbook_Level[(Level of spellbookability for (Triggering unit))] = (Level of Archers Training (In spellbook) for (Triggering unit))
      • Set VariableSet Ambush_Level[(Level of Archers Training (In spellbook) for (Triggering unit))] = (Level of Ambush for (Triggering unit))
  • Learn Ambush
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Ambush
    • Actions
      • Unit - Add spellbookability to (Learning Hero)
 
Level 12
Joined
Jan 30, 2020
Messages
875
The reason is simple :
Triggering unit does not exist at Map initialization.

You need to first give the unit in your second trigger the ability, then set the level of the ability.
 
Level 7
Joined
Feb 23, 2020
Messages
253
The reason is simple :
Triggering unit does not exist at Map initialization.

You need to first give the unit in your second trigger the ability, then set the level of the ability.

  • Learn Ambush
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Ambush
    • Actions
      • Unit - Add spellbookability to (Learning Hero)
      • Set VariableSet Spellbook_Level[(Level of spellbookability for (Triggering unit))] = (Level of Archers Training (In spellbook) for (Triggering unit))
      • Set VariableSet Ambush_Level[(Level of Archers Training (In spellbook) for (Triggering unit))] = (Level of Ambush for (Triggering unit))
Like this? If so, it still doesn't work :/
The "Archers training" is an ability inside of spellbook, which means i want it to be hidden.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
No, not like this.

First you can replace Triggering unit with Learning unit or the opposite (It could be faster), replace learning unit with Triggering unit, for clarity.

Next the reason your spells don't gain a level is simply because you don't set the spell levels, you just set the variables containing the levels.

This said your triggers are quite confusing.

What are you trying to do exactly ?
When your Hero learns a level of Ambush, you want to set his level of Archers training to the level of Ambush ?

If this is the case, do something like this :

  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to Ambush
  • Actions
    • Unit - Set level of Archers Training (In spellbook) for (Triggering unit) to Level of Ambush for (Triggering unit)
 
Level 7
Joined
Feb 23, 2020
Messages
253
No, not like this.

First you can replace Triggering unit with Learning unit or the opposite (It could be faster), replace learning unit with Triggering unit, for clarity.

Next the reason your spells don't gain a level is simply because you don't set the spell levels, you just set the variables containing the levels.

This said your triggers are quite confusing.

What are you trying to do exactly ?
When your Hero learns a level of Ambush, you want to set his level of Archers training to the level of Ambush ?

If this is the case, do something like this :

  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to Ambush
  • Actions
    • Unit - Set level of Archers Training (In spellbook) for (Triggering unit) to Level of Ambush for (Triggering unit)
God it was this simple... idk i got confused and over thought the scenario i guess. Thank you very much for your help! :)
 
Level 12
Joined
Jan 30, 2020
Messages
875
Very pleased it worked !
Never give up, there will always be difficulties in mapmaking, but there is nearly always a solution :)
 
Status
Not open for further replies.
Top