Custom delay for dialogs

Started by boaromayo, March 06, 2019, 02:22:36 PM

Previous topic - Next topic
March 06, 2019, 02:22:36 PM Last Edit: March 06, 2019, 02:27:54 PM by boaromayo
This feature took two and a half hours of programming and testing last night to get this right, but here it is!

I made some modifications to the dialog_box.lua script in the Solarus 1.6 sample quest. For this script add-on, the dialog can pause for any amount of time instead of using the default dialog box script, which only allows for a 1-second delay.

To get this working, use the '$' character, along with the '|' (pipe) character, then in between brackets, set the amount of time (in milliseconds) the dialog is paused, like so:

$|[sec]: the delay in milliseconds (Don't forget the '|' character!)

Sample dialog here:

dialog{
  id = "beavers.eater.1",
  text = [[
$|\[500\].$|\[1000\].$|\[1000\].$|\[1000\]I was hungry.
]]
,
}


Note: When editing the dialogs.dat file directly, you will have to type a backslash before putting in the brackets. When handling it in the editor, it's not needed.

Here is the script in action:



The modified dialog box.lua script is attached below (script is under the GNU GPL v3 license, script author by Christopho, special thanks to him!).

Thank you for sharing. This little effect for the dialog box is a good idea.