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,463
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,463
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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top