CS for removing this leak?

Monictor

New Member
Reaction score
0
In my map I have a lot of arrays that are set and referenced to using the function Player number of (owner of (unit)). This trigger is likely the one that will create the most leaks in my game, but I do not know how to remove the leaks from it. What it does is when a unit uses the move ability on a target beacon, and conditions are satisfied, the beacon will be removed, the unit will move to the spot, and a beacon will be created where the unit once was. A person on this forum gave me the custom script to do the height check earlier and I don't think I need to remove leaks for it, correct me if I am wrong though.

Here it is. Help appreciated and I can give +rep if ya let me know how.

Trigger:
  • Movement Trig
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Movement
          • Or - Any (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Move Item (3)) Equal to True
              • ((Triggering unit) has an item of type Move Item (4)) Equal to True
              • ((Triggering unit) has an item of type Move Item (5)) Equal to True
              • ((Triggering unit) has an item of type Move Item (6)) Equal to True
    • Actions
      • Set pointFrom[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Set pointTo[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
      • Wait 0.10 seconds
      • Set tempPoint = (Position of (Triggering unit))
      • Custom script: set udg_Zpoint[1] = GetLocationZ(udg_tempPoint)
      • Set tempPoint = (Position of (Target unit of ability being cast))
      • Custom script: set udg_Zpoint[2] = GetLocationZ(udg_tempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Abs((Zpoint[1] - Zpoint[2]))) Less than or equal to 110.00
        • Then - Actions
          • Unit - Remove (Target unit of ability being cast) from the game
          • Item - Set life of (Item carried by (Casting unit) of type Move Item (3)) to ((Current life of (Item carried by (Casting unit) of type Move Item (3))) - 1.00)
          • Item - Set life of (Item carried by (Casting unit) of type Move Item (4)) to ((Current life of (Item carried by (Casting unit) of type Move Item (4))) - 1.00)
          • Item - Set life of (Item carried by (Casting unit) of type Move Item (5)) to ((Current life of (Item carried by (Casting unit) of type Move Item (5))) - 1.00)
          • Item - Set life of (Item carried by (Casting unit) of type Move Item (6)) to ((Current life of (Item carried by (Casting unit) of type Move Item (6))) - 1.00)
          • Item - Set charges remaining in (Item carried by (Casting unit) of type Move Item (3)) to ((Charges remaining in (Item carried by (Casting unit) of type Move Item (3))) - 1)
          • Item - Set charges remaining in (Item carried by (Casting unit) of type Move Item (4)) to ((Charges remaining in (Item carried by (Casting unit) of type Move Item (4))) - 1)
          • Item - Set charges remaining in (Item carried by (Casting unit) of type Move Item (5)) to ((Charges remaining in (Item carried by (Casting unit) of type Move Item (5))) - 1)
          • Item - Set charges remaining in (Item carried by (Casting unit) of type Move Item (6)) to ((Charges remaining in (Item carried by (Casting unit) of type Move Item (6))) - 1)
          • Unit - Make (Casting unit) face (Target unit of ability being cast) over 0.00 seconds
          • Wait 0.05 seconds
          • Unit - Move (Triggering unit) instantly to pointTo[(Player number of (Owner of (Triggering unit)))]
          • If ((Battleground ONE <gen> contains (Triggering unit)) Equal to True) then do (Unit - Create 1 Positioner Purple for Player 12 (Brown) at pointFrom[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees) else do (Do nothing)
          • If ((Battleground TWO <gen> contains (Triggering unit)) Equal to True) then do (Unit - Create 1 Positioner Green for Player 12 (Brown) at pointFrom[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees) else do (Do nothing)
          • If ((Battleground THREE <gen> contains (Triggering unit)) Equal to True) then do (Unit - Create 1 Positioner Green for Player 12 (Brown) at pointFrom[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees) else do (Do nothing)
        • Else - Actions
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) the text: The height differen...
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Not 100% sure but call RemoveLocation(udg_bla[GetPlayerNumber(GetTriggerUnit)]
 

Komaqtion

You can change this now in User CP.
Reaction score
469
This is JASS for (Player number of (Owner of (Triggering unit))):


:D

So removing those points would look like this:
Trigger:
  • Custom script: call RemoveLocation( udg_pointFrom[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] )
 

Lightstalker

New Member
Reaction score
55
This is JASS for (Player number of (Owner of (Triggering unit))):


:D

So removing those points would look like this:
Trigger:
  • Custom script: call RemoveLocation( udg_pointFrom[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] )

Wouldn't he have to use GetConvertedPlayerId instead of PlayerId since GUI's players ids range from 1-12 and not 0-11 like in JASS?
 

Monictor

New Member
Reaction score
0
Lightstalker,

Yeah, it does use the GUI player number references.

So far I put in Komaqtion's text. I need confirmation of Lightstalker's point since I can't tell if it's working or not.
 
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