[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