Double quotes
tvisarl
28 Jul 2016, 17:06This is probably a redundant question and I'm sorry for it.
I have a menu in my game. In itself no problem, but I want one of the options to APPEAR AS, to be DISPLAYED AS :
- Say "Zut".
How should the option and the answer be coded?
This doesn't work : if (result = "Say \"Zut \"")
doesn't work; Quest remains stuck.
I know, I yelled and it is very bad taste; sorry about that. But I wanted to be as clear as possible.
Thanks,
Thierry
XanMag
28 Jul 2016, 19:23This may not be the best solution, but I always used single quotes within a script that required bookend double quotes. Someone with better coding knowledge may have a better answer than that, perhaps using the text processor?
The Pixie
28 Jul 2016, 19:28I know it gets stuck if there is a single quote in one of the choices; it may be the same for double quote. Put in this before the if
.
msg("Result = " + result)
Does it display the result? If not, could you use smart style quotes instead?
tvisarl
29 Jul 2016, 07:24What are "smart style quotes"?
Pertex
29 Jul 2016, 08:41You could do the following:
if (instr(result,"Say ")>0 and instr(result,"Zut")>0){
tvisarl
29 Jul 2016, 09:25Quite true. Thanks, Pertex!
Jay Nabonne
29 Jul 2016, 12:09There is also a dictionary variant of the menu, where the dictionary contains id/display text pairs. (You just pass the dictionary instead of the list.) The resulting id comes back. This allows you have sensible ids for your options - even "option1", "option2", etc - that are separate from the text displayed in the menu. Quest uses this feature internally for its object disambiguation menus: the object's alias is shown in the menu, but when you select something, the actual object name is returned.
Not sure if that helps, but I thought I'd throw it out there.
tvisarl
03 Aug 2016, 13:45Thanks, Jay.