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

Waygate Infinite Loop Crash

Status
Not open for further replies.
Level 6
Joined
Feb 6, 2008
Messages
166
In my map, I'm trying to make a system of waygates where you can cross back and forth, except so far, I'm facing nothing but infinite-loop crashes.

I'm using nothing more than a building with the Waygate ability and a bunch of regions.

At first, I tried placing the destination-regions on top of the destination waygates. Instant obvious infinite-loop crash.

Then I tried reducing the cast-range of Waygate, while moving the regions slightly off to the side. Still crashed.

I'm not sure what to do. The required goal is to have pairs of waygates that can allow travel back and forth. Ideally, I can keep the destination-region as close to the destination way-gate as possible so that it makes more sense.

I'm completely new to using waygates, so I'm not really sure what I'm doing.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Use this kind of triggers:

  • Untitled Trigger 015
    • Events
      • Unit - A unit enters Region 008 <gen>
    • Conditions
      • ((Triggering unit) is in Delayed_Move) Equal to False
    • Actions
      • Set p1 = (Center of Region 009 <gen>)
      • Unit - Move (Triggering unit) instantly to p1
      • Unit Group - Add (Triggering unit) to Delayed_Move
      • Custom script: call RemoveLocation(udg_p1)
      • Wait 0.00 seconds
      • Unit Group - Remove (Triggering unit) from Delayed_Move
No more infinite loop.
 
Level 6
Joined
Feb 6, 2008
Messages
166
Ah, thanks again, Maker. I was originally planning to warp when the player issued a move order right-clicking the waygate unit, but I think this might actually be more effective.

I have a question though. What is the "Wait 0.00 seconds" for? Do I modify this value to adjust the delay between the next time the Hero can enter a waygate? If so, will a value too low result in an infinite loop as well?

By the way, I haven't dropped my Altered Melee map - it's just on hold while I brainstorm ideas.
 
I have a question though. What is the "Wait 0.00 seconds" for? Do I modify this value to adjust the delay between the next time the Hero can enter a waygate? If so, will a value too low result in an infinite loop as well?

Nah, it is preventing the event from repeating itself. When the unit moves to the other waygate, it will fire that waygate's event, and then it will move it back, which will fire this trigger's event, and so on until it crashes. That's why a unit group is used.

There is a condition for whether or not the entering unit is in the group. There is an action to add the entering unit to the group, and one to remove. Once it is added, the unit is moved. Now, if it wasn't in the group, the next trigger would fire and move him back, but because it has the condition to check that the unit is in the group, it won't fire. Then, after a small wait (0.00 will wait anywhere from about 0.09735-0.250 seconds) it will remove it, so the waygate will still work for him.

A little confusing, it is just to prevent the unit from swapping back and forth, so only one trigger is run upon reaching a waygate. :)
 
Level 6
Joined
Feb 6, 2008
Messages
166
Nah, it is preventing the event from repeating itself. When the unit moves to the other waygate, it will fire that waygate's event, and then it will move it back, which will fire this trigger's event, and so on until it crashes. That's why a unit group is used.

There is a condition for whether or not the entering unit is in the group. There is an action to add the entering unit to the group, and one to remove. Once it is added, the unit is moved. Now, if it wasn't in the group, the next trigger would fire and move him back, but because it has the condition to check that the unit is in the group, it won't fire. Then, after a small wait (0.00 will wait anywhere from about 0.09735-0.250 seconds) it will remove it, so the waygate will still work for him.

A little confusing, it is just to prevent the unit from swapping back and forth, so only one trigger is run upon reaching a waygate. :)

Thanks for the explanation. I found out that the waygate region does not trigger again until I leave the region and re-enter, which as I understand is because of the wait action (regardless of the duration).
 
Status
Not open for further replies.
Top