Hello guys!
I have an example of the string which is:
string="Flame, pgun, etc shop"
, which taken from entity(x,y,"trigger")
and this string i tried to place in the menu:
menu(id,"Menu,"..string..",<")
but instead of exactly copied string it splits my menu to the 3 parts(2 commas).
Is there any way to keep commas( , ), dots with quotes(".. x .."), stick( | ) and any symbol in it? such as:
string="Hello, now. -"Hello|now""
Hello, now. -"Hello|now"
and even
string="Hey, "..id..", )))(0()"
Hey, "..id..", )))(0() DC Admin Offline
Hey, no I'm sorry, the special characters used to control the menu string behavior such as ,
and |
can't be escaped.
The best thing you can do is to replace them with similar looking things. e.g.:
replace , with ; or .
and replace | with ¦ or /
You can do so with string.gsub e.g.:
myString = string.gsub(myString, ",", ";")
After all this is obvious. Admin/mod comment
Okay then. Thank you for attention.
/Since there is nothing more may be done please close it? i don't think that keep free for replies makes sense.. Admin/mod comment
There is not a single reason to close this. The author or other people might have related questions. We only close threads if it is absolutely necessary. /DC @ DC: You could possibly add escape characters to the game for these kind of situations.
1
menu(id, "Title,Hello%, World!,Second button,Third button, etc")
So the game would interpret %,
as a comma instead of a new button for the menu. DC Admin Offline
@ Starkkz: I agree that it would make sense but it's not a very important feature and would be quite some effort to implement. Therefore it's unlikely that I'll work on it.
(damn, should have closed the thread... ) Quote
(damn, should have closed the thread... )
Remove the warn message then >: D
The problem is that current menu have two parametrs, instead of more than 9(0-9, x, ESC) and it count "comma" as a new button.