• 🏆 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] Help with a move units trigger using ability

Status
Not open for further replies.
Level 6
Joined
Jul 13, 2006
Messages
140
So, I am trying to make a sci-fi transport ability using triggers since dark summoning creates a pentagram on the ground.
But there seems to be something wrong with it, could somebody please let me know why?
I have tested with two dummy abilities, one is earthquake and the other is Blizzard, and it doesn't work.
Earthquake has just gone weird for some reason :/ (the targeting circle has disappeared).

  • teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Teleport
    • Actions
      • Set TempTelGroup = (Units within 300.00 of (Target point of ability being cast) matching (((Owner of (Picked unit)) Equal to (Owner of (Casting unit))) and (((Picked unit) is A structure) Not equal to True)))
      • Set TempPoint = (Position of (Casting unit))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in TempTelGroup and do (Actions)
        • Loop - Actions
          • Set TempLocus = (Position of (Picked unit))
          • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Move (Picked unit) instantly to TempPoint
          • Custom script: call RemoveLocation(udg_TempLocus)
      • Custom script: call DestroyGroup(udg_TempTelGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 9
Joined
Nov 4, 2007
Messages
931
Your trying to get the selection circle effect to display when the spell is cast I assume? I'm not sure how you would go about doing this since that circle only appears for the player who is attempting to target an aoe spell at a location, though you could probably just look up the path of the desired circle and reference that when calling the special effect in your trigger.
 
Here is how it should be, follow each part of it, to avoid mistakes and misunderstanding:
  • teleport
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Teleport
  • Actions
    • Set Points[1] = (Target point of ability being cast)
    • Set TempTelGroup = (Units within 300.00 of (Points[1]) matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and (((Matching unit) is A structure) Equal to False)))
    • Set Points[2] = (Position of (Triggering unit))
    • Special Effect - Create a special effect at Points[2] using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit Group - Pick every unit in TempTelGroup and do (Actions)
      • Loop - Actions
        • Set Points[3] = (Position of (Picked unit))
        • Special Effect - Create a special effect at Points[3] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
        • Special Effect - Destroy (Last created special effect)
        • Unit - Move (Picked unit) instantly to Points[2]
        • Custom script: call RemoveLocation (udg_Points[3])
    • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call DestroyGroup (udg_TempTelGroup)
    • Custom script: call RemoveLocation (udg_Points[1])
Tip: Base the spell on Channel ability.
 
Level 6
Joined
Jul 13, 2006
Messages
140
Here is how it should be, follow each part of it, to avoid mistakes and misunderstanding:
  • teleport
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Teleport
  • Actions
    • Set Points[1] = (Target point of ability being cast)
    • Set TempTelGroup = (Units within 300.00 of (Points[1]) matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and (((Matching unit) is A structure) Equal to False)))
    • Set Points[2] = (Position of (Triggering unit))
    • Special Effect - Create a special effect at Points[2] using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit Group - Pick every unit in TempTelGroup and do (Actions)
      • Loop - Actions
        • Set Points[3] = (Position of (Picked unit))
        • Special Effect - Create a special effect at Points[3] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
        • Special Effect - Destroy (Last created special effect)
        • Unit - Move (Picked unit) instantly to Points[2]
        • Custom script: call RemoveLocation (udg_Points[3])
    • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call DestroyGroup (udg_TempTelGroup)
    • Custom script: call RemoveLocation (udg_Points[1])
Tip: Base the spell on Channel ability.

One problem: the channel ability refuses to appear in the UI when playing.
Oh and does it help anything if I mention that all targeted units should be Air units and/or exclude some units?

Edit: Like this
  • teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Teleport dummy
    • Actions
      • Set TempLoc = (Target point of ability being cast)
      • Set TempTelGroup = (Units within 300.00 of TempLoc matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and (((Matching unit) is A structure) Not equal to True)))
      • Set TempPoint = (Position of (Triggering unit))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in TempTelGroup and 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
                  • (Unit-type of (Picked unit)) Not equal to Some Unit
                  • (Unit-type of (Picked unit)) Not equal to Some Unit
                  • (Unit-type of (Picked unit)) Not equal to etc. etc.
            • Then - Actions
              • Set TempLocus = (Position of (Picked unit))
              • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Move (Picked unit) instantly to TempPoint
              • Custom script: call RemoveLocation(udg_TempLocus)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempTelGroup)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempPoint)
Edit2: forget about the comment on the channel ability, the blizzard based one works fine except for one thing,
the teleport effect is always at the centre of the AoE, and not at any of the targeted units.

Edit3: whoops, heh, found out why it was doing that, it is told to create it at TempLoc instead of TempLocus, my bad.
But it begins immediately, despite the fact that it should wait until the casting time has gone (which is 5 seconds), which it doesn't (though I do suspect why).

Edit4: nevermind, I have no idea how to fix that except maybe using another dummy spell, though I don't know which one.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Base it on channel and use "follow through time", set it to a few seconds.

Use "starts the effect of an ability" as the event.

To make Channel visible in UI, there's some field you must enable, Options or something in object editor. Enable "visible".

Set the conditions like this, no need for the extra AND.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Conditions
      • (Unit-type of (Picked unit)) Not equal to Some Unit
      • (Unit-type of (Picked unit)) Not equal to Some Unit
      • (Unit-type of (Picked unit)) Not equal to etc. etc.
 
Status
Not open for further replies.
Top