• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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>
 
  • 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