• 🏆 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!

Question about MUI by locals.....

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
Is this trigger with locals and multiple waits are still MUI?



  • My Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: local unit u
      • Set Dying_Unit = (Dying unit)
      • Custom script: set u = udg_Dying_Unit
      • Set Dying_Unit = No unit
      • Wait 5.00 seconds
      • Custom script: set udg_Dying_Unit = u
      • Custom script: set u = null
      • Game - Display to (All players) the text ((Name of (Dying_Unit))+ has died.)
      • Custom script: set u = udg_Dying_Unit
      • Set Dying_Unit = No unit
      • Wait 3.00 seconds
      • Custom script: set udg_Dying_Unit = u
      • Custom script: set u = null
      • Game - Display to (All players) the text ((Name of (Dying_Unit))+ is dead of the past 8 seconds.)
      • Set Dying_Unit = No unit
 
Level 11
Joined
Feb 14, 2009
Messages
884
What you're doing there is changing the variable of dying unit to local and global back and forth. It's definitely not MUI or efficient and I don't even know if it works. What are you trying to achieve with this trigger? Maybe if you told us, we could help you.
 
Level 11
Joined
Feb 14, 2009
Messages
884
I'm not talking about hashtables, I'm talking about variable management. Why do you even use Dying_unit, when you can save your triggering unit directly to u? Plus, you must not nullify variables until the end of the trigger, or you might cause problems.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • My Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Wait 5.00 seconds
      • Custom script: set udg_Dying_Unit = u
      • Game - Display to (All players) the text ((Name of (Dying_Unit))+ has died.)
      • Wait 3.00 seconds
      • Custom script: set udg_Dying_Unit = u
      • Custom script: set u = null
      • Game - Display to (All players) the text ((Name of (Dying_Unit))+ is dead of the past 8 seconds.)
Do it like this, if you want to use the GUI text display.
 
Level 9
Joined
May 27, 2006
Messages
498
@dardas
Notice the "_", it's that global variable, not event response :)

@topic
For this certain purpose (Casting unit, Dying unit [not Killing unit], Attacked unit [not Attacking unit], etc), just use Triggering Unit, it's always MUI, no matter what kinds of actions you use in your trigger (mostly)
Tho if you're asking whether it's possible to create MUI triggers (with waits) only using locals, the answer is no, you need a hashtable (or other method to store handle id, tho hashtables are most efficient afaik) or indexing system to do that.
 
Status
Not open for further replies.
Top