• 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] leak

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Put this instead in the loop

Set Point[0] = position of Attack[Integer[A]]
Set Point[1] = Point[1] offset by 20 towards facing of Attack[Integer[A]]
Move Attack[Integer[A]] instantly to Point[2]
Custom Script: call RemoveLocation(udg_Point[0])
Custom Script: call RemoveLocation(udg_Point[1])
 
Level 3
Joined
Dec 18, 2007
Messages
43
Try to use this function
Put This in the beggining of the map.
JASS:
function moveunit takes unit u, real facing returns nothing
    local real X = GetUnitX(u)+Cos(facing*0.0174)*20
    local real Y = GetUnitY(u)+Sin(facing*0.0174)*20
    call SetUnitPosition(u, X, Y)
    call SetUnitFacing(u, facing)
endfunction
Then put in your trigger this action
  • Custom Script: call moveunit(udg_Attack[GetForLoopIndexA()],GetUnitFacing(udg_Attack[GetForLoopIndexA()])
 
well i would have to post 3 triggers, I KNOW it leaks, i bet. but it doesnt lag. at least i think. It is a lame MUI technique i know...

  • Gyrocopter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack Gyrocopter
    • Actions
      • Unit - Create 1 Gyrocopter attack1 for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees) facing ((Facing of (Triggering unit)) + (Random real number between -15.00 and 15.00)) degrees
      • Unit Group - Add (Last created unit) to Attack1
      • Set NumberG = (NumberG + 1)
      • Set AttackG[NumberG] = (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NumberG Greater than or equal to 15
        • Then - Actions
          • Set NumberG = 0
        • Else - Actions
  • Gyrocopter atk1
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Attack1 and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 25.00 towards (Facing of (Picked unit)) degrees)
      • For each (Integer A) from 0 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Distance between (Position of AttackG[(Integer A)]) and (Position of (Matching unit))) Less than or equal to 50.00) and ((Owner of (Matching unit)) Not equal to (Owner of AttackG[(Integer A)])))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of AttackG[(Integer A)]) and (Position of (Picked unit))) Less than or equal to 50.00
                • Then - Actions
                  • Unit - Kill AttackG[(Integer A)]
                • Else - Actions
  • Remove group
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Gyrocopter attack1
        • Then - Actions
          • Unit Group - Remove (Triggering unit) from Attack1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to BatRider attack1
            • Then - Actions
              • Unit Group - Remove (Triggering unit) from Attack2
            • Else - Actions
 
ok thanks, i redid some things and now it doesnt lag!

before it actually did.. alot!

  • Gyrocopter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack Gyrocopter
    • Actions
      • Set Attackpos1 = (Position of (Triggering unit))
      • Unit - Create 1 Gyrocopter attack1 for (Owner of (Triggering unit)) at (Attackpos1 offset by 100.00 towards (Facing of (Triggering unit)) degrees) facing ((Facing of (Triggering unit)) + (Random real number between -15.00 and 15.00)) degrees
      • Custom script: call RemoveLocation(udg_Attackpos1)
      • Unit Group - Add (Last created unit) to Attack1
      • Set NumberG = (NumberG + 1)
      • Set AttackG[NumberG] = (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NumberG Greater than or equal to 15
        • Then - Actions
          • Set NumberG = 0
        • Else - Actions
  • Gyrocopter atk1
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (Number of units in Attack1) Greater than or equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Attack1) Greater than or equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in Attack1 and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 25.00 towards (Facing of (Picked unit)) degrees)
          • For each (Integer A) from 0 to 15, do (Actions)
            • Loop - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Distance between (Position of AttackG[(Integer A)]) and (Position of (Matching unit))) Less than or equal to 50.00) and ((Owner of (Matching unit)) Not equal to (Owner of AttackG[(Integer A)])))) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between (Position of AttackG[(Integer A)]) and (Position of (Picked unit))) Less than or equal to 50.00
                    • Then - Actions
                      • Unit - Kill AttackG[(Integer A)]
                    • Else - Actions
        • Else - Actions
  • Remove group
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Gyrocopter attack1
        • Then - Actions
          • Unit Group - Remove (Triggering unit) from Attack1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to BatRider attack1
            • Then - Actions
              • Unit Group - Remove (Triggering unit) from Attack2
            • Else - Actions
 
Status
Not open for further replies.
Top