Working on new dialogues

This commit is contained in:
Vladislav Khorev committed 2026-07-04 22:45:47 +03:00
1 parent f7e63f933b
commit 8a6366098c
10 files changed
+8388 -70

No files matched your search

+85 -55
View File
@@ -4,7 +4,7 @@ teacher_door_opened = false
player_hold_book = false
player_hold_knife = false
player_hold_key = false
--player_hold_key = false
teacher_arrived = false
teacher_told_about_book = false
@@ -30,14 +30,12 @@ morning_did_open_door_index = 0
ghost_gone = false
function dialog_aiperi_give_key()
if (player_hold_key == false) then
local player_hold_key = game_api.getIntValue("player_hold_key")
if (player_hold_key == 0) then
game_api.pickup_item("teacher_room_key")
game_api.quest_unlock("aiperi_knife")
game_api.quest_set_objective_completed("aiperi_knife", "aiperi_knife_keys")
player_hold_key = true
print("dialog_aiperi_give_key, player_hold_key set to")
print(player_hold_key)
game_api.setIntValue("player_hold_key", 1)
local aiperi_chat_opened = game_api.getIntValue("aiperi_chat_opened")
@@ -68,12 +66,13 @@ game_api.set_trigger_zone_callbacks("lection_hall_zone001",
function knife_dialog_zone001_enter_callback()
print("knife_dialog_zone001_enter_callback--!")
local day = game_api.getIntValue("day")
local player_hold_key = game_api.getIntValue("player_hold_key")
if (day == 0) then
if (player_hold_knife == false) then
local lection_is_over = game_api.getIntValue("lection_is_over")
if lection_is_over == 1 then
if (player_hold_key) then
if (player_hold_key==1) then
game_api.start_dialogue("knife_dialog002")
else
game_api.start_dialogue("knife_dialog001")
@@ -159,14 +158,15 @@ end
function on_npc_interact(npc_index)
local player_ghost_aware = game_api.getIntValue("ghost_aware")
local player_hold_key = game_api.getIntValue("player_hold_key")
local day = game_api.getIntValue("day")
print("[Lua] NPC interaction! Index: " .. tostring(npc_index))
if npc_index == 1 then
local day = game_api.getIntValue("day")
if (game_api.is_dawn()) or (day > 0) then
game_api.start_dialogue("dialog_aiperi_morning001")
else
if (player_hold_key) then
if (player_hold_key==1) then
game_api.start_dialogue("knife_dialog002")
else
game_api.start_dialogue("knife_dialog001")
@@ -174,6 +174,29 @@ function on_npc_interact(npc_index)
end
end
if npc_index == 0 then
if (day == 0) then
if (teacher_told_about_book) then
game_api.start_dialogue("teacher_dialog006")
else
game_api.start_dialogue("teacher_dialog001")
end
else
local player_has_coursework = game_api.getIntValue("player_has_coursework")
local player_has_report_card = game_api.getIntValue("player_has_report_card")
local report_card_signed = game_api.getIntValue("report_card_signed")
if (report_card_signed == 1) then
game_api.start_dialogue("teacher_dialog004")
elseif (player_has_coursework == 1 and player_has_report_card == 1) then
game_api.start_dialogue("teacher_dialog005")
game_api.remove_item("coursework")
game_api.setIntValue("report_card_signed", 1)
else
game_api.start_dialogue("teacher_dialog007")
end
end
--[[
if (player_ghost_aware == 1) then
--game_api.setIntValue("player_has_coursework", 1)
local player_has_coursework = game_api.getIntValue("player_has_coursework")
@@ -181,19 +204,17 @@ function on_npc_interact(npc_index)
local report_card_signed = game_api.getIntValue("report_card_signed")
if (report_card_signed == 1) then
game_api.start_dialogue("teacher_dialog002")
game_api.start_dialogue("teacher_dialog004")
elseif (player_has_coursework == 1 and player_has_report_card == 1) then
game_api.start_dialogue("teacher_dialog005")
game_api.remove_item("coursework")
game_api.setIntValue("report_card_signed", 1)
elseif (player_has_coursework == 1) then
game_api.start_dialogue("teacher_dialog004")
else
game_api.start_dialogue("teacher_dialog003")
game_api.start_dialogue("teacher_dialog007")
end
else
game_api.start_dialogue("teacher_dialog001")
end
end]]
end
if npc_index == 2 then
local report_card_signed = game_api.getIntValue("report_card_signed")
@@ -238,12 +259,12 @@ function on_library_door_click()
if (day == 0) then
if game_api.is_dawn() then
game_api.start_dialogue("door_dialog001")
game_api.start_dialogue("door_dialog007")
elseif game_api.is_night() then
game_api.start_dialogue("door_night_dialog001")
else
if (lection_is_over == 0) then
game_api.start_dialogue("door_dialog001")
game_api.start_dialogue("door_dialog003")
end
end
else
@@ -268,14 +289,15 @@ end
function on_teachers_door_click()
print("on_teachers_door_click---")
local player_hold_key = game_api.getIntValue("player_hold_key")
local day = game_api.getIntValue("day")
print("day is")
print(day)
if (day == 0) and not game_api.is_dawn() then
if (player_hold_key) then
if (player_hold_key==1) then
if (not teacher_door_opened) then
teacher_door_opened = true
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
@@ -285,7 +307,7 @@ function on_teachers_door_click()
game_api.switch_navigation(3)
end
else
game_api.start_dialogue("door_teacher_dialog001")
game_api.start_dialogue("door_dialog004")
end
else
if (game_api.is_dawn()) then
@@ -381,17 +403,21 @@ function on_hall_door_click()
local day = game_api.getIntValue("day")
if (day == 0) and not game_api.is_dawn() then
if (not hall_door_opened) then
hall_door_opened = true
game_api.switch_navigation(1)
game_api.rotate_object("Hall_Leaf001", 90, 0.5, nil)
game_api.fade_object("Room_Cover_Main_Hall_001", 0, 0.5, function()
game_api.deactivate_interactive_object("Room_Cover_Main_Hall_001")
end)
game_api.set_npc_enabled(0, true)
game_api.set_npc_enabled(6, true)
game_api.npc_rotate_to(6, 180)
if (day == 0) then
if (game_api.is_dawn()) then
game_api.start_dialogue("door_dialog007")
else
if (not hall_door_opened) then
hall_door_opened = true
game_api.switch_navigation(1)
game_api.rotate_object("Hall_Leaf001", 90, 0.5, nil)
game_api.fade_object("Room_Cover_Main_Hall_001", 0, 0.5, function()
game_api.deactivate_interactive_object("Room_Cover_Main_Hall_001")
end)
game_api.set_npc_enabled(0, true)
game_api.set_npc_enabled(6, true)
game_api.npc_rotate_to(6, 180)
end
end
else
if (game_api.is_night()) then
@@ -403,37 +429,41 @@ function on_hall_door_click()
end
function on_s1_door_click()
--if (player_left_darklands) then
if (game_api.is_night()) then
if not (morning_did_open_door_index == 1) then
game_api.start_dialogue("door_dialog001")
end
if (day == 0) and(game_api.is_dawn()) then
game_api.start_dialogue("door_dialog007")
else
game_api.start_dialogue("door_dialog001")
if (game_api.is_night()) then
if not (morning_did_open_door_index == 1) then
game_api.start_dialogue("door_dialog001")
end
else
game_api.start_dialogue("door_dialog006")
end
end
end
function on_s2_door_click()
--if (player_left_darklands) then
if (game_api.is_night()) then
if not (morning_did_open_door_index == 2) then
game_api.start_dialogue("door_dialog001")
end
if (day == 0) and(game_api.is_dawn()) then
game_api.start_dialogue("door_dialog007")
else
game_api.start_dialogue("door_dialog001")
if (game_api.is_night()) then
if not (morning_did_open_door_index == 2) then
game_api.start_dialogue("door_dialog001")
end
else
game_api.start_dialogue("door_dialog006")
end
end
end
function on_n2_door_click()
print("morning_can_open_door_index")
print(morning_can_open_door_index)
print("morning_did_open_door_index")
print(morning_did_open_door_index)
if (game_api.is_night()) then
if not (morning_did_open_door_index == 4) then
game_api.start_dialogue("door_dialog001")
if (day == 0) and(game_api.is_dawn()) then
game_api.start_dialogue("door_dialog007")
else
if (game_api.is_night()) then
if not (morning_did_open_door_index == 4) then
game_api.start_dialogue("door_dialog001")
end
end
end
end
@@ -1012,6 +1042,8 @@ game_api.set_enter_night_callback(
game_api.set_chat_callbacks(
function()
local player_hold_key = game_api.getIntValue("player_hold_key")
if (game_api.is_night()) then
if (game_api.is_dawn()) then
local morning_player_can_leave = game_api.getIntValue("morning_player_can_leave")
@@ -1054,9 +1086,7 @@ game_api.set_chat_callbacks(
print("dialogx step 4")
if (lection_is_over == 1) then
print("dialogx step 5")
print("player_hold_key")
print(player_hold_key)
if (player_hold_key == false) then
if (player_hold_key == 0) then
print("dialogx step 6")
game_api.start_dialogue("dialog_chat_aiperi002")
end