• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Will "unit"'s variable leaking?

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
udg_Temp_unit = unit

trigger 1
set Temp_unit = Triggering Unit
- then do some action -

should is clear the Temp_unit like:
"Temp_unit = No unit "??


assuming i have 100 unit in a unit variable with array
like :
for loop integer A 1 to 100
set Temp_unit[integer A] = random unit in unit group

will this have a huge leak??? because i'm set the variable into many of unit.
 
Level 8
Joined
Dec 8, 2007
Messages
312
is there a wait command between your action?
If you don't plan to use wait you can make a TEMP_GROUP variable and use
pick random N units from OTHER_GROUP
do all action to picked unit and remove both unit groups.
 
Level 8
Joined
Dec 8, 2007
Messages
312
you mean like this?
action with 100 units
wait
action with another 100 unit
wait
... so on

Then you can still do the trigger with 2 groups
Make ALL_UNITS group and TEMP_UNITS group
in ALL_UNITS place all possible units that can be later placed in Temp group.
Pick 100 random units from ALL_UNITS and place them in TEMP_UNITS. then do you actions. destroy the groups before wait action.
After the wait pick another 100 units from ALL to TEMP and do action then destroy the temp group.
ALL_UNITS group must be destroyed only at the end of the trigger
 
Status
Not open for further replies.
Top