• 🏆 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!

How to remove Player Group leak?

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
Create an array which you store the force belonging to each player in at map init. Use the player number as an index.

  • Events
    • Map initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 16, do (Actions)
      • Loop - Actions
        • Set Force[(Integer A)] = (Player group((Player((Integer A)))))
and then read Force[(Player number of <player>)] when you need it.
 
Level 10
Joined
Aug 14, 2009
Messages
309
Create an array which you store the force belonging to each player in at map init. Use the player number as an index.

  • Events
    • Map initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 16, do (Actions)
      • Loop - Actions
        • Set Force[(Integer A)] = (Player group((Player((Integer A)))))
and then read Force[(Player number of <player>)] when you need it.

Best GUI solution I think.
 
Level 6
Joined
Feb 5, 2012
Messages
1,685
I am sad to say but i don't understand how i can use it in removing the leak using the event -clear.Can you create a trigger with
Event
Player 1 types -clear
Action
Camera-Clear messages of Player Group (Triggering Player)

Then apply your solution on removing the leak.Or on the other hand create this trigger and remove the leak.so i just copy it to my map.+ rep
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -clear as An exact match
    • Conditions
    • Actions
      • Set pgrp = (Player group((Triggering player)))
      • Cinematic - Clear the screen of text messages for pgrp
      • Custom script: Custom script: call DestroyForce(udg_pgrp)
pgrp is a player group variable.

An alternative method is to do what WaterKnight did. Then use
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -clear as An exact match
    • Conditions
    • Actions
      • Cinematic - Clear the screen of text messages for Force[Player number of triggering player]
 
Status
Not open for further replies.
Top