Forum

> > CS2D > Scripts > Include ';' in hudtxt
Forums overviewCS2D overview Scripts overviewLog in to reply

English Include ';' in hudtxt

5 replies
To the start Previous 1 Next To the start

old Include ';' in hudtxt

Mami Tomoe
User Off Offline

Quote
I can't make the ';' char appear in my hudtxt, I've even tried using '\59' to see if it's because of Lua.

I assume there's a reason to it?

EDIT:
I think I know what it's for:
hudtxt id;text;x;y...

Is there a workaround to showing it? I specifically need it to show a semicolon.

old Re: Include ';' in hudtxt

DC
Admin Off Offline

Quote
I assume you're using Lua with cs2d lua cmd parse? Or a wrapper script which internally uses parse? Please read the description of cs2d lua cmd parse. You can set the optional Stop-At-Semicolon parameter of cs2d lua cmd parse to 0 to prevent that behavior.

old Re: Include ';' in hudtxt

Mami Tomoe
User Off Offline

Quote
I think that HUDTXT stops at semicolon on it's own, it happens in the console as well.

Try typing
hudtxt "5" "test;50;50"
in the console.


Edit: So will this be fixed? Or will there be an alternative way of using semicolons normally?
edited 1×, last 03.05.19 10:52:54 am

old Re: Include ';' in hudtxt

DC
Admin Off Offline

Quote
Can't tell. Had no time to investigate that further.

CS2D has UTF-8 support. See cs2d lua cmd parse
Maybe it works when you encode the semicolons with UTF-8? Not sure.

old Re: Include ';' in hudtxt

Mami Tomoe
User Off Offline

Quote
That doesn't work, the problem is with the HUDTXT command itself, for some reason it accepts semicolons as a way to separate parameters.

old Re: Include ';' in hudtxt

GeoB99
Moderator Off Offline

Quote
One plausible reason would be that when the
text
parameter of cs2d cmd hudtxt has the semicolon in the memory buffer, the semicolon as well as the string after the semicolon gets truncated and left out only as garbage regardless of Stop-At-Semicolon being disabled. For the record, I can print the semicolon between strings just fine on cs2d lua cmd msg and cs2d lua cmd msg2.

There's nothing that we can do other than for user DC to check the source code and bisect the said buffer pointed by
text
to see if the data is passed correctly as it should.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview