From 73b21853c8b21c4b4c9859369c2f01df5c30f793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Mon, 30 Sep 2024 07:51:45 +0200 Subject: [PATCH] character controller: use dofile instead of require to load conversations because require didn't work correctly for some paths --- Content/scripts/character_controller/character_controller.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Content/scripts/character_controller/character_controller.lua b/Content/scripts/character_controller/character_controller.lua index cdcd9109f..16bbe13d3 100644 --- a/Content/scripts/character_controller/character_controller.lua +++ b/Content/scripts/character_controller/character_controller.lua @@ -24,8 +24,6 @@ -- R: reload script -- ENTER: interaction -package.path = package.path .. ";" .. script_dir() .. "assets/?.lua;" -- allows using require from the assets directory to load .lua files - local debug = false -- press H to toggle local framerate_lock = false local framerate_lock_target = 20 @@ -862,7 +860,7 @@ runProcess(function() -- add dialog tree if found: if metadata.HasString("dialog") then - npc.dialogs = require("dialogs/" .. metadata.GetString("dialog")) + npc.dialogs = dofile(script_dir() .. "assets/dialogs/" .. metadata.GetString("dialog") .. ".lua") end -- Add patrol waypoints if found: