#What is TextToy's character limit?

1 messages · Page 1 of 1 (latest)

rigid blade
#

I just want to run DOOM and it takes a lot of characters to make a quality video, and I'd also love to know where that limit is set 🙂

sharp falcon
#

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#

mental bison
#

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

wet cypress
#

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

rigid blade
wet cypress
#

Set the base string to {0}....{1} and such

#

then the arguments replace the brackets

#

Just like normal c# formatting

sharp falcon
wet cypress
#

No thats fine its just that you cant fit more in UDP packet

mental bison
#

some char's also take more than 1 byte

wet cypress
#

^

mental bison
# wet cypress ^

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

wet cypress
#

100K chars

mental bison
#

yes

#

is a lot

#

100k excluding all the TMP tags :3

rigid blade
#

💀

#

[TcpAsciiClient] 50 ms, ~20 FPS, characters: 22825

#

and the text doesn't change 😦

#

[TcpAsciiClient] 36 ms, ~27 FPS, characters: 21528 visible

mental bison
#

hmmm

rigid blade
earnest oyster
mental bison
#

works roghly like string.format

#

where {0}, {1}... {n} represents each string in Arguments SyncList

wet cypress
#

Yea

earnest oyster
#

💀

#

forgive me, but I still can't understand how this is done

#

can you show me some demo code help me to understand?

mental bison
#

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

ionic yacht
#

Unless you are talking about the amount of bytes that is being sent over the net