[Solved] Mirror image destroys variables?

Level 5
Joined
Feb 18, 2016
Messages
96
I set a learning hero to turn into Var(variable) when the learned hero´s skill equal to a custom mirror image. Problems is i see that when the mirror image is casted the variable stops working until i level up mirror image skill so i reactivate the set variable =

  • Varia
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Mirror Image
    • Actions
      • Set Varia = (Learning Hero)
 
Level 3
Joined
Jun 18, 2016
Messages
68
Well, you set this Variable is only for "Learning Hero"

and

You cast mirror image is different event....

Lean a skill is (Learning Hero)
Start the effect of an ability[<-mean cast spell] is for (Triggering Unit)
 
Level 5
Joined
Feb 18, 2016
Messages
96
Thanks for the replies

Well, you set this Variable is only for "Learning Hero"

and

You cast mirror image is different event....

Lean a skill is (Learning Hero)
Start the effect of an ability[<-mean cast spell] is for (Triggering Unit)
If i dont cast the spell the variable works perfectly and if i create another trigger that set the variable again (or a different variable) when it casts the ability it dont create the variable. I use learning hero variable because the ability gives you an active and a passive effect that works pretty well if i dont cast mirror image

As far as I am aware, using mirror image will not change the handle of a unit. As such the variable should still correctly refer to the caster of Mirror Image after mirror image is cast.

Maybe another trigger is conflicting with the variable?

I going to search about a conflict while i trying to solve this error
 
Level 5
Joined
Feb 18, 2016
Messages
96
I found the problem but i am unable to solve it because i dont know how. When i modify the mirror image ability or create a new custom skill which based on mirror image the ability starts to delete the variable. I made a blank map and modified its objects until i fond the error and that is.

Any ideas?
 
Last edited:
Level 5
Joined
Feb 18, 2016
Messages
96
  • mirror image
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Mirror Image based ability
    • Actions
      • Set hero = (Learning Hero)

  • hero variable trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to hero
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
As you can see the trigger stops working when the mirror image is casted
 

Attachments

  • Mirror Image.w3x
    13 KB · Views: 35

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,083
As you can see the trigger stops working when the mirror image is casted
That is because every unit created by mirror image learns the ability. So for example, if you have level 3 mirror image in your test map and cast it, then the learn trigger fires 6 times. It fires 3 times for the real hero and 3 times for the illusion. The illusion often ends up learning it last so the variable gets set to them.
 
Level 5
Joined
Feb 18, 2016
Messages
96
That is because every unit created by mirror image learns the ability. So for example, if you have level 3 mirror image in your test map and cast it, then the learn trigger fires 6 times. It fires 3 times for the real hero and 3 times for the illusion. The illusion often ends up learning it last so the variable gets set to them.

It is true! Thanks you very much. I was using a trigger that set the variable with different abilities learned on every hero
  • Varia
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Learned Hero Skill) Equal to q
          • (Learned Hero Skill) Equal to w
          • (Learned Hero Skill) Equal to e
          • (Learned Hero Skill) Equal to r
    • Actions
      • Set Hero = (Learning Hero)
and now i disabled this trigger and replaced it by casting unit triggers and they works perfectly without rewriting all the triggers this units starts
 
Top