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

Preferred Teleport

Status
Not open for further replies.
Level 5
Joined
Jan 15, 2018
Messages
128
Hello all,

The goal of this ability is for a hero to teleport but only with a select few units.
The base spell is mass teleport (Sauron's Will) but it will only teleport one unit.
I am not confident with triggers, does this look right?
Or is there a simpler way?

  • SWill
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Sauron's Will
    • Actions
      • Set VariableSet SWill_Caster = (Triggering unit)
      • Set VariableSet Swilltempp = (Position of SWill_Caster)
      • Set VariableSet SWill_ug = (Units within 1200.00 of Swilltempp.)
      • Unit Group - Pick every unit in SWill_ug and do (Actions)
        • Loop - Actions
          • Set VariableSet FEtempu = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Swill_tempu is alive) Equal to True
                  • (Swill_tempu belongs to an ally of Player 21 (Coal).) Equal to True
                  • Or - Any (Conditions) are true
                    • Conditions
                  • (Unit-type of Swill_tempu) Equal to The Easterling
                  • (Unit-type of Swill_tempu) Equal to Nazgul
            • Then - Actions
              • Unit - Move Swill_tempu instantly to (Target point of ability being cast)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Swilltempp)
          • Custom script: call DestroyGroup(udg_Swill_ug)
 
Level 5
Joined
Jan 15, 2018
Messages
128
ok so i moved the two unit (temp units) up into the all conditions are true block and it still doesnt work.

Only 7 nazgul can be trained, they are limited using the unit limit script counting The Witch King and the Easterling, that is the 9.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
this should do what you want... i based it on a channel based spell that does nothing on it's own, bc stopping mass tp from tping other things just compllicates things further. add special effects and wtvr via triggers. also obviously update the names of your units...

gl!

  • Make Mordor Great Again
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 'channel based LOTR spell'
    • Actions
      • Set CasterPoint = (Position of (Triggering unit))
      • Set TargetPoint = (Target point of ability being cast)
      • Set UnitGroup = (Units within 1200.00 of CasterPoint matching ((((Matching unit) belongs to an ally of Player 21 (Coal)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to The Easterling) or ((Unit-type of (Matching unit)) Eq)
      • Unit - Move (Triggering unit) instantly to TargetPoint
      • Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to TargetPoint)
      • -------- remove leaks... you know how... --------
edit: lol, the long line got cut off. i'll add the map.

edit: also, make sure you build your channel spell right - besides all the usual stuff you can find in tutorials, yours also needs to have 999999 range (or whatever you want the range of the spell to be), and target a point.
 

Attachments

  • teleport for the glory of the dark lord.w3x
    17.3 KB · Views: 30
Last edited:
Level 5
Joined
Jan 15, 2018
Messages
128
Still cant seem to get it

  • SWill
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sauron's Will
    • Actions
      • Set VariableSet Swilltempp = (Position of (Triggering unit))
      • Set VariableSet SWill_ug = (Units within 1200.00 of Swilltempp.)
      • Set VariableSet Swill_target = (Target point of ability being cast)
      • Unit Group - Pick every unit in SWill_ug and do (Actions)
        • Loop - Actions
          • Set VariableSet FEtempu = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Swill_tempu is alive) Equal to True
                  • (Swill_tempu belongs to an ally of Player 21 (Coal).) Equal to True
              • ((Unit-type of (Picked unit)) Equal to The Easterling) or ((Unit-type of (Picked unit)) Equal to Nazgûl)
            • Then - Actions
              • Unit Group - Pick every unit in SWill_ug and do (Unit - Move (Picked unit) instantly to Swill_target)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Swilltempp)
          • Custom script: call DestroyGroup(udg_SWill_ug)
          • Custom script: call RemoveLocation(udg_Swill_target)
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
you never defined "swill_tempu" and you keep refering to it. also, after you put in the conditions for the picked unit - you ignore them by re-picking all units in SWill_ug and moving them. If you want you can just open the map I sent, copy and paste the trigger on to your map and change the unit and abilities to be the right ones...

otherwise- change the following:

1. this is not necessary : Set VariableSet FEtempu = (Picked unit)

2. in the if then else loop - have the unit you are checking be "picked unit" the whole time. no variables are necessary.

3. in the 'actions' of the "if then else" loop, just have - move picked unit. no unit group. the top part of that loop already defined and set the conditions for which picked unit to apply that to.

4. make sure to move all of the leak removal out of the loop. you are currently deleting your variables after the loop goes off once.

that should do it. gl.
 
Last edited:
Status
Not open for further replies.
Top