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

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