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

How to destroy unit group with index (GUI)

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
to anti memory leak, i destroy the unit group variable by
Custom script: call DestroyGroup (udg_Temp_UnitGroup1)

But how if there got index like
  • Unit Group - Add (Triggering unit) to DU_SelectedGroup[(Player number of (Triggering player))]
  • Unit Group - Pick every unit in DU_SelectedGroup[(Player number of (Triggering player))] and do (Actions)
    • Loop - Actions
      • Set DU_SelectedUnit[(Player number of (Triggering player))] = (Picked unit)
I have try this trigger but can't work?
  • Unit Group - Remove all units from DU_SelectedGroup[(Player number of (Triggering player))]
  • Custom script: call DestroyGroup (udg_DU_SelectedUnit[GetConvertedPlayerId(GetTriggerPlayer())])
 
Level 11
Joined
Oct 20, 2007
Messages
342
Finally i found it :xxd::xxd::xxd::xxd:
A stupid miss take :xxd::xxd::xxd:

Wrong:
Custom script: call DestroyGroup (udg_DU_SelectedUnit[GetConvertedPlayerId(GetTriggerPlayer())])

Correct:
Custom script: call DestroyGroup (udg_DU_SelectedGroup[GetConvertedPlayerId(GetTriggerPlayer())])

Thx a lot
:xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd:
 
Status
Not open for further replies.
Top