Teleport Displacement

Cheekything

TH.net Regular
Reaction score
5
Right my problem is that when you teleport to a unit and there isn't room it displaces to another area normally one it shouldn't be in.

I was wondering if there is an easy way to cancel the spell if the area X is occupied/ cant accommodate the unit.

Many thanks in advance.
 

Cheekything

TH.net Regular
Reaction score
5
Thats soooo helpful -.-".

The reason for this is that it is used in abuse not because of stupidity.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
If your teleport spell is a point target you could set up a trigger that would stop the caster on unit casts a spell or ability if there's not so much path able terrain around the target. Honestly I've never seen the type of movement your describing outside of mirror image in a small space.
 

denmax

You can change this now in User CP.
Reaction score
155
Make a small region.

Upon cast, move that region to the point.

If a unit occupies that region then order your unit to stop..

UNTESTED
 

Cheekything

TH.net Regular
Reaction score
5
If your teleport spell is a point target you could set up a trigger that would stop the caster on unit casts a spell or ability if there's not so much path able terrain around the target. Honestly I've never seen the type of movement your describing outside of mirror image in a small space.

It's hard to explain since I've been yet to recreate it however people who play my map complain about it to no end... so it's tricky but also possible but in short the Teleportee is 4 squares of space and the target location and unit are 1 square which is where warcraft3 does a glitch and move it to higher terrain so i'm told.

Make a small region.

Upon cast, move that region to the point.

If a unit occupies that region then order your unit to stop..

UNTESTED

Will try that to see if it works. cheers
 

Tythoid

New Member
Reaction score
23
Heres a trigger that works. The teleport spell im using is blink but ive changed the casting time to 0.01 on the ability. This is very important so the spell works.
You will need to make this trigger
  • variable of type unit group called all_units
  • a dummy unit with no model, invulerable, no attack and flying

Code:
add unit
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Unit Group - Add (Triggering unit) to allunits

Code:
add to
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit Group - Add (Picked unit) to allunits)
        Unit Group - Remove teleport 0000 <gen> from allunits

Code:
dont blink
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Blink
    Actions
        Unit - Move teleport 0000 <gen> instantly to (Target point of ability being cast)
        Unit Group - Remove (Triggering unit) from allunits
        Unit Group - Pick every unit in allunits and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between (Position of teleport 0000 <gen>) and (Position of (Picked unit))) Less than 100.00
                    Then - Actions
                        Unit - Order (Triggering unit) to Stop
                    Else - Actions
        Unit Group - Add (Triggering unit) to allunits

Heres the map which the has the trigger
 

eXirrah

New Member
Reaction score
51
Hmm there is a better way I think. Same triggers but with no dummy unit. just check the distance between the point of target of ability been cast and every unit in the group instead of creating dummy unit.

Even easier is :
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blink
    • Actions
      • Set tmp_Point = (Target point of ability being cast)
      • Set allunits = (Units within 200.00 of tmp_Point)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (allunits is empty) Equal to False
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
 

Curo

Why am I still playing this game...?
Reaction score
109
The dummy is the most precise way to guarantee that you have room. You could have several units within 200 range, yet still have enough room to teleport.

For the triggers involving the dummy, you don't need that periodic trigger to add everything to allunits. Just have a trigger that runs at map init, and when a unit enters the playable map.

Now for MY idea. Instead of bothering with the universal unit group like the previous trigger, do this: Unit begins casting Teleport > Move dummy unit to target point of ability being cast. Now, if there is no room, the dummy will be moved somewhere away from the target point. So what you so is set both the target point and current point of the dummy as variables, and see if the distance between the points is greater than 0. If it is, it means that the dummy is not where you want it to be, therefore there is no room to teleport, and you need to order the triggering unit to stop. This of course will work with Blink, but not Mass Teleport when multiple units are being teleported at once.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top