• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Cleaning Group/Point Array Leaks

Status
Not open for further replies.

sentrywiz

S

sentrywiz

I am making an AI for a map and suddenly all the key mechanics malfunction (presumably because I don't use array variables for the loop triggers) because I don't know how to remove the leaks.

So I need custom scripts for removing leaks like:

temp_loc [Player Number of Owner of Triggering Unit]
temp_group [Player Number of Owner of Triggering Unit]



temp_loc [Player Number of Owner of Picked Unit]
temp_group [Player Number of Owner of Picked Unit]



temp_loc [Integer A]
temp_group [Integer A]


I might also need for Killing / Dying unit but you get the general idea.
 
Player Number of Owner of Triggering Unit
->
GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))

Player Number of Owner of Picked Unit
->
GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit())

You can always convert a GUI trigger to JASS to see the equivalent.
I would not use these long terms in custom script. I would use a temp integer instead. Then it looks like point[udg_int].
 
To remove the leaks:
For unit group: call DestroyGroup(UnitGroup)
For player group: call DestroyForce(PlayerGroup)
For location: call RemoveLocation(Location)
For Special Effects... you can use the standard "Destroy Special Effect" function of GUI.

put "udg_" before the variable name if you made them regulary.


More than that, I don't know.
In IcemanBo's signature is a link to "Things That Leak"
You can check that one out.

(I do not know about terrain deformation and never used it either so...)
 
Player Number of Owner of Triggering Unit
->
GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))

Player Number of Owner of Picked Unit
->
GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit())

You can always convert a GUI trigger to JASS to see the equivalent.
I would not use these long terms in custom script. I would use a temp integer instead. Then it looks like point[udg_int].

Thanks I will use these. I do use temp integer because of convenience and reusability
I can write example " call RemoveLocation ( udg_temp_loc [ udg_temp_int ] ) "
Like that?
 
Status
Not open for further replies.
Back
Top