Is this an infinite loop?

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
Yes, that would be an infinite loop. Just chop that region into two. Region 0 Entrance/Exit, Region 1 Entrance/Exit. So you can:

Events
A Unit enters Region 0 entrance

Actions
Move unit instantly to Region 1 exit

Events
A Unit enters Region 1 entrance

Actions
Move unit instantly to Region 0 exit

Just make sure none of the entrance/exit regions overlap.
 
You don't have to chop it up for it to work. This is another method to do it.

Trigger 1

Events
A Unit enters Region 0 entrance

Actions
turn off trigger 2
Move unit instantly to Region 1 exit
turn on trigger 2

Trigger 2

Events
A Unit enters Region 1 entrance

Actions
turn off trigger 1
Move unit instantly to Region 0 exit
turn off trigger 1
 
[trigger=Teleport]Teleport A
Events
Unit - A unit enters Region 1
Conditions
Actions
Trigger - Turn off Teleport B
Set Point - Center of Region 2
Unit - Move unit instantly to Point
Custom script: call RemoveLocation (udg_Point)
Trigger - Turn on Teleport B
[/trigger]
[trigger=]Teleport B
Events
Unit - A unit enters Region 2
Conditions
Actions
Trigger - Turn off Teleport A
Set Point - Center of Region 1
Unit - Move unit instantly to Point
Custom script: call RemoveLocation (udg_Point)
Trigger - Turn on Teleport A
[/trigger]
 
Status
Not open for further replies.
Top