show and g are actually passed as parameters, they are declared in the snippet just for illustration
g2 is intended as a storage group that stores all "flagged" players.
b is used to deactivate a trigger when no players can view the dialog.
The function adds all members of g to g2, then compares if the size of g2 is equal to all active (human) players.
If the size is equal, b should evaluate to false. However its not working..
The debug output is "0 : 1", when it should be "1 : 1" (Since i'm the only active player)
Well... Im not so hot with galaxy but in gui when i want to move players from one group to another. I generally loop through the primary group and add them to the secondary group if I really want them in it. And then remove them from the secondary as they are no-longer needed in it. For example after they have completed interacting with a specific dialog.
@SouLCarveRR: Yeah, thats what i did as a workaround. Point here is that these functions might be bugged, thus I inquire if anyone else faces this problem so hopefully blizzard notices and fixes it -_-
As there is no negation within IntToString(PlayerGroupCount(bbInfo[id].g)
Oh.. and i forgot to mention. 'bbInfo[id].g' is 'g2', its a struct/record. I tried using a local playergroup, same problem. So i doubt theres anything wrong with the struct.
I've used GroupAddGroup before and it worked for me..
Ok, did some testing and it works fine for me.
I have an idea what's the cause though.
Make sure that you properly initialize g2. It needs to be inited at least with PlayerGroupEmpty();
If you only declare it without initializing it you can add as many players as you want to, the count stays 0. Interestingly it doesn't throw any errors.
So this problem fits the symptoms.
I recall i tried without StringExternal(), but the editor bugged out on me. Maybe there was some silly syntax error.. Anyway, with regards to the problem I believe it's most likely what you said, an initialization problem. Will try it out once I get my hands on my editor again.
Btw, stupid question: StringExternal() returns a string right?.. If it doesn't that would explain why it didn't work when I took it away.
@Kueken531
I do believe you are mistaken? I didn't exactly use IntToText, nor did i even know such a function exists.
TriggerDebug requires a Text and not a String.
StringExternal TAKES a string and returns a text.
As Kueken said, IntToText(x) should take care of it just fine :)
Hey, anyone ever tried this function?.. It doesn't seem to work. Or is it just me?..
Heres the code snippet.
Notes:
If the size is equal, b should evaluate to false. However its not working.. The debug output is "0 : 1", when it should be "1 : 1" (Since i'm the only active player)
It works fine using the gui commands.
Well... Im not so hot with galaxy but in gui when i want to move players from one group to another. I generally loop through the primary group and add them to the secondary group if I really want them in it. And then remove them from the secondary as they are no-longer needed in it. For example after they have completed interacting with a specific dialog.
Try:
instead.
It probably first evaluates
!PlayerGroupCount(bbInfo[id].g)
Which is 1, but due to the negation it becomes 0.
@SouLCarveRR: Yeah, thats what i did as a workaround. Point here is that these functions might be bugged, thus I inquire if anyone else faces this problem so hopefully blizzard notices and fixes it -_-
@s3rius: Go
If that was the case, wouldn't we expect the debug output to be 1 : 1? It still shows 0 : 1. =/
As there is no negation within IntToString(PlayerGroupCount(bbInfo[id].g)
Oh.. and i forgot to mention. 'bbInfo[id].g' is 'g2', its a struct/record. I tried using a local playergroup, same problem. So i doubt theres anything wrong with the struct.
I've used GroupAddGroup before and it worked for me..
Ok, did some testing and it works fine for me.
I have an idea what's the cause though.
Make sure that you properly initialize g2. It needs to be inited at least with PlayerGroupEmpty();
If you only declare it without initializing it you can add as many players as you want to, the count stays 0. Interestingly it doesn't throw any errors.
So this problem fits the symptoms.
Btw -
Why is that StringExternal in there? StringExternal looks up the given string identifer in the externalized string table.
You might want to use StringToText instead (or use IntToText directly )
@s3rius: Go
I recall i tried without StringExternal(), but the editor bugged out on me. Maybe there was some silly syntax error.. Anyway, with regards to the problem I believe it's most likely what you said, an initialization problem. Will try it out once I get my hands on my editor again.
Btw, stupid question: StringExternal() returns a string right?.. If it doesn't that would explain why it didn't work when I took it away.
@Kueken531
I do believe you are mistaken? I didn't exactly use IntToText, nor did i even know such a function exists.
TriggerDebug requires a Text and not a String.
StringExternal TAKES a string and returns a text.
As Kueken said, IntToText(x) should take care of it just fine :)
@s3rius: Go
Ah ok. whoops. misread his post. my bad >_< thanks for the constructive feedback.