Some small problem with sound & code

Started by Dokk, June 30, 2018, 11:23:47 AM

Previous topic - Next topic
Hello. I have a problem with voice in my quest. In this code speech comes together with dialog:

function board_1:on_interaction()
game:start_dialog("board.hello")
sol.audio.play_sound("ok")
end


But I need to start "ok" speech only after "board.hello" dialog will end. What I must to do with this code?
I'm making first russian quest on SE

game:start_dialog() takes an optional second parameter of type function, that will be called when the dialog finishes. In other words:
Code (lua) Select

function board_1:on_interaction()
  game:start_dialog("board.hello", function()
    sol.audio.play_sound("ok")
  end)
end

June 30, 2018, 01:11:23 PM #2 Last Edit: June 30, 2018, 09:54:12 PM by Dokk
Christopho, yes, it works! I'm noob. Thank you so much :D
I'm making first russian quest on SE