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

[Trigger] Warping trigger help

Status
Not open for further replies.
Level 3
Joined
Aug 24, 2014
Messages
22
  • Portal in
    • Events
      • Unit - A unit enters Gate1 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Gate2 <gen>)
  • Portal out
    • Events
      • Unit - A unit enters Gate2 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Gate1 <gen>)
whenever an unit enters the portal, they will be warping constantly between 2 portals. is there a way to prevent this from happening?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I prefer to turn off second trigger temporally when the first fires. And turn it on again when the unit leaves the region. And vice-versa (Turn off first when second fires temporally)
I don't support waits because they ain't MUI
Better store the entering unit ( Triggering Unit ) in a variable to use it more than once.
Store ( Center of (Any Region)) in a variable , then remove it later using to avoid memory leaks that usually do lag
So long story short, re-create this trigger with better form, I just gave the idea
  • Custom script: call RemoveLocation(udg_"name_of_your_point_variable")
  • Portal in
  • Events
  • Unit - A unit enters Gate1 <gen>
  • Conditions
  • Actions
  • Trigger - Turn off Portal out <gen>
  • Unit - Move (Entering unit) instantly to (Center of Gate2 <gen>)
  • Wait until condition ( (Entering unit) is in (Gate2)) Equal to False )
  • Trigger - Turn on Portal out <gen>
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
  • Portal in
    • Events
      • Unit - A unit enters Gate1 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Gate2 <gen>)
  • Portal out
    • Events
      • Unit - A unit enters Gate2 <gen>
    • Conditions
    • Actions
      • Unit - Move (Entering unit) instantly to (Center of Gate1 <gen>)
whenever an unit enters the portal, they will be warping constantly between 2 portals. is there a way to prevent this from happening?

This should work and no need for more rects. Also never use entering unit use triggering unit. And you should learn to clean up leaks to prevent your map from lagging and becoming unplayable as game progresses.
Look at the things that leak tutorial on the triggers and scripts page. You should also check out my tutorial Things you should know when using triggers / GUI. Link is in my sig.

  • Portal in
    • Events
      • Unit - A unit enters Gate1 <gen>
    • Conditions
    • Actions
      • Set tempPoint = (Center of Gate2 <gen>)
      • Trigger - Turn off Portal out <gen>
      • Unit - Move (Triggering unit) instantly to tempPoint
      • Trigger - Turn on Portal out <gen>
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
  • Portal out
    • Events
      • Unit - A unit enters Gate2 <gen>
    • Conditions
    • Actions
      • Set tempPoint = (Center of Gate1 <gen>)
      • Trigger - Turn off Portal in <gen>
      • Unit - Move (Triggering unit) instantly to tempPoint
      • Trigger - Turn on Portal in <gen>
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
 
I prefer to turn off second trigger temporally when the first fires. And turn it on again when the unit leaves the region. And vice-versa (Turn off first when second fires temporally)
I don't support waits because they ain't MUI
Better store the entering unit ( Triggering Unit ) in a variable to use it more than once.
Store ( Center of (Any Region)) in a variable , then remove it later using to avoid memory leaks that usually do lag
So long story short, re-create this trigger with better form, I just gave the idea
  • Custom script: call RemoveLocation(udg_"name_of_your_point_variable")
  • Portal in
  • Events
  • Unit - A unit enters Gate1 <gen>
  • Conditions
  • Actions
  • Trigger - Turn off Portal out <gen>
  • Unit - Move (Entering unit) instantly to (Center of Gate2 <gen>)
  • Wait until condition ( (Entering unit) is in (Gate2)) Equal to False )
  • Trigger - Turn on Portal out <gen>

The problem with this is that no other units will be able to use the gate until the last traveling unit has exited the arrival zone. This can be really annoying.
 
Status
Not open for further replies.
Top