• 🏆 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] Swap spell randomly doesn't work

Status
Not open for further replies.
Level 23
Joined
Oct 18, 2008
Messages
937
  • ToG Enter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is an illusion) Equal to True
      • (Unit-type of (Entering unit)) Equal to Guy
    • Actions
      • Set ToG[(Player number of (Owner of (Entering unit)))] = (Entering unit)
  • ToG Swap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to TheOtherGuy
      • (ToG[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
    • Actions
      • Set TempPoint = (Position of (Casting unit))
      • Set TempUnit2 = ToG[(Player number of (Owner of (Casting unit)))]
      • Set TempPoint2 = (Position of TempUnit2)
      • Unit - Turn collision for TempUnit2 Off
      • Unit - Turn collision for (Casting unit) Off
      • Unit - Move TempUnit2 instantly to TempPoint
      • Unit - Move (Casting unit) instantly to TempPoint2
      • Unit - Turn collision for (Casting unit) On
      • Unit - Turn collision for TempUnit2 On
Illusion is created by mirror image. Switch is based on wind walk.

in all simpleness, the spell is supposed to switch the unit with his illusion. it sometimes works as intended but most of the time does nothing as the spell is cast.

its not MUI. it used to be before i remade it in hopes of fixing it but it still doesn't work most of the time.
 
Level 9
Joined
May 22, 2009
Messages
276
you can use triggering unit instead of entering unit but I guess it woudn't change anything

I'm guessing the ability is instant? You could make it target the illusion and have the condition: Target unit of ability being cast equal to ToG(Number of Owner of (casting/triggering unit)
 
Level 18
Joined
Oct 18, 2007
Messages
930
Hmm. As I see it, the spell is instant but the unit creation can be slighty delayed. If so, it would lead to the unit you're looking for to be moved is non-existent.

Another thing that comes to my mind is that "TheOtherGuy" might be equal to "null". If so the trigger will never fire.

++ Since the creation might be delayed the trigger will not fire because the illusion has to enter the map to make the trigger "ToG Swap" fire.


If you'd give me some mins I could try and fix something up. Might be a bit hard for me to do, have to install Wc3 again then, but I could try and write a vJass or Jass or maybe GUI code real fast in the text.


~Dynasti
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
First of all, there is no delay.

Second of all, even if there was delay, it would only cause a problem if he were trying to cast the spell immediately once the illusion is created, which doesn't make any sense since a spell can be cast at any given time during the game.
 
Status
Not open for further replies.
Top