Leaks/MUI problems

FootysMaXeD

New Member
Reaction score
0
So i'm back again. I'm trying to fix the leaks in my triggers and fix the MUI problem. I've started learning JASS (Jass Intro), but I need help here please.

These are two system triggers I have in my map. They determine what happens to a player when his base is killed, or when he leaves. They both include a Gold Split system, which from initial testing is working nicely. I am not sure what Local variable(s) to use and I also don't know how to destroy a Player Variable (not Player Group).

Trigger:
  • Base Killed
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Initiate (Footmen)
          • (Unit-type of (Dying unit)) Equal to Alliance Rank 1 (Riflemen)
          • (Unit-type of (Dying unit)) Equal to Alliance Rank 2 (Captain)
          • (Unit-type of (Dying unit)) Equal to Alliance Rank 3 (Spell Breakers)
          • (Unit-type of (Dying unit)) Equal to Alliance Rank 4 (Knights)
          • (Unit-type of (Dying unit)) Equal to Horde Rank 1 (Spirit Walkers)
          • (Unit-type of (Dying unit)) Equal to Horde Rank 2 (Raiders)
          • (Unit-type of (Dying unit)) Equal to Horde Rank 3 (Warlock + Grunt)
          • (Unit-type of (Dying unit)) Equal to Horde Rank 4 (Tauren)
          • (Unit-type of (Dying unit)) Equal to Scourge Rank 1
          • (Unit-type of (Dying unit)) Equal to Scourge Rank 2
          • (Unit-type of (Dying unit)) Equal to Scourge Rank 3
          • (Unit-type of (Dying unit)) Equal to Scourge Rank 4
          • (Unit-type of (Dying unit)) Equal to Night Elf Rank 1 (Treants)
          • (Unit-type of (Dying unit)) Equal to Night Elf Rank 2 (Scouts)
          • (Unit-type of (Dying unit)) Equal to Night Elf Rank 3 (Huntresses)
          • (Unit-type of (Dying unit)) Equal to Night Elf Rank 4 (Dryads)
    • Actions
      • Set TempPoint1 = (Position of (Dying unit))
      • Set Temp_Player = (Owner of (Dying unit))
      • Player Group - Remove Temp_Player from (All players)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Player is in ForceOne) Equal to True
        • Then - Actions
          • Player Group - Remove Temp_Player from ForceOne
          • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceOne))
          • Player Group - Pick every player in ForceOne and do (Player - Add Temp_Integer to (Picked player) Current gold)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player is in ForceTwo) Equal to True
            • Then - Actions
              • Player Group - Remove Temp_Player from ForceTwo
              • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceTwo))
              • Player Group - Pick every player in ForceTwo and do (Player - Add Temp_Integer to (Picked player) Current gold)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Player is in ForceThree) Equal to True
                • Then - Actions
                  • Player Group - Remove Temp_Player from ForceThree
                  • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceThree))
                  • Player Group - Pick every player in ForceThree and do (Player - Add Temp_Integer to (Picked player) Current gold)
                • Else - Actions
                  • Player Group - Remove Temp_Player from ForceFour
                  • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceFour))
                  • Player Group - Pick every player in ForceFour and do (Player - Add Temp_Integer to (Picked player) Current gold)
      • Set PlayerDefeated[(Player number of Temp_Player)] = (PlayerDefeated[(Player number of (Triggering player))] + 1)
      • Player - Set Temp_Player Current gold to 0
      • Game - Display to (All players) for 15.00 seconds the text: (PlayerNames[(Player number of Temp_Player)] + has been defeated!)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Player number of Temp_Player) + 1) to (PlayerNames[(Player number of Temp_Player)] + (Killed))
      • Set TempGroup1 = (Units owned by Temp_Player)
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Wait 3.00 seconds
          • Unit - Remove (Picked unit) from the game
          • Wait 3.00 seconds
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup (udg_TempGroup1)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Region centered at TempPoint1 with size (600.00, 600.00))
          • Wait 10.00 seconds
          • Visibility - Disable (Last created visibility modifier)
      • Custom script: call RemoveLocation (udg_TempPoint1)


Trigger:
  • Player Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
      • Player - Player 11 (Dark Green) leaves the game
      • Player - Player 12 (Brown) leaves the game
    • Conditions
    • Actions
      • Set Temp_Player = (Triggering player)
      • Game - Display to (All players) the text: (PlayerNames[(Player number of Temp_Player)] + has left the game!)
      • Player Group - Remove Temp_Player from (All players)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Player is in ForceOne) Equal to True
        • Then - Actions
          • Player Group - Remove Temp_Player from ForceOne
          • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceOne))
          • Player Group - Pick every player in ForceOne and do (Player - Add Temp_Integer to (Picked player) Current gold)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Temp_Player is in ForceTwo) Equal to True
            • Then - Actions
              • Player Group - Remove Temp_Player from ForceTwo
              • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceTwo))
              • Player Group - Pick every player in ForceTwo and do (Player - Add Temp_Integer to (Picked player) Current gold)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Temp_Player is in ForceThree) Equal to True
                • Then - Actions
                  • Player Group - Remove Temp_Player from ForceThree
                  • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceThree))
                  • Player Group - Pick every player in ForceThree and do (Player - Add Temp_Integer to (Picked player) Current gold)
                • Else - Actions
                  • Player Group - Remove Temp_Player from ForceFour
                  • Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceFour))
                  • Player Group - Pick every player in ForceFour and do (Player - Add Temp_Integer to (Picked player) Current gold)
      • Set PlayerDefeated[(Player number of Temp_Player)] = (PlayerDefeated[(Player number of (Triggering player))] + 2)
      • Set TempGroup1 = (Units owned by Temp_Player)
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Player number of (Triggering player)) + 1) to (PlayerNames[(Player number of (Triggering player))] + (Left))
      • Custom script: call DestroyGroup (udg_TempGroup1)


Help appreciated. :)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
there arent any leaks in your trigger and nothing which cannot be MUI cause it doesnt have anything to do with units.
this is the only part i dont understand:
Trigger:
  • Unit Group - Pick every unit in TempGroup1 and do (Actions)
    • Loop - Actions
      • Unit - Remove (Picked unit) from the game
      • Wait 3.00 seconds
      • Unit - Remove (Picked unit) from the game
      • Wait 3.00 seconds
      • Unit - Remove (Picked unit) from the game

why do you need to do that thrice???
 

FootysMaXeD

New Member
Reaction score
0
Ok, maybe i'll restate my problem. I put up the entire triggers just to double check if there is anything wrong or any leaks. There is one part of the trigger that is not functioning, because the variable TempGroup1, TempPoint1, and the visibility modifier, are being overwritten anytime another player is killed within a couple seconds of eachother.

The point of the wait's between multiple removals of units is to make sure if a hero is dead and has reincarnation when his base dies, that he is removed upon revival.

It is here that is the problem:
Trigger:
  • Set TempGroup1 = (Units owned by Temp_Player)
    • Unit Group - Pick every unit in TempGroup1 and do (Actions)
    • Loop - Actions
    • Unit - Remove (Picked unit) from the game
    • Wait 3.00 seconds
    • Unit - Remove (Picked unit) from the game
    • Wait 3.00 seconds
    • Unit - Remove (Picked unit) from the game
    • Custom script: call DestroyGroup (udg_TempGroup1)
    • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
    • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Region centered at TempPoint1 with size (600.00, 600.00))
    • Wait 10.00 seconds
    • Visibility - Disable (Last created visibility modifier)
    • Custom script: call RemoveLocation (udg_TempPoint1)


Also, can anyone tell me how can i remove the leak from the Player Variable (Temp_Player)?
 

Jedi

New Member
Reaction score
63
Trigger:
  • Set VisMod = (Last created visibility modifier)
    • Visibility - Destroy VisMod


Edit:hmm, maybe you don't need to de that.
 

canons200

New Member
Reaction score
50
if you use wait like this, it can't be MUI
Trigger:
  • Unit Group - Pick every unit in TempGroup1 and do (Actions)
    • Loop - Actions
    • Unit - Remove (Picked unit) from the game
    • Wait 3.00 seconds
    • Unit - Remove (Picked unit) from the game
    • Wait 3.00 seconds
    • Unit - Remove (Picked unit) from the game
add in another unitgroup and use timer.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
its nonsense, the unit is getting removed regardless whether it got reincarnation or not or whether its dead or not. remove the waits.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
It actually doesnt get removed. This is a problem is most footmen maps.
 

tooltiperror

Super Moderator
Reaction score
231
The other day, Blackrose told me remove may actually leak.
 

Ayanami

칼리
Reaction score
288
I can't recall who told me but, I heard removing a unit from a unit group directly will cause leaks. I heard you have to remove the unit from the unit group then remove it.
 

Laiev

Hey Listen!!
Reaction score
188
I can't recall who told me but, I heard removing a unit from a unit group directly will cause leaks. I heard you have to remove the unit from the unit group then remove it.

Jesus4Lyf got a tutorial about it :p and you're right


<3 jass, normally I remove unit from group because the check to loop stop is no unit in group :rolleyes:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top