How do I make dialogues with letter that has accents or in a foreign language?
The reason this article has been marked is: needs to be re-written for user-defined menus
Including special characters in dialogues is rather easy. The first thing you need to check the state of your font table. Edit a text and press control and space. If you see plenty of blank spaces, then you should import a new one. Click on the link above for more details.
Now that you have letters with accents, let's see the different ways to integrate them.
A simple text box and control & space key =[edit]
That's the most simple way. Edit the text boxes. Pick up a free one. When you want to type the character with accent press control and space. You access the font table. Use the arrow to pick up the character you need. Valid with enter
You display the text with the dedicated command show text box
#--------------------------------------------------------------------------------------- script, npc dialogue, begin suspend player suspend npc show text box (125) wait for text resume player resume npcs end #end of the script #---------------------------------------------------------------------------------------
With a string and a textbox[edit]
To do so, we're going to need the expand ascii command. How does this command works? Well it's simple. The first one is the string. The second one is the character number such a defined by your font table.
For example capital A is linked to the number 65.
So if your want to make appear this letter with this command using string number 9 you'll write.
append ascii (9, 65)
So let's write a simple sentence
Hola, ¿Ha visto a Sanchez? No, la mañana pasada fue a iglesia buscar pero no lo ví
It's spanish and it can be translated to
Hello, have you seen Sanchez? No, yesterday morning I went to the church to search for him but I didn't see him.
So how to proceed? String lenghts are limited. So it's best use several here. We're going to use three strings string 9, string 10 & string 11 Remember that string can't do several things at the same time. So make sure that those are free, which means that does already stored something when the script is triggered.
One you've chosen your numbers, go under custom. Edit the text boxes and pick a free one. Here it will be text box 17. Give each line a string:
So you must see
${s9} ${s10} ${s11}
inside your text box.
No you can go edit your hss file. Insert the following script.
script, dialogue with accents, begin suspend player suspend npcs show text box (17) wait for text box resume player resume npcs end
Then copy and paste the text. Identifies the letter with accents or other punctuation signs.
script, dialogue with accents, begin suspend player suspend npcs Hola, ¿Ha visto a Sanchez? No, la mañana pasada fue a iglesia para buscarlo pero no lo ví show text box (17) wait for text box resume player resume npcs end
Here, we have 3 ASCII to append
¿ => inversed question mark (punctuation sign specific to spanish) ñ => letter with accent í => another letter with accent
Check your font table for the character code and note them. Now we can start adding the strings
script, dialogue with accents, begin suspend player suspend npcs $9= "Hola." append ascii (9, 176) $9+"Ha visto a Sanchez? \n " # $10+"No La ma" append ascii (9, 188) #n tidle $10+"ada pasada " #fin de ligne 1 L1 & string 9 $11= " yo fui en la iglesia para buscarlo. " #L2 & string 10 $11= " pero no lo v" #L3 & string 11 append ascii (11, 180) #letter i with an accent $11+"." #final point wait (2) show text box (17) wait for text box resume player resume npcs end
Have you noticed the mark
\n
This mark enable you to change line in the text box. Keep that in mind when you try to keying text directly through strings.
What else to do? The last thing you need to do is to test and make display text box 17. You may need to make some changes or there may be error with the character code, so text may appear with strange letters.
As you can see, it is really unconvinient to append ASCII one letter at a time. If you're making dialogue in a foreign language, you need to be able to key in letters with accent or specific punctuation sign easily.
The first method we saw is the one more likely to met your need.
Another big drawback is that you need to have the model of the sentence with you and sadly you cannot put even in comments letters with accents in a hss file.
But there are time form some reasons, you need to use fake text boxes or same text box with a particular look or that we want to be able to make appear several lines of a dialogue with accent on screen through plotscrpting so how should we do that ?
That what we're going to see next.
With a fake textbox and plotscripting[edit]
So let's take again the simple sentences from the previous section
Hola, ¿Ha visto a Sanchez? No, la mañana pasada fue a iglesia para buscarlo pero no lo ví
As we saw at the beginning of the article, type them in a text box under custom. This time we're using text box 18 and only one string
script, dialogue with accents, begin suspend player suspend npcs textbox text (9, 18) variable (box) box:= create rect (320, 55, 0) #1rst number witdh, 2nd number height, 3rd number style. Can take value only from 0 to 14. set rect trans (box, true) show string at (9, 10, 10) wait (3) wait for key (key: space) if (key is pressed (key: space)) then, begin clear string (9) free slice (box) resume player resume npcs wait (2) end #end for the if exit script #very important. Prevent the script from pooping up again end# end of the script
As you can see you can have a really good result with the command textbox text! Two accent and a specific punctuation sign in one time with only one string!
If you need only one word or a few, you can use the command
textbox line (string ID, textbox)
It's useful if you have a name of a person with a special writing and you want this name to appear
on a dialogue in english let's say.
How to make advance dialogues?[edit]
To come