• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

custom value mui with wait

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2012
Messages
33
1) just wondering how to create mui custom value with wait? so if unit attacking, then wait 2 second and create special effect at unit, like..

2) and i want to know if i only remove unit in group/clear group without custom script (call DestroyGroup) its leak?

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (temp Less than 1000) then do (Set temp = (temp + 1)) else do (Set temp = 0)
      • Set UnitAttacking[temp] = (Attacking unit)
      • Unit - Set the custom value of UnitAttacking[temp] to temp
      • Unit Group - Add UnitAttacking[temp] to Group1
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in Group1 and do (Actions)
        • Loop - Actions
          • Set Unit_CV = (Custom value of (Picked unit))
          • Special Effect - Create a special effect at (Position of UnitAttacking[Unit_CV]) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Remove all units from Group1
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You have to destroy the group as the empty group still exists.
You can do it with a "Custom script: set bj_wantDestroyGroup = true" just before you loop through the group or "Custom script: call DestroyGroup(group whichGroup)" on a variable that is the unit group.

btw use "Wait (seconds) of game time"
 
I would try without shadowing abuse. Try to refer again to attacking unit after the wait. (http://www.hiveworkshop.com/forums/lab-715/event-response-myths-253665/#post2543973)

Are you sure you want the effect to be created for all units in the group?
It doesn't look like much sense to me, because of the way it's handled at the moment with effects.
Btw, you use "remove all units from group" inside your enumeration. Only do it once.
And if you want the effect only for the attcking unit of trigger, then no enumeration is needed at all.

And no, in that trigger you do not leak potentially. You never create unit groups. You only add/remove units and make an enumeration.
The enumeration function "PickEveryUnit..XYZ." does not leak itself. If the " ...XYZ" is an operation to create a unit group, then yes, it might leak.
AllUnitsOwnedByPlayer, AllUnitsInMap, AllUnitsMatchingConditions, ... -> these operations will create new unit groups.
But you just enumerate through an already existing group. That's okay.
 
Status
Not open for further replies.
Top