• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Leaks are the bane of my existance. (Player Group Leak! Help!)

Status
Not open for further replies.
Level 6
Joined
Feb 6, 2008
Messages
166
This is quite the handful to read, but I've been stuck trying to fix this.

  • Matchup Request
    • Events
      • Player - Player 1 (Red) types a chat message containing -ma as An exact match
      • Player - Player 2 (Blue) types a chat message containing -ma as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ma as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ma as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -ma as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ma as An exact match
      • Player - Player 7 (Green) types a chat message containing -ma as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ma as An exact match
    • Conditions
    • Actions
      • Set PlayerIntegerTemp = (Player number of (Triggering player))
      • Set PlayerGroupTemp = (Player group(PlayerIndex[PlayerIntegerTemp]))--------(First problem)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayersReady Equal to PlayersPlaying
        • Then - Actions
          • Cinematic - Clear the screen of text messages for PlayerGroupTemp
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PlayerIndex[(Integer A)] slot status) Equal to Is playing
                • Then - Actions
                  • Set MatchupDisplay = ((PlayerName[(Integer A)] + PlayerColor[(Integer A)]) + ( is + PlayerRace[(Integer A)]))
                  • Game - Display to PlayerGroupTemp for 8.00 seconds the text: MatchupDisplay
                • Else - Actions
          • Set MatchupDisplay = <Empty String>
        • Else - Actions
          • Cinematic - Clear the screen of text messages for PlayerGroupTemp
          • Game - Display to PlayerGroupTemp for 4.00 seconds the text: Not all players hav...
      • Custom script: Custom script: call DestroyForce(udg_PlayerGroupTemp)--------(Second problem)
* According to Leak Check 3.0, using convert player to player group leaks?
Can I replace it with:
  • Set PlayerGroupTemp = (All players matching ((Triggering player) Equal to PlayerIndex[PlayerIntegerTemp]))
* I can't enable the trigger - World Editor says there's an unexpected endif. Do I need to re-create and destroy the group each time I want to use it? I've been looking at this: #

Once I finish going through and removing all leaks and optimizing my map, it'll be up on the Hive for long overdue testing, as I've been on-and-off map editing. Canceling the project has never been a thought that crossed my mind, though, and I'm going to keep pressing forward.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
* According to Leak Check 3.0, using convert player to player group leaks?
Can I replace it with:
  • Set PlayerGroupTemp = (All players matching ((Triggering player) Equal to PlayerIndex[PlayerIntegerTemp]))
Leak check isn't really reliable. The way it is currently, it doesn't leak.
* I can't enable the trigger - World Editor says there's an unexpected endif. Do I need to re-create and destroy the group each time I want to use it? I've been looking at this: #
You seem to have accidently wrote "Custom script"
  • Custom script: Custom script: call DestroyForce(udg_PlayerGroupTemp)
It should just be
  • Custom script: call DestroyForce(udg_PlayerGroupTemp)
Do I need to re-create and destroy the group each time I want to use it?
If you use the same force, then don't destroy it. Just assign it a value at map init.
Each time you re-create it, though, you have to destroy it.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Also, to shorten your long-hard-read Event, use this in another trigger:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Trigger - Add to Matchup Request <gen> the event (Player - (Player((Integer A))) types a chat message containing -ma as An exact match)
(I know that using loop of Integer A can be bugged, but what the hell, this is for single-time use only)

Your combined triggers should look like this:
  • Player Event Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Matchup Request <gen> the event (Player - (Player((Integer A))) types a chat message containing -ma as An exact match)
  • Matchup Request
    • Events
    • Conditions
    • Actions
    • *Your Actions here*
This will save your Event a lot.
 
Status
Not open for further replies.
Top