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

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].
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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...)
 

sentrywiz

S

sentrywiz

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