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

Illusion problem

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
You just need to give a signal when one of illusion abilities are used.

  • Detect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to YOUR_HERO
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to ILUS_ABILITY_1
        • Then - Actions
          • Set IllusionAbility = 1
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to ILUS_ABILITY_2
        • Then - Actions
          • Set IllusionAbility = 2
        • Else - Actions
  • Spawn
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoning unit)) Equal to YOUR_HERO
      • ((Summoned unit) is an illusion) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IllusionAbility Equal to 1
        • Then - Actions
          • -------- Illusion is created via first ability --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IllusionAbility Equal to 2
        • Then - Actions
          • -------- Illusion is created via second ability --------
        • Else - Actions
      • -------- It is good to reset this value for some cases.---
      • Set IllusionAbility = 0
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
From what I understand, you want to select a certain illusion after a unit has used an illusion ability when there are more than 1 illusion is created. If that's the case, try this. (in this example im gonna make player 1 selects the illusion)
1. You need a boolean variable (e.g. name selectIllusion).
2. When a unit uses the illusion ability, set the boolean variable to true (selectIllusion = true)
3. When a unit enters playable map area and is an illusion and selectIllusion is equal to true, then use
  • Selection - Select Triggering Unit for Player 1 (Red)
and set selectIllusion = false. That way, when the next illusion is created, selectIllusion is already false and the trigger will not run.

There you go, one of the illusion created is selected by player 1.
 
Level 18
Joined
May 11, 2012
Messages
2,103
From what I understand, you want to select a certain illusion after a unit has used an illusion ability when there are more than 1 illusion is created. If that's the case, try this. (in this example im gonna make player 1 selects the illusion)
1. You need a boolean variable (e.g. name selectIllusion).
2. When a unit uses the illusion ability, set the boolean variable to true (selectIllusion = true)
3. When a unit enters playable map area and is an illusion and selectIllusion is equal to true, then use
  • Selection - Select Triggering Unit for Player 1 (Red)
and set selectIllusion = false. That way, when the next illusion is created, selectIllusion is already false and the trigger will not run.

There you go, one of the illusion created is selected by player 1.

Wow, this actually makes sense!
I might apply this thing after all, since this way it won't collide with another illusion creating spell.
Thanks, Shadow Flux
 
Status
Not open for further replies.
Top