• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
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
 
Level 13
Joined
Dec 21, 2010
Messages
541
[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