Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to filter text with no players connected?

Asked by 7 years ago

I have a random name generator for elements in my game. Apparently these now have to be filtered. The documentation for FilterStringForBroadcast says that a player is required in order to filter text. This generator runs when the server first inits, when no clients have connected yet. How am I supposed to filter this if I can't run the method?

0
Also, this is real annoying, as it potentially adds a tremendous amount of processing time to the generation of names. If a name gets filtered, it has to start over from scratch repeatedly until it finds one which works. Not only this, but if they change the generator to be any more/less restrictive, the final output of the generator will change and no longer be consistent. elijahlorden 6 — 7y
0
As long as you know that the names are not 'bad' then there is no problem. If you are randomly putting a name together then this should be filtered just in case. User#5423 17 — 7y
0
Also you need a client to create the server User#5423 17 — 7y
0
This is true, but at the moment the server starts and scripts begin executing, there aren't any clients connected. I need to be able to start running the generator the moment the server starts, not the moment the first client connects. elijahlorden 6 — 7y

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago

If players never see it at all then a filter is not needed. Also if you know all of the names in the random list or whatever, then you don't need a filter either. But I assume players are supposed to see this. I recommend doing this calculation on each client. Or a re-roll option. I doubt it is really that obstructive!

0
The issue is that a re-roll will not work. The generator uses a Markov Chain to recombine pieces of other words into something believable. The issue is that this needs to be consistent. This data is used to name things such as planets or elements in my game. If a player logs out with an element in their inventory, they would be really confused if they logged back in and it was named different elijahlorden 6 — 7y
Ad

Answer this question