• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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