[Solarus 1.4] NPC Dialog

Started by Yruama, June 14, 2015, 06:45:57 PM

Previous topic - Next topic
Hi.

I don't find the doc for dialog.
How can i answer a question with the new editor ?

Thanks

Just as before I think: Just add a
$?
and the whole line after it becomes a possible answer.

Nothing changes in dialogs features with the new editor.
The question/answer system is not documented in the Lua API because it simply does not exist :) It is up to quests to implement it. In the tutorials, I use indeed the $? syntax to turn a line into a question with an arrow cursor at this position.

I DL the source code of ZSDX and i look what you do.

Found_fairy.1 :

Que vas-tu en faire ?
Récupérer des Coeurs
La conserver


There is no

$?

What this means ? : http://puu.sh/ipSDk/6adbf6da90.png

ZSDX is older, it does not use the $? syntax, but adds a field "question = true" to add a question. And the answers are implicitly the last two lines of the final group of 3 lines of the dialog.
The $? of the tutorial quest is more powerful. Any line can be an answer or not, and the cursor position on the line can be customized.

There are a function to add a sprite at the left of the dialob box ?
Or i have to create a new sprite ?

July 08, 2015, 03:51:34 PM #6 Last Edit: July 08, 2015, 04:23:23 PM by Christopho
You can customize the drawing yourself by defining the on:draw() event of your dialog box.

This is the case in ZSDX. If you are using the dialog box from ZSDX, then dialogs have an optional property "icon", which is a number referring to a 16x16 icon in the image "sprites/hud/dialog_icons.png". When this property is set, the corresponding icon is displayed on the left of the dialog box.

If you are using the dialog box from the tutorial, or another one, there is nothing to draw additional images or sprite, so you have to do some work yourself in the on:draw() event.


I just edited my message because I was not completely accurate. The dialog box of the tutorial does implement an on:draw() event (this is actually mandatory if you want to see anything :P)), but has no support for displaying additional sprites.