#What is TextToy's character limit?
1 messages · Page 1 of 1 (latest)
Have a look inside the assembly and see where it validates the text you put in
if there is no length validation, then assume it’s the max length of a string in unity/c#
you can make ~0.09MP screen with it
but for a video you would have to experiment with low resolutions
like 50x80
maybe even lower
Max length is what you can send over the network
65534 characters for the base string
But you can increase this by using the arguments
as each one is another 65534 minus some wrapping data bytes
@rigid blade
Thanks for the info! Could you explain how to increase the limits using arguments? I'm not quite sure how to implement that part.
Set the base string to {0}....{1} and such
then the arguments replace the brackets
Just like normal c# formatting
i forgor about mirror max payload
some char's also take more than 1 byte
^
also isn't there some kind of character limit on client?
i couldn't seem to display more than 100k chars
or is it network related?
like a timeout
100K chars
💀
[TcpAsciiClient] 50 ms, ~20 FPS, characters: 22825
and the text doesn't change 😦
[TcpAsciiClient] 36 ms, ~27 FPS, characters: 21528 visible
hmmm
can you explain more detail? 
works roghly like string.format
where {0}, {1}... {n} represents each string in Arguments SyncList
Yea
💀
forgive me, but I still can't understand how this is done
can you show me some demo code help me to understand?
for example
// Spawn TextToy
GameObject prefab = NetworkClient.prefabs.Select(x => x.Value).First(x =>
{
return x.TryGetComponent(out AdminToyBase toyBase) && toyBase.CommandName is "Text";
});
GameObject obj = Object.Instantiate(prefab);
AdminToyBase toyBase = obj.GetComponent<AdminToyBase>();
toyBase.SpawnerFootprint = new(Server.Host.ReferenceHub);
NetworkServer.Spawn(toyBase.gameObject);
TextToy toy = toyBase as TextToy;
toy.transform.SetPositionAndRotation(position, rotation);
toy.NetworkIsStatic = false;
toy.DisplaySize = new(2000f, 4000f);
// Set Text
toy.Arguments.Add("Second Line");
toy.Arguments.Add("Third Line");
toy.TextFormat = "Hello World!\n{0}\n{1}";
So the above code spawns TextToy at position with rotation and it will display:
Hello World!
Second Line
Third Line
Idk if you need to set color for the text
default is white i guess
A C# character is 2 bytes.
Unless you are talking about the amount of bytes that is being sent over the net
thanks!
