Ok i have a system in my map so that a integer keeps track of how much exp a hero has earned and a player can type -exp to check how much that is. Anyway i made the trigger so it wouldnt leak by adding the triggering player to a player group then displaying the message to the group but when i type -exp in game it wont display the message this is the trigger:
Spoiler:
ExpCheck
Events
Player - Player 1 (Red) types a chat message containing -exp as An exact match
Conditions
Actions
Player Group - Add (Triggering player) to TempPlayerGroup
Set TempUnitGroup = (Units owned by (Triggering player))
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
Loop - Actions
Game - Display to TempPlayerGroup the text: ((PlayerColour[(Player number of (Triggering player))] + (Name of (Picked unit))) + ('s|r total experience gained is + (String(TotalExpGained[(Player number of (Triggering player))]))))
Custom script: call DestroyGroup(udg_TempUnitGroup)
Player Group - Remove all players from TempPlayerGroup
and yet it will display the message when i make the trigger like this:
Spoiler:
ExpCheck
Events
Player - Player 1 (Red) types a chat message containing -exp as An exact match
Conditions
Actions
Set TempUnitGroup = (Units owned by (Triggering player))
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
Loop - Actions
Game - Display to (Player group((Triggering player))) the text: ((PlayerColour[(Player number of (Triggering player))] + (Name of (Picked unit))) + ('s|r total experience gained is + (String(TotalExpGained[(Player number of (Triggering player))]))))
Custom script: call DestroyGroup(udg_TempUnitGroup)
ExpCheck
Events
Player - Player 1 (Red) types a chat message containing -exp as An exact match
Conditions
Actions
Player Group - Add (Triggering player) to TempPlayerGroup
Set TempUnitGroup = (Units owned by (Triggering player))
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
Loop - Actions Game - Display to All Players the text: "looped"
Game - Display to TempPlayerGroup the text: ((PlayerColour[(Player number of (Triggering player))] + (Name of (Picked unit))) + ('s|r total experience gained is + (String(TotalExpGained[(Player number of (Triggering player))]))))
Custom script: call DestroyGroup(udg_TempUnitGroup)
Player Group - Remove all players from TempPlayerGroup
and see if the trigger is actually working properly. If it doesn't say "looped" at all, then you obviously have something to fix
CrackUps wrote:Yeah i've already tried that technique the only way that fixes it is if i display it to the triggering player as a force but the of course that leaks
Do you really have to have it in GUI..? You can just copy the gui trigger and disable it (and make it a backup). Then take the original and convert it to custom text..
Then change the function and add a local (or two, if you want the unitgroup to be in locals too)....So it'll be something along the lines of this:
local player p=GetTriggerPlayer()
call DisplayTextToPlayer(p,0,0,udg_PlayerColour[GetPlayerId(p)-1]+.......just leave all this as it is ^^)
Well really i'd prefer it to be JASS but seeing as i'm useless at it i stick to GUI and cbf doing what you said and disabling requires too much effort lol i ended up changing the trigger to this which works fine
Spoiler:
ExpCheck
Events
Player - Player 1 (Red) types a chat message containing -exp as An exact match
Conditions
Actions Set TempForce = (Player group((Triggering player)))
Set TempUnitGroup = (Units owned by (Triggering player))
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
Loop - Actions
Game - Display to TempForce the text: ((PlayerColour[(Player number of (Triggering player))] + (Name of (Picked unit))) + ('s|r total experience gained is + (String(TotalExpGained[(Player number of (Triggering player))]))))
Custom script: call DestroyGroup(udg_TempUnitGroup) Custom script: call DestroyForce(udg_TempForce)