I'm trying to make a trigger that only works when people are playing with me in the game. However, none of the comparisons seem to work. I tried strings, text, and converting text to strings, but none of them will run.
Convert game text doesn't work the way you think it does. String/text values in data are sometimes stored with string IDs. With converting game text, you're displaying the text associated with the input game ID string. So unless you've stored your name as text as a string ID (which still wouldn't get you anywhere), it's not getting you anywhere.
Unfortunately, 1. you can't compare text 2. you can't return a player's name as anything but text.
As hobbidude said, you should use handle IDs. Handle IDs are strings that are unique IDs for every account. Every account has it's own string ID associated with it. Those can be returned with the function handle of player.
If you find your handle ID (by either joining an arcade game that displays it (-Mafia-) or looking in your SC2 bank directory for a bank that you saved while logged into Bnet) you can check whether you're in the game or not by seeing if any players have your ID.
I see you'd also like this to be true when a player is Local Player, which only occurs during test maps when you're not logged in. When you're not logged in, you don't have a handle ID. So you'd check whether it's blank or not.
Thanks! That helps a lot. I actually did try handle of player before, but I did not know how to find out what my ID was so it didn't work. I should be able to do it now.
I'm trying to make a trigger that only works when people are playing with me in the game. However, none of the comparisons seem to work. I tried strings, text, and converting text to strings, but none of them will run.
Here's my current code:
Also I set the name variable like this:
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
Try player handle instead.
@fishy77: Go
Convert game text doesn't work the way you think it does. String/text values in data are sometimes stored with string IDs. With converting game text, you're displaying the text associated with the input game ID string. So unless you've stored your name as text as a string ID (which still wouldn't get you anywhere), it's not getting you anywhere.
Unfortunately, 1. you can't compare text 2. you can't return a player's name as anything but text.
As hobbidude said, you should use handle IDs. Handle IDs are strings that are unique IDs for every account. Every account has it's own string ID associated with it. Those can be returned with the function handle of player.
If you find your handle ID (by either joining an arcade game that displays it (-Mafia-) or looking in your SC2 bank directory for a bank that you saved while logged into Bnet) you can check whether you're in the game or not by seeing if any players have your ID.
I see you'd also like this to be true when a player is Local Player, which only occurs during test maps when you're not logged in. When you're not logged in, you don't have a handle ID. So you'd check whether it's blank or not.
@Charysmatic: Go
Thanks! That helps a lot. I actually did try handle of player before, but I did not know how to find out what my ID was so it didn't work. I should be able to do it now.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here