• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Ability not Working

Status
Not open for further replies.
Level 8
Joined
Feb 23, 2020
Messages
255
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)
 
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.
 
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:
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)
 
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! :)
 
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.
Back
Top