• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] SetUnitX SetUnitY channeling spell problem

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2018
Messages
114
Hi! I came up with an idea to make a non channeled Tranqulity spell. For that i decided to make a dummy unit that would cast a spell itseld and periodically would be moved to a hero caster. I couldn't use "instatly move to a point" option as it interrupst orders and casts. So I went on with SetUnitX SetUnitY. But the problem is after unit is moved spell remains on the place it was cated on (see screenshot). How do I fix that? How to i make spell follow the dummy unit? Thanks in advance!

also triggers:

  • Tranquility
    • Event
      • Unit - A unit start an effec of a ability
    • Conditions
      • (Ability being cast) equals to (Tranqulity)
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing degrees
      • Unit - Add Tranqulity (dummy) to (Last created unit)
      • Unit - Set level of Tranqulity (dummy) for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Order (Last created unit) to Kotg Tranqulity
      • Unit - Add a 10.00 second expiration timer to (Last created unit)
      • Set TQ_Index = (TQ_Index + 1)
      • Set TQ_Caster[TQ_Index] = (Triggering unit)
      • Set TQ_Counter[TQ_Index] = 0.00
      • Set TQ_Dummy[TQ_Index] = (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TQ_Index equal to 1
          • Then - Action
            • Trigger - Turn on TranqulityLoop <gen>
          • Else - Actions
  • TranqulityLoop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TQ_Loop_Integer) from 1 to TQ_Index, do (Actions)
        • Loops - Actions
          • Set TQCasterlocation[TQ_Loop_Integer] = (Position of TQ_Caster[TQ_Loop_Integer])
          • Custom script: call SetUnitX(udg_TQ_Dummy[udg_TQ_Loop_Integer], GetLocationX(udg_TQCasterlocation[udg_TQ_Loop_Integer]))
          • Custom script: call SetUnitY(udg_TQ_Dummy[udg_TQ_Loop_Integer], GetLocationY(udg_TQCasterlocation[udg_TQ_Loop_Integer]))
          • Set TQ_Counter[TQ_Loop_Integer] = (TQ_Counter[TQ_Loop_Integer] + 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TQ_Counter[TQ_Loop_Integer] greater or equals to 10.00
            • Then - Actions
              • Set TQ_Caster[TQ_Loop_Integer] = TQ_Caster[TQ_Index]
              • Set TQ_Dummy[TQ_Loop_Integer] = TQ_Dummy[TQ_Index]
              • Set TQ_Counter[TQ_Loop_Integer] = TQ_Counter[TQ_Index]
              • Set TQ_Index = (TQ_Index - 1)
              • Set TQ_Loop_Integer = (TQ_Loop_Integer - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TQ_Index equals 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
              • Else - Actions
 

Attachments

  • MoveUnitX.png
    MoveUnitX.png
    2.1 MB · Views: 57
  • MoveUnitX.png
    MoveUnitX.png
    2.1 MB · Views: 63
Level 18
Joined
Jun 13, 2016
Messages
586
I don't think you can make the spell follow if it doesn't work like that already. Tranquility is a hard-coded spell and it was probably never accounted for the fact that it might move.

Maybe you can instead create the dummy and give it a regeneration aura, and attach the tranquility effect to it manually?
 
Level 8
Joined
Feb 17, 2018
Messages
114
I don't think you can make the spell follow if it doesn't work like that already. Tranquility is a hard-coded spell and it was probably never accounted for the fact that it might move.

Maybe you can instead create the dummy and give it a regeneration aura, and attach the tranquility effect to it manually?
I thought of that. But auras' effects stay after anit leaves AoE for a second more or so. And if I remove aura's buff with a trigger after i don't need it it can spoil the effect for another unit nearby who can have the same aura.
 
Status
Not open for further replies.
Top