add dialogue and cutscene system
This commit is contained in:
1 parent
178f69967b
commit
7125674308
23 files changed
+1619
-2
No files matched your search
@@ -47,6 +47,23 @@ void ScriptEngine::init(Game* game) {
|
||||
npcs[index]->setTarget(Eigen::Vector3f(x, y, z), std::move(cb));
|
||||
});
|
||||
|
||||
api.set_function("start_dialogue",
|
||||
[game](const std::string& dialogueId) {
|
||||
if (!game->requestDialogueStart(dialogueId)) {
|
||||
std::cerr << "[script] start_dialogue failed for id: " << dialogueId << "\n";
|
||||
}
|
||||
});
|
||||
|
||||
api.set_function("set_dialogue_flag",
|
||||
[game](const std::string& flag, int value) {
|
||||
game->setDialogueFlag(flag, value);
|
||||
});
|
||||
|
||||
api.set_function("get_dialogue_flag",
|
||||
[game](const std::string& flag) {
|
||||
return game->getDialogueFlag(flag);
|
||||
});
|
||||
|
||||
runScript("resources/start.lua");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user