Get all players List<string>

This would really lessen the chip load for example something like making your own typecasting cv2 to turn a get all players list into a list so you can get every player in a prompt. You could just to string it and turn to list and blahh blahh, but people can put just about any character they want in there name so if someone has { or } or , maybe even [ ] it breaks most systems and it sucks cause we have to do these work around that are like 5+ chips just to which is absurd…

1 Like

And this would all be fixed if the To String chip worked well with lists

wdym work well with lists? it does work well? it does as it’s intended?

I should have phrased that differently. When I first tried input a list to the To String chip, I expected it to output a string list. If it worked like that (which I think it should) then this wouldn’t be a problem. Right now I think it outputs a normal string with a bunch of separators between the values.

Most efficient way to do this would be from left to right
Get All Player > to String > String Length > Subtract 2 > string substring(index:1, subtraction answer) > string split(", ") <–comma and space

Only 6 total Circuits with no brackets and also does not remove player name brackets.

I dont fully understand but if ur talking ab9ut people having these characters in their Nickname then u have a problem because username r the main name nicknames is just nicknames they aren’t real u really think I want to be called GG or ZipAzen irl

It’d save you a For Each. That’s good.

2 Likes

i don’t thingy you saw the thing i said about people having commas in there name or brackets it’ll mess it up for example if someone’s name is ,Trevor or Trevor, or even Tre,vor it’ll split the wrong thing

The way I have it it’ll only split it if its a , and a space ", ". It’s very uncommon for a player to have a name with “Trevor, Trevor”

This method does not work with players

Players can have , in their name, which would break the list
Also, player displays names can be up to 15 characters, meaning with large enough player counts, you would run out of room, breaking the string

The most efficient is still using a List<String> Variable, For Each, To String, and List Add

I know players currently dislike functions due to increased CPU usage, but especially since CPU shouldn’t ever reach high values + this is a relatively + functions using more CPU is temporary:

I think you should just use a function for this, you make it once on your own and then can call it whenever you like, its quick, simple, and customizeable

The max characters for a string is the same number for the max int variable
2,147,483,647
And if max is 15 then even with max players it still wouldnt hit that.

Also if we are really going down to specifics like that yours still wouldnt be most efficient because 2 players can have the same display name. So you’d have to use the account names as the one’s in the list. Since you cannot have 2 players with same account name. Plus I don’t think you can have a , or a space in account names.

Yes functions are good

No it absolutely is not. In RecRoom, the max number of characters a string supports is 512 characters

Assuming your method works perfectly (To String + String Split), then your method is doing the EXACT same thing as mine, converting a list of players to a list of player display names

The problem is, your method doesn’t work, not just because of the string character limit problem, but ALSO because of the other problem I listed, if any player display name contains ", ", your system breaks. If my display name was Cryptic, , then To String + String Split would return the list ["Cryptic", ""]

Where as, with my method, using a List<String> Variable, For Each, Get All Players, To String, and List Add, it would return the list ["Cryptic, "] (assuming I am the only player in the server)

This was never a matter of “Getting unique players”, it was just “Converting a list of players to a list of strings/player display names”, which is EXACTLY what my method produces

If you wanted account names, then using my method, you could just use Player Get Account Name instead of To String

Yes i was wrong about the string due to the fact that in normal proramming it is the same as int max. Plus still in the case for yours if 2 players have the same display name only one of the players get triggered. So we were both wrong at first and we find most efficient with your method (that i normally use) but with use of account names

No? We’re not both wrong? Did you read my response at all?

Again, the original post is JUST asking for a chip that converts Get All Players from a List<Player> to List<String>

By using For Each on Get All Players, converting the players to a string, then adding the string result to a List<String> using List Add, you will end up with a List<String> containing the display names of all players in the room

If I had players PlayerA, PlayerB, PlayerC, and PlayerD, then when I trigger my circuit, we would end up with the List<String> : ["PlayerA", "PlayerB", "PlayerC", "PlayerD"]

If there were 2 players in the game that shared the same display name, eg. PlayerA, it would return the list: ["PlayerA", "PlayerA"]

Your method would return the exact same list:

  • Convert Get All Players to string, returning the string "["PlayerA", "PlayerA"]"
  • Remove the [ and ] characters
  • Split at , ,
  • Resulting list = ["PlayerA", "PlayerA"]

The problem is, if a players name contains , , eg. Player, A and Player, B, the resulting list would be: ["Player", "A", "Player", "B"]

And, again, my circuits, nor your circuits, would have any failures if any 2 or more players shared the same display name, it also wouldn’t be an issue as, again, that is not what this post is about, its JUST about converting a List<Player> to List<String>, not about getting UNIQUE player display names, and even IF that were the goal, you could just use List Distinct to get all unique entries

3 Likes

look i made a little doodle of what cryptic is saying
this is the method most people use for smthn like this and its not cost efficient or anything


mb the chip is just called list add :skull:

also for the original @Ardenis thing i think a string player list is kinda unnecessary since this is only ~6 chips

(@CrypticCreator pls correct me if im wrong)

Yeah Ik what it was btw.
I told him an easy, non-complicated way to do it with few restrictions.
I use this way for most of my stuff with selecting players.

i would say this is way less complicated? the other way relies on people not having a specific set of characters which is kinda weird and it also is slightly more complicated then just:
“list. split list. string. join list”