Hi everyone,
I'm new to AGS. Working on my first game right now. I already asked a question here in the Forum which really helped me!
So I've got another basically simple question for which I couldn't find any answers...
I want to put quoataion marks into a speech. But the script recognizes them as an error:
cCharacter.Say("He said:"Hello!"");
Is there a way to mark these "second" quotation marks not to be recognized as part of the scrpt's commands or something like that?
Thanks for your help!!!
Greets,
Luder
Hello.
You do this by putting "\" (backslash) sign before the quotation mark.
cCharacter.Say("He said:\"Hello!\"");
In programming and scripting this is called "escaping". In this case it means that program should treat next character as a part of a string rather than code syntax.
Another common use of escaping is with "[" character, which serves as a line-break in AGS. If you do cCharacter.Say("He said: [Hello]"), the speech will be split in two lines "He said:" and "Hello]", but if you do cCharacter.Say("He said:\[Hello]"), it will looke like "He said: [Hello]" on screen.
Hmm, since I am at this, if you want to print "\" character you will have to escape it, like "\\". :)
Hi!
Thank you very much for your long answer! Really hlped me! Thanks!
oh, thanks :)
did not know this either... I usually just cheat and type '' or just '... (laugh)