I heard you cant because its a language thing. certain text being returned between players can be different if someone has a different version. all sorts of global game play text varies from country to country.
Fyre is sort of correct with this. Texts are localized into different languages, but obviously the player name wouldn't vary. I don't know why they made it a Text in the first place. Maybe they thought the only time somebody's gonna need the player name is for displaying it in a leaderboard or so and they made it be a text so you don't have to convert it first.
The reason the player name is a Text and not a String, is because you can't rely on a players name for triggers. It's not that you couldn't find some uses, like debug triggers or special events when the author is in the map, but in the end, that's just bad coding practice. If you want stuff like debugging and special events, you're much better off using other methods, like chat commands or keyboard events.
The reason the player name is a Text and not a String, is because you can't rely on a players name for triggers. It's not that you couldn't find some uses, like debug triggers or special events when the author is in the map, but in the end, that's just bad coding practice. If you want stuff like debugging and special events, you're much better off using other methods, like chat commands or keyboard events.
And how would I encrypt the content of a bank file so it could only be read by one certain player? (leaving out the problems that non-unique names cause >.<)
Right now there is no way to do it. I can't even prompt the players to enter their names themselves, then compare it with the PlayerName() to see if it's correct, since I can only compare the object and not it's value.
You can use a login system where a Account / Password is required to release variables within the bank. This would require a working edit box... which doesn't exist, but there is a workaround... several variations on this site... I created one a few months ago...
This is a minor security precaution though... somebody can just open the xml files that get stored in their bank folder and edit them as they see fit.
This is a minor security precaution though... somebody can just open the xml files that get stored in their bank folder and edit them as they see fit.
That's why the information stored within the bank need to be encrypted. You could still change them, but it'd look like gibberish to you and changing values at random would very well cause the bank to not work anymore.
Using a account/password system is a possibility, but not a very satisfactory one. I have thought about this before (using a randomly generated save code as a key to your bank), but it seems like being a workaround for a workaround for a missing feature of SC2..
"encrypting" a databank would prove very useless, as people could just examine your code, or even simply copy your code into a new map, and make a databank just how they want it to. And even if that's not an issue, relying on again a persons username is a bad way to do things, would be much better with a login dialog.
Seems a bit silly really... You could do this in Warcraft 3 with no trouble at all. What's to stop a player from say... uploading his top-level character in an ORPG map for everyone to use themselves if there's no way to verify the player's name?
Competetive character progression goes out of the window.
Either Blizzard implements a good way of protection (as the recent one doesn't seem to be so bright) or people will have to create and rely on 3rd party protection tools like they did with Warcraft 3.
One way or another, leaving all information unencrypted in an easy-to-find file is like an invitation for people to modify it in order to cheat.
There is no way of absolute protection, fine. But it will at least keep the wannabe maphackers away.
And only relying on a username/password would have implication like Callex just mentioned.
Now that you can't just change your username every once in a while (like you used to in Wc3) there'll be few players willing to use a different username just for the sake of copying a another player's character save from some map.
Most save system in Wc3 would recognize anagrams as valid user names. It wasn't very hard to copy another player's name as an anagram and use his code.
In some way SC2's name system is even better suited for username protection.
I am in a shock right now, i cant find function to return player name!!!
How to get player name???
@CEMEHbl4: Go
Local Variables
-Player Name = No Text <Text>
Action
-Variable - Set Player Name = (Name of player (Triggering player))
is that wat u want?
@Dest1nyCP: Go
oke its work for actions... but i cant put it in condition! here is no text type , only text tag, wtf?
i need comparison "triggering player name equal to xxx"
i dont quite understand what u want to do. perhaps u can explain it here.
u can use If then else statement in action and compare using player name variable
@CEMEHbl4: Go
What he or she means is that you can't use a condition comparison with Text type variables.
You can use strings but you cannot use text for comparison. I don't think this is possible with GUI.
Woah... Odd...
tell me the function in custom code then
i need player name as a string to compare it with other string!
@CEMEHbl4: Go
Isn't there a convert text to string function? You can then compare it to a string.
@NoRoo: Go
no, there is not!
EDIT: (at least in GUI )
I have the same problem. I NEED TO PUT THE PLAYER NAME INTO A STRING!
I heard you cant because its a language thing. certain text being returned between players can be different if someone has a different version. all sorts of global game play text varies from country to country.
from the hive somewhere I think
There just is no way.
Fyre is sort of correct with this. Texts are localized into different languages, but obviously the player name wouldn't vary. I don't know why they made it a Text in the first place. Maybe they thought the only time somebody's gonna need the player name is for displaying it in a leaderboard or so and they made it be a text so you don't have to convert it first.
Fking stupid -.-
The reason the player name is a Text and not a String, is because you can't rely on a players name for triggers. It's not that you couldn't find some uses, like debug triggers or special events when the author is in the map, but in the end, that's just bad coding practice. If you want stuff like debugging and special events, you're much better off using other methods, like chat commands or keyboard events.
And how would I encrypt the content of a bank file so it could only be read by one certain player? (leaving out the problems that non-unique names cause >.<)
Right now there is no way to do it. I can't even prompt the players to enter their names themselves, then compare it with the PlayerName() to see if it's correct, since I can only compare the object and not it's value.
@s3rius: Go
You can use a login system where a Account / Password is required to release variables within the bank. This would require a working edit box... which doesn't exist, but there is a workaround... several variations on this site... I created one a few months ago...
This is a minor security precaution though... somebody can just open the xml files that get stored in their bank folder and edit them as they see fit.
That's why the information stored within the bank need to be encrypted. You could still change them, but it'd look like gibberish to you and changing values at random would very well cause the bank to not work anymore.
Using a account/password system is a possibility, but not a very satisfactory one. I have thought about this before (using a randomly generated save code as a key to your bank), but it seems like being a workaround for a workaround for a missing feature of SC2..
"encrypting" a databank would prove very useless, as people could just examine your code, or even simply copy your code into a new map, and make a databank just how they want it to. And even if that's not an issue, relying on again a persons username is a bad way to do things, would be much better with a login dialog.
Seems a bit silly really... You could do this in Warcraft 3 with no trouble at all. What's to stop a player from say... uploading his top-level character in an ORPG map for everyone to use themselves if there's no way to verify the player's name?
Competetive character progression goes out of the window.
Either Blizzard implements a good way of protection (as the recent one doesn't seem to be so bright) or people will have to create and rely on 3rd party protection tools like they did with Warcraft 3.
One way or another, leaving all information unencrypted in an easy-to-find file is like an invitation for people to modify it in order to cheat.
There is no way of absolute protection, fine. But it will at least keep the wannabe maphackers away.
And only relying on a username/password would have implication like Callex just mentioned.
Now that you can't just change your username every once in a while (like you used to in Wc3) there'll be few players willing to use a different username just for the sake of copying a another player's character save from some map.
Most save system in Wc3 would recognize anagrams as valid user names. It wasn't very hard to copy another player's name as an anagram and use his code.
In some way SC2's name system is even better suited for username protection.