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

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