• 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] Why is this lagging?

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
This trigger I made is severely lagging and I can't tell why. Can anyone help me out? The trigger works as intended but it just lags to the point where the game is unplayable.

  • polymorph cloud init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Polymorph Cloud
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Unit - Create 1 Polymorph Cloud for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set PolymorphCloud = (Last created unit)
      • Trigger - Turn on polymorph cloud polymorph <gen>
      • Wait 15.00 seconds
      • Trigger - Turn off polymorph cloud polymorph <gen>
      • Unit - Kill PolymorphCloud
      • Custom script: set udg_PolymorphCloud = null
  • polymorph cloud polymorph
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of PolymorphCloud)
      • Set TempUnitGroup = (Units within 275.00 of TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff polymorph buff give ) Equal to False
            • Then - Actions
              • Set TempPoint = (Position of (Picked unit))
              • Unit - Create 1 dummy unit for (Owner of PolymorphCloud) at TempPoint facing Default building facing degrees
              • Unit - Add Polymorph (Polymorph Cloud) to (Last created unit)
              • Unit - Add polymorph buff give (Neutral Hostile) to (Last created unit)
              • Unit - Set level of Polymorph (Polymorph Cloud) for (Last created unit) to (Level of Polymorph Cloud for (Triggering unit))
              • Unit - Set level of polymorph buff give (Neutral Hostile) for (Last created unit) to (Level of Polymorph Cloud for (Triggering unit))
              • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
              • Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Picked unit)
              • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup)

P.S. I do NOT need this to be MUI
 
Level 15
Joined
Sep 3, 2006
Messages
1,738
You should just use 2 different variables for your points instead of using the same one and clearing it every time. Actually, you can just clear all of the variables in the first trigger after the Wait.

I think that may be the problem. More specifically, the re-use of TempPoint
 
Level 10
Joined
Apr 13, 2005
Messages
630
my suggestion based off fuegos comments is make an array for the point. set the first trigger to the first array and remove it in the first trigger. then do the same for the next trigger. another thing
  • Custom script: set udg_PolymorphCloud = null
is a big waste. Its not jass so why worry about nulling a unit?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
In the second trigger: There is no (Triggering Unit), but you still use it for the lvl of polycloud,,
Set the triggering unit in a variable and use That..
But i dont know why it laggs =S
 
Level 7
Joined
Jul 12, 2008
Messages
295
I think the problem is with your second trigger. It is turned to on try to make it not instantly on... + that wait will make the trigger malfunction u can't just wait 15 seconds.. Myb another hero will use a spell to hide your hero so that wait won't count. I think u need to start your trigger again at begging. Use Wait until condition. It is more efficient. And set your units into variables myb that is causing little lag too
 
Status
Not open for further replies.
Top