Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Stuk with a script

4 years ago

Hi people!

I'm really not new here, but I'm trying to make a story, well, my first story. It's in spanish. But I'm stuk doing a script. The thing I'm trying to make is in a page I want to set a script with the $pagetext system variable to display a little text deppending on if the users read a book examining the room (Optionally) before. The thing is, I made the variable of the book to change if the user clicks on the link containing the book, but when I try to make the script in the page that examines the variable it show's me an error like this.

 Did not recognize '"_Podrí'. Line=2 Col=26

I'll put the script here. And no, it's not an apcent problem, I tried to remove them with the same result.

IF %LIBRO = 1 THEN
$PAGETEXT := $PAGETEXT + "_Podría ser el chico del que hablaba ese libro, estamos a 10 de enero del 2002, coincide el año. Pero si este es el caso... ¿Como sabe el de su casa? ¿Como sabe quien es? Aunque quiera preguntar el no puede saber que leí esa información, mucho menos que la leí fisgoneando, podría enojarse o hasta matarme. Aunque siendo realistas, no vendría mal preguntar para que lo quiere muerto." + "<br>" + "-¿Y porqué quiere matar a este niño? ¿Tiene alguna habilidad o algo? Preguntas." + "<br>" + "-Sí, tiene una especie de poder. Pero te lo explicaré terminada la misión. Marcus, tienes que saber que esta es la misión más importante que le aya asignado a cualquiera del equipo, no puedes fallar. Confío en ti para esto. Te llamé temprano para que tengas todo el día para prepararte, pues partirás en la madrugada, para asegurar la misión con las menos víctimas posibles. Quiero que tengas mucho cuidado, pues no podemos estar seguros de que la casa no estará muy protegida." + "<br>" + "Sabes que no tendría sentido cuestionarlo así que asientes y tomas tus llaves y te diriges a la puerta." + "<br>" + "-Mucha suerte, Marcus. No me traiciones, y trae al chico muerto aquí."
ELSE IF %LIBRO = 0 THEN
$PAGETEXT := $PAGETEXT + "-¿Y porqué quiere matar a este niño? ¿Tiene alguna habilidad o algo? Preguntas." + <br>" + "-Sí, tiene una especie de poder. Pero te lo explicaré terminada la misión. Marcus, tienes que saber que esta es la misión más importante que le aya asignado a cualquiera del equipo, no puedes fallar. Confío en ti para esto. Te llamé temprano para que tengas todo el día para prepararte, pues partirás en la madrugada, para asegurar la misión con las menos víctimas posibles. Quiero que tengas mucho cuidado, pues no podemos estar seguros de que la casa no estará muy protegida."  + "<br>" + "Sabes que no tendría sentido cuestionarlo así que asientes y tomas tus llaves y te diriges a la puerta." + "<br>" +  "-Mucha suerte, Marcus. No me traiciones, y trae al chico muerto aquí."

Thanks in advanse!

Stuk with a script

4 years ago
I'm on mobile and can't test this now, but I notice that after ¿Tiene alguna habilidad o algo? Preguntas. you are missing a quotation mark on the break line tag. There might be others places like that in there that I missed. I don't know for sure if that's causing the exact problem given that it doesn't seem to match the error, but it's something that will cause problems on its own.

I'll try and figure this out in a test game after work if no one else has. I don't mess with $PAGETEXT often, I usually prefer on page scripting.

Stuk with a script

4 years ago
It might be the special characters breaking something. Alternatively you can add some BEGIN and END statements so the scripting language doesn't get confused:

IF %LIBRO = 1 THEN BEGIN $PAGETEXT := $PAGETEXT + "_Podría ser el chico del que hablaba ese libro, estamos a 10 de enero del 2002, coincide el año. Pero si este es el caso... ¿Como sabe el de su casa? ¿Como sabe quien es? Aunque quiera preguntar el no puede saber que leí esa información, mucho menos que la leí fisgoneando, podría enojarse o hasta matarme. Aunque siendo realistas, no vendría mal preguntar para que lo quiere muerto." + "
" + "-¿Y porqué quiere matar a este niño? ¿Tiene alguna habilidad o algo? Preguntas." + "
" + "-Sí, tiene una especie de poder. Pero te lo explicaré terminada la misión. Marcus, tienes que saber que esta es la misión más importante que le aya asignado a cualquiera del equipo, no puedes fallar. Confío en ti para esto. Te llamé temprano para que tengas todo el día para prepararte, pues partirás en la madrugada, para asegurar la misión con las menos víctimas posibles. Quiero que tengas mucho cuidado, pues no podemos estar seguros de que la casa no estará muy protegida." + "
" + "Sabes que no tendría sentido cuestionarlo así que asientes y tomas tus llaves y te diriges a la puerta." + "
" + "-Mucha suerte, Marcus. No me traiciones, y trae al chico muerto aquí."
END
ELSE IF %LIBRO = 0 THEN
BEGIN
$PAGETEXT := $PAGETEXT + "-¿Y porqué quiere matar a este niño? ¿Tiene alguna habilidad o algo? Preguntas." +
" + "-Sí, tiene una especie de poder. Pero te lo explicaré terminada la misión. Marcus, tienes que saber que esta es la misión más importante que le aya asignado a cualquiera del equipo, no puedes fallar. Confío en ti para esto. Te llamé temprano para que tengas todo el día para prepararte, pues partirás en la madrugada, para asegurar la misión con las menos víctimas posibles. Quiero que tengas mucho cuidado, pues no podemos estar seguros de que la casa no estará muy protegida." + "
" + "Sabes que no tendría sentido cuestionarlo así que asientes y tomas tus llaves y te diriges a la puerta." + "
" + "-Mucha suerte, Marcus. No me traiciones, y trae al chico muerto aquí." END

Stuk with a script

4 years ago

Thanks, Mizal, Killa. I tried that and it worked, a little. With some tests, I saw that the problems are caused with (á, é, í, ó, ú, ñ) characters. Of course in spanish these are used to apcentate words, but are there another way to display some extra text in the page deppending on a variable, objecpt, etc.? The scripting doesn't accept that kind of characters.

Stuk with a script

4 years ago
This might be a pain, but I imagine you could use ASCII codes. So something inside the quotes like & # 0225; (without spaces) for the letter á

Stuk with a script

4 years ago

Hi, that could work but... Really? If there's the only way, that will be.

Stuk with a script

4 years ago
Apparently pasting those characters on the page itself works, so you can look at this page that will tell you how you can complete those IF statements in the page without using script, if that's easier.

Stuk with a script

4 years ago

All of those characters should have names (like &iquest; for ¿), so you might be able to enter them in a slightly more readable way by running them through this site with the "allow named character references" option checked.