Move unit instantly Trigger

BlackNerubia

New Member
Reaction score
12
Alright so im trying to make a trigger that teleports a unit to a point if there are no enemy units within 100 range of the casting unit, but i cant seem to get it working right
Code:
Move Conditions
    Events
        Unit - A unit Begins casting an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                (Ability being cast) Equal to Move 
                Players_Turn[(Player number of (Triggering player))] Equal to True
    Actions
        Unit Group - Remove all units from MovmentGroup
        Set Point = (Target point of ability being cast)
        Set TempUnit = (Casting unit)
        Unit Group - Pick every unit in (Units within 100.00 of Point) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Picked unit) Equal to No unit
                                (Picked unit) Equal to TempUnit
                    Then - Actions
                        Unit - Move (Casting unit) instantly to Point
                    Else - Actions
                        Game - Display to (All players) the text: You cannot move wit...
                        Unit - Order TempUnit to Stop
        Custom script:   call RemoveLocation( udg_Point )
any help would be greatly appreciated
 

Crux

New Member
Reaction score
2
I'm not sure what you're doing with your conditional statement, however if I were you I would create a temp unit group and do something like this.

Set TempUnitGroup = ( Units within 100.0 of Point )

If
( Number of units in TempUnitGroup = 0 )

Then
( Unit - Move casting unit to Point )

Else
( Display to player matching own of casting unit "Insert Message" )
( Order TempUnit to Stop )

Granted I don't have WE open, but I think this will work.
 

vypur85

Hibernate
Reaction score
803
So what is not working? It teleports even there is unit? Or It doesn't teleport at all? Maybe this would work:

Code:
Actions
    Set TempGroup = (Units within 100.00 of (Target point of ability being cast))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            (Number of units in TempGroup) Equal to 0
        Then - Actions
            Unit - Move (Triggering unit) instantly to (Target point of ability being cast)
        Else - Actions
            Game - Display to (All players) the text: Your text

Edit: Sorry... = = I just posted the exact same thing as Crux did = =. Forget this post. Was AFK for a while. Didn't know that the thread was updated.
 
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