• 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] Trigger Help

Status
Not open for further replies.
Level 6
Joined
Mar 2, 2013
Messages
127
This is ability create 2 portals, 1 way traveling. Teleports anyone near portal 1 to portal 2. Portal lasts for 10 seconds. When you use the ability the first time, everything works fine. But when you use it again, it creates the portals but doesn't move the units :/ Any ideas?


  • Portal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Descorrer
    • Actions
      • Set Bara_Unit[2] = (Triggering unit)
      • Unit Group - Add Bara_Unit[2] to Bara_Group[1]
      • Unit - Create 1 Portal 1 for (Owner of Bara_Unit[2]) at ((Position of Bara_Unit[2]) offset by 100.00 towards Bar_Ang degrees) facing (Facing of Bara_Unit[2]) degrees
      • Set Bara_Unit[3] = (Last created unit)
      • Set Bar_Point[3] = (Position of Bara_Unit[3])
      • Unit - Add a 10.00 second Generic expiration timer to Bara_Unit[3]
      • Unit - Create 1 Portal 2 for (Owner of Bara_Unit[2]) at (Target point of ability being cast) facing (Facing of Bara_Unit[2]) degrees
      • Set Bara_Unit[4] = (Last created unit)
      • Set Bar_Point[4] = (Position of Bara_Unit[4])
      • Unit - Add a 10.00 second Generic expiration timer to Bara_Unit[4]
      • Set Bara_Real[5] = 50.00
      • Trigger - Turn on Portal time <gen>
  • Portal time
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Bara_Group[1] and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bara_Real[5] Less than or equal to (<=) 0.00
            • Then - Actions
              • Custom script: call DestroyGroup( udg_Bara_Group[1] )
              • Custom script: call RemoveLocation(udg_Bar_Point[3])
              • Custom script: call RemoveLocation(udg_Bar_Point[4])
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • Set Bara_Real[5] = (Bara_Real[5] - 1.00)
              • Unit Group - Pick every unit in (Units within 75.00 of Bar_Point[3] matching (((Unit-type of (Matching unit)) Not equal to (!=) Portal 1) and (((Unit-type of (Matching unit)) Not equal to (!=) Portal 2) and (((Matching unit) belongs to an ally of (Owner of Bara_Unit[2])) Equal to (==) True) and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to Bar_Point[4]
 
Last edited:
Level 7
Joined
Jun 28, 2013
Messages
395
Try not to destroy group, see if it works :3 Replace with remove units from the group. I have a spell that doesn't work if I destroy the group but works if i don't destroy it.... It's weird. :3

(Target point of ability cast) also leaks, store them in variable and remove them after the spell end :3
 
Status
Not open for further replies.
Top