Point Leak using Array

MateoSoetsu

New Member
Reaction score
9
Trigger:
  • TaKG4
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in (Playable map area) matching ((Level of Throw a Kiss Hidden for (Matching unit)) Greater than 0))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPointArray[(Custom value of (Picked unit))] = (Position of (Picked unit))
          • Unit - Order (Picked unit) to Human Priest - Inner Fire (Random unit from (Units within 600.00 of TempPointArray[(Custom value of (Picked unit))] matching (((Matching unit) has buff Throw a Kiss (gremlin buff)) Equal to False)))
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: call RemoveLocation(udg_TempPointArray)


I am receiving and error on the last line trying to destroy the point array. Can someone tell me how to fix it. Please don't point me in the direction of a tutorial, I have it bookmarked and it isn't helping me in this situation.

The trigger is used to force units to auto-cast Inner Fire on enemies.

The trigger works without trying to remove the leak but errors when I try to remove it.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Trigger:
  • TaKG4
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in (Playable map area) matching ((Level of Throw a Kiss Hidden for (Matching unit)) Greater than 0))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPointArray[(Custom value of (Picked unit))] = (Position of (Picked unit))
          • Unit - Order (Picked unit) to Human Priest - Inner Fire (Random unit from (Units within 600.00 of TempPointArray[(Custom value of (Picked unit))] matching (((Matching unit) has buff Throw a Kiss (gremlin buff)) Equal to False)))
          • Custom script: call RemoveLocation(udg_TempPointArray[GetUnitUserData(GetEnumUnit())])
      • Custom script: call DestroyGroup(udg_TempUnitGroup)


[ljass]GetUnitUserData(unit)[/ljass] is JASS for a unit's custom value, and [ljass]GetEnumUnit()[/ljass] is the picked unit. Also, it needs to be inside the unit group loop. And also, your "units within 600.00..." leaks a unit group, as the tutorial you have bookmarked should explain.

BTW, since you're using it temporarily, why not just use TempPointArray[0]?
 

MateoSoetsu

New Member
Reaction score
9
Trigger:
  • TaKG4
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in (Playable map area) matching ((Level of Throw a Kiss Hidden for (Matching unit)) Greater than 0))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPointArray[(Custom value of (Picked unit))] = (Position of (Picked unit))
          • Set TempUnitGroup2 = (Units within 600.00 of TempPointArray[(Custom value of (Picked unit))] matching (((Matching unit) has buff Throw a Kiss (gremlin buff)) Equal to False))
          • Unit - Order (Picked unit) to Human Priest - Inner Fire (Random unit from TempUnitGroup2)
          • Custom script: call RemoveLocation(udg_TempPointArray[GetUnitUserData(GetEnumUnit())])
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: call DestroyGroup(udg_TempUnitGroup2)


Does that fix it?
 

vypur85

Hibernate
Reaction score
803
Code:
TaKG4
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempUnitGroup = (Units in (Playable map area) matching ((Level of Throw a Kiss Hidden  for (Matching unit)) Greater than 0))
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            Loop - Actions
                Set TempPointArray[(Custom value of (Picked unit))] = (Position of (Picked unit))
                Set TempUnitGroup2 = (Units within 600.00 of TempPointArray[(Custom value of (Picked unit))] matching (((Matching unit) has buff Throw a Kiss (gremlin buff)) Equal to False))
                Unit - Order (Picked unit) to Human Priest - Inner Fire (Random unit from TempUnitGroup2)
                Custom script:   call RemoveLocation(udg_TempPointArray[GetUnitUserData(GetEnumUnit())])
                [B]Custom script:   call DestroyGroup(udg_TempUnitGroup2)[/B]
        Custom script:   call DestroyGroup(udg_TempUnitGroup)

Slight fix.

Edit:
For future reference, go to 'Edit > Convert to text' to see what is the correct custom script. Remember that once converted, it cannot be reverted back. You can undo though. To be safe, keep another copy of the trigger before converting.
 

MateoSoetsu

New Member
Reaction score
9
It allowed me to enable the trigger again as well as save my map.
+rep weep, thx for confirming Darthfett.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top