space-game001/resources/start_uni_exterior.lua
2026-05-17 14:39:02 +03:00

54 lines
1.3 KiB
Lua

print("Lua script loaded successfully!")
game_api.set_location_callbacks(
function()
-- player just arrived here
if game_api.is_darklands() then
-- arrived while in darklands mode
end
end,
function()
-- player is about to leave
end
)
function darklands_exit001_enter_callback()
if game_api.is_darklands() then
print("Lua script start_darklands_transition")
game_api.start_darklands_transition()
end
end
function on_container_clicked()
game_api.start_dialogue("dialog_contaier001")
end
game_api.set_darklands_callbacks(
nil,
function()
print("Lua script start_darklands_transition callback")
game_api.start_cutscene("darklands_exit001")
game_api.setIntValue("day", 1)
game_api.setIntValue("need_sleep", 1)
local need_sleep = game_api.getIntValue("need_sleep")
print("Lua script need sleep =")
print(need_sleep)
print("Lua script set need sleep 1")
game_api.set_player_hp(10)
end
)
game_api.set_trigger_zone_callbacks("darklands_exit001",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit002",
darklands_exit001_enter_callback,
nil
)
game_api.set_trigger_zone_callbacks("darklands_exit003",
darklands_exit001_enter_callback,
nil
)