So I've tried whatcha suggested, but it seems like a whole new error arose even still, and I think it's because I'm putting what you suggested in the wrong place. I was also unclear whether or not the text property was supposed to draw the dialog on the screen or print that text in the console. What am I missing here? Where can I find the info you used to get this straight? Here's the script, do you see anything wrong with it? Oh, and just for context, it's generating an exception that says it's trying to index a global variable called "dialog" that's nil.
local map = ...
local game = map:get_game()
-- Event called at initialization time, as soon as this map is loaded.
function map:on_started()
map.small_keys_savegame_variable = "Underwell"
require("scripts/language_manager")
require("debug_dialog.lua")
require("scripts/menus/dialog_box")
require("scripts/menus/alttp_dialog_box")
end
function sensor:on_activated()
game:set_ability("sword", 1)
hero:start_victory(hero:freeze())
hero:set_direction(3)
sol.audio.play_sound("treasure")
sol.timer.start(1000,function()
sol.audio.play_music("sanctuary", true)
dialog{
id = "sword.first",
next = "sword.second",
text = [[
show this dialog first.
]]}
dialog{
id = "sword.second",
text = [[
Then show this dialog.
]]}
sol.audio.stop_music()
sol.audio.play_music("light_world_dungeon", true)
hero:unfreeze()
end)
end