Hello girls and guys,
I'm facing an issue here, and due to the fact, that I tried some things on my own and searched for similar topics - I can't quite figure it out myself...
I want to do a cutscene. For me the best option was, to make a script (a menu), in which I have all the funcs on what should happen. A menu, because I want the cutscene to start, when the hero is in a dialog with a npc and gives the right answer on a question.
So long story short, I have this in my MAP-SCRIPT:
local cutscene = require("scripts/cutscene/cutscene_1")
function mentor:on_interaction() --mentor is the npc--
game:start_dialog("mentor", function(answer)
if answer == 1 then
sol.menu.start(game, cutscene)
hero:freeze()
end
end)
end
And then there is the required SCRIPT for the CUTSCENE, build as a menu (not finished):
local cutscene = {}
function cutscene:on_started()
--fade_in effect and timers start--
end
function cutscene:on_finished()
--all timers stop and hero unfreeze--
end
function cutscene:on_draw(dst_surface)
--menu_background and other images are drawn--
end
return cutscene
And her comes the issue: The menu starts like it should, but when it is finished, the hero is still frozen, because if I do hero:unfreeze() in cutscene:on_finished() it doesnt know the value "hero". And I also cant do game:get_hero() at top, because it also doesnt know the value "game".
So is there a way to get the GAME in the script to work with, or am I totally wrong with what I have done with this so far?
Thanks in advance
