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

[Trigger] Illusion instant move

Status
Not open for further replies.
Level 16
Joined
Jun 24, 2009
Messages
1,409
I'm making a spell that creates a dummy at a point given before and cast an illusion spell (item illusion) on the hero. How can I move the created illusion instantly to the position of the dummy? When I try it with the simple move it not working because the dummy spell is already casted but the illusion isn't made yet.
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
I know but I don't think it requires the trigger.
But if you need...
  • Illusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Illusion
    • Actions
      • Set Caster[2] = (Triggering unit)
      • Set Point[2] = (Position of Caster[2])
      • Set TempGroup = (Units owned by (Owner of Caster[2]) matching (((Matching unit) is an illusion) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempGroup is empty) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Pick every unit in TempGroup and do (Unit - Kill (Picked unit))
      • Custom script: call DestroyGroup(udg_TempGroup)
      • For each (Integer B) from 1 to 50, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Triggering unit) Equal to SCaster[(Integer B)]
                  • indbool[(Integer B)] Equal to True
            • Then - Actions
              • Custom script: call RemoveLocation(udg_Point[2])
              • Set Int = (Integer B)
              • Set Point[2] = (Position of Shuriken[Int])
              • Set indbool[Int] = False
              • Unit - Kill Shuriken[Int]
              • Custom script: call RemoveLocation(udg_startloc[udg_Int])
              • Unit Group - Remove all units from DDGroup[Int]
            • Else - Actions
      • Unit - Create 1 Dummy for (Owner of Caster[2]) at Point[2] facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Illusion Dummy to (Last created unit)
      • Unit - Set level of Illusion Dummy for (Last created unit) to (Level of Illusion for Caster[2])
      • Set TempGroup = (Units owned by (Owner of Caster[2]) matching (((Matching unit) is an illusion) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • Unit - Move (Picked unit) instantly to Point[2]
          • Unit - Turn collision for (Picked unit) On
      • Custom script: call IssueTargetOrderById(GetLastCreatedUnit() , 852274 , udg_Caster[2])
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_Point[2])
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
You need to get the spawned illusions using the event "A unit spawns an llusion"
  • GetSpawnedIllusion
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • -------- Your Actions Here --------
You could also add the unit onto a unit group so you could filter which illusions to pick, just remember to remove the units in the group when you've already fetched them in the spawn event so the group wouldn't be populated by removed units.
 
Status
Not open for further replies.
Top