Message Display/Prevent Leak Problem

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Message Display/Prevent Leak Problem

Post by CrackUps »

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)
What am i doing wrong?
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Message Display/Prevent Leak Problem

Post by Ozzapoo »

Try changing it to this:
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 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 ;)
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Message Display/Prevent Leak Problem

Post by CrackUps »

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 :?
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Message Display/Prevent Leak Problem

Post by Ozzapoo »

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 ^^)
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Message Display/Prevent Leak Problem

Post by CrackUps »

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)
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Message Display/Prevent Leak Problem

Post by Ozzapoo »

Lol k. But really...changing it to jass isn't that hard...would probably take 2-3 minutes max, to make the changes.
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!