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

Lag in GUI World Editor when opening Unit Field

Level 7
Joined
Mar 16, 2014
Messages
169
I am using the most current version of world editor, 1.36B.

I have many units preplaced on the map and reference them in triggers, as well as many unit variables. I code in GUI.

Whenever I click a unit within GUI to change it, there is now an immense amount of lag to open the unit field, nearly a minute, every time I want to change a unit. Is there anything I can do about this assuming I do want to reference all of these units and that I do want to continue using GUI?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You could get around this by using a generic unit variable in place of the specific generated unit variables (like Archmage 002 <gen> or whatever). Then you just assign this variable to the appropriate unit before using it. How does this save you time? You can copy/paste the assignment line from any trigger where you have referred to that unit before so you never have to enter the unit select menu.
  • Set FIX_VAR = (Castle 040 <gen>)
  • Unit - Kill FIX_VAR
  • Set FIX_VAR = (Scout Tower 100 <gen>)
  • If (All conditions are true) then…
    • If - Conditions
      • (FIX_VAR is Alive) equal to True
    • Then - Actions
      • Unit - Change ownership of FIX_VAR to Neutral Passive and change color
    • Else - Actions
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
It occurs to me that this solution can result in some unintended behavior. If in interacting with the unit variable you cause another trigger to fire that would assign the variable to something else, and then still have additional actions for the first trigger, the variable will have the ‘wrong’ value for the remainder of the first trigger.

Just keep that in mind when using this solution. You could add a second variable or shadow the variable locally in some cases to avoid this.
 
Top