• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Custom Script help needed

Status
Not open for further replies.
I would guess that it might look something like this
  • Custom Script - call RemoveUnit(udg_Unit[GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))])
Assuming you were talking about getting rid units assigned to a unit array and not destroying the entire unit array itself, that should work.
 
You can't destroy a unit-array. You wouldn't need to anyways, since an array is not an object that will cause a memory leak. The only value that will cause a memory leak is the unit itself, which can be "destroyed" as Darkness-4ever has stated:

Darkness-4ever said:
  • Custom Script - call RemoveUnit(udg_Unit[GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))])
 
Garfield1337 said:
since i found another way to solve my problem.

The only reason I can think of as to why you would want to "destroy" them all at map initialization is so that you can distinguish between indexes that have and have not been used. In such a case, you can check if a unit variable is equal to "No unit" in which case it has not.

  • Melee Initialization
    • Events
    • Conditions
      • UnitArray[4] Equal to No unit
    • Actions
 
Status
Not open for further replies.
Back
Top