Working on navigation
This commit is contained in:
1 parent
87fb6d4655
commit
f52b6872b0
17 files changed
+9030
-469
No files matched your search
+101
-123
@@ -196,7 +196,7 @@ function on_quest_over()
|
||||
game_api.set_npc_enabled(4, false)
|
||||
game_api.set_npc_enabled(5, false)
|
||||
game_api.quest_set_objective_completed("ghost_release", "ghost_release_show")
|
||||
|
||||
|
||||
game_api.start_cutscene("game_complete_cutscene001")
|
||||
end
|
||||
|
||||
@@ -232,10 +232,8 @@ function on_library_door_click()
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
|
||||
print("Library door step 1")
|
||||
|
||||
|
||||
if (game_api.is_night()) then
|
||||
print("Library door step 2")
|
||||
print("morning_did_open_door_index")
|
||||
@@ -249,7 +247,7 @@ function on_library_door_click()
|
||||
print("Library door step 4")
|
||||
end
|
||||
print("Library door step5")
|
||||
--[[
|
||||
--[[
|
||||
if (game_api.is_night() and not game.is_dawn()) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
@@ -282,57 +280,55 @@ function on_teachers_door_click()
|
||||
game_api.start_dialogue("door_teacher_dialog001")
|
||||
end
|
||||
else
|
||||
|
||||
if (game_api.is_dawn()) then
|
||||
print("morning_can_open_door_index is")
|
||||
print(morning_can_open_door_index)
|
||||
|
||||
|
||||
if (teacher_door_opened == false) then
|
||||
teacher_door_opened = true
|
||||
if (morning_can_open_door_index == 3) then
|
||||
morning_did_open_door_index = 3
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
game_api.switch_navigation(10)
|
||||
else
|
||||
if (morning_did_open_door_index == 1) then
|
||||
--s1 + s3
|
||||
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(16)
|
||||
|
||||
elseif (morning_did_open_door_index == 2) then
|
||||
--s2 + s3
|
||||
|
||||
--s2 + s3
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(15)
|
||||
elseif (morning_did_open_door_index == 5) then
|
||||
--n3 + s3
|
||||
|
||||
--n3 + s3
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(13)
|
||||
elseif (morning_did_open_door_index == 4) then
|
||||
--n2 + s3
|
||||
|
||||
--n2 + s3
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(14)
|
||||
elseif (morning_did_open_door_index == 6) then
|
||||
--hall + s3
|
||||
|
||||
--hall + s3
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
@@ -349,29 +345,24 @@ function on_teachers_door_click()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif (game_api.is_night()) then
|
||||
if (teacher_door_opened == false) then
|
||||
teacher_door_opened = true
|
||||
|
||||
|
||||
if (morning_can_open_door_index == 3) then
|
||||
morning_did_open_door_index = 3
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
else
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
game_api.switch_navigation(10)
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -397,7 +388,6 @@ function on_hall_door_click()
|
||||
if not (morning_did_open_door_index == 6) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -405,11 +395,11 @@ 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 not (morning_did_open_door_index == 1) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
--[[
|
||||
if (morning_can_open_door_index == 1) then
|
||||
@@ -434,15 +424,15 @@ 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 not (morning_did_open_door_index == 2) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
if (morning_can_open_door_index == 2) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
@@ -462,22 +452,20 @@ function on_s2_door_click()
|
||||
end
|
||||
|
||||
function on_n2_door_click()
|
||||
|
||||
|
||||
--print("player_left_darklands")
|
||||
--print(player_left_darklands)
|
||||
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 not (morning_did_open_door_index == 4) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
|
||||
--[[
|
||||
if (morning_can_open_door_index == 4) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 4
|
||||
@@ -586,7 +574,7 @@ function on_sleep_cutscene()
|
||||
game_api.set_object_alpha("Room_Cover_North_1_001", 1)
|
||||
game_api.set_object_alpha("Room_Cover_Main_Hall_001", 1)
|
||||
game_api.activate_interactive_object("Note001")
|
||||
|
||||
|
||||
teacher_door_opened = false
|
||||
end
|
||||
|
||||
@@ -714,7 +702,6 @@ game_api.set_darklands_callbacks(
|
||||
end
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
morning_can_open_door_index = 3
|
||||
|
||||
elseif (pz <= 0.0) and (pz > -8) and (px >= 1.5) then
|
||||
game_api.activate_interactive_object("Room_Cover_Corridor_001")
|
||||
game_api.deactivate_interactive_object("Room_Cover_North_2_001")
|
||||
@@ -733,11 +720,10 @@ game_api.set_darklands_callbacks(
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end
|
||||
morning_can_open_door_index = 0
|
||||
|
||||
end
|
||||
|
||||
|
||||
if (morning_can_open_door_index == 0) or (morning_can_open_door_index==3) then
|
||||
|
||||
|
||||
if (morning_can_open_door_index == 0) or (morning_can_open_door_index == 3) then
|
||||
game_api.setIntValue("morning_player_can_leave", 1)
|
||||
game_api.getIntValue("morning_aiperi_save_again", 0)
|
||||
else
|
||||
@@ -747,8 +733,6 @@ game_api.set_darklands_callbacks(
|
||||
game_api.getIntValue("morning_aiperi_save_again", 1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
@@ -828,7 +812,7 @@ function setDay1MorningSetup()
|
||||
--[[if (teacher_door_opened) then
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
else]]
|
||||
game_api.activate_interactive_object("Room_Cover_South_3_001")
|
||||
game_api.activate_interactive_object("Room_Cover_South_3_001")
|
||||
--end
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
game_api.activate_interactive_object("Room_Cover_Main_Hall_001")
|
||||
@@ -853,7 +837,7 @@ function setDay1MorningSetup()
|
||||
game_api.set_object_alpha("Room_Cover_South_3_001", 1)
|
||||
game_api.set_object_alpha("Room_Cover_Corridor_001", 1)
|
||||
game_api.set_object_alpha("Room_Cover_Main_Hall_001", 1)
|
||||
|
||||
|
||||
-- TODO: Make check for teacher_door_opened false or true
|
||||
|
||||
game_api.set_npc_enabled(0, false)
|
||||
@@ -884,7 +868,6 @@ function setDay1MorningSetup()
|
||||
game_api.set_object_rotation("Room_S_2_Leaf001", 90)
|
||||
|
||||
game_api.switch_navigation(10)
|
||||
|
||||
elseif morning_did_open_door_index == 4 then
|
||||
game_api.deactivate_interactive_object("Room_Cover_North_2_001")
|
||||
game_api.set_object_rotation("Room_N_1_Leaf001", -90)
|
||||
@@ -911,9 +894,9 @@ function setDay1MorningSetup()
|
||||
end
|
||||
else
|
||||
if (teacher_door_opened) then
|
||||
game_api.switch_navigation(10)
|
||||
game_api.switch_navigation(10)
|
||||
else
|
||||
game_api.switch_navigation(17)
|
||||
game_api.switch_navigation(17)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1012,10 +995,10 @@ game_api.set_chat_callbacks(
|
||||
function()
|
||||
if (game_api.is_night()) then
|
||||
if (game_api.is_dawn()) then
|
||||
if not (morning_can_open_door_index == 0) and not (morning_can_open_door_index==3) then
|
||||
if not (morning_can_open_door_index == 0) and not (morning_can_open_door_index == 3) then
|
||||
game_api.start_dialogue("phone_morning_aiperi001")
|
||||
else
|
||||
--TODO: add aiperi that she already came to the uni
|
||||
--TODO: add aiperi that she already came to the uni
|
||||
end
|
||||
else
|
||||
local asked_help_locked = game_api.getIntValue("asked_help_locked")
|
||||
@@ -1045,7 +1028,7 @@ function on_aiperi_opens_door()
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
|
||||
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
@@ -1071,7 +1054,7 @@ function on_aiperi_opens_door()
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
|
||||
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
@@ -1091,32 +1074,31 @@ function on_aiperi_opens_door()
|
||||
end
|
||||
elseif (morning_can_open_door_index == 4) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 4
|
||||
game_api.start_dialogue("door_unlock_dialog001")
|
||||
morning_did_open_door_index = 4
|
||||
game_api.start_dialogue("door_unlock_dialog001")
|
||||
|
||||
game_api.rotate_object("Room_N_1_Leaf001", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
game_api.rotate_object("Room_N_1_Leaf001", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(14)
|
||||
else
|
||||
game_api.switch_navigation(11)
|
||||
end
|
||||
|
||||
--Aiperi incoming
|
||||
game_api.npc_set_position(1, 0, 0, -1.7911)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, 2.11898, 0, -1.7074, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(3.36055, 0, -2.0345, nil)
|
||||
game_api.switch_navigation(14)
|
||||
else
|
||||
game_api.switch_navigation(11)
|
||||
end
|
||||
|
||||
--Aiperi incoming
|
||||
game_api.npc_set_position(1, 0, 0, -1.7911)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, 2.11898, 0, -1.7074, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(3.36055, 0, -2.0345, nil)
|
||||
end
|
||||
elseif (morning_can_open_door_index == 2) then
|
||||
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 2
|
||||
game_api.start_dialogue("door_unlock_dialog001")
|
||||
@@ -1125,25 +1107,23 @@ function on_aiperi_opens_door()
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
|
||||
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(15)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(15)
|
||||
else
|
||||
game_api.switch_navigation(9)
|
||||
end
|
||||
--Aiperi incoming
|
||||
game_api.npc_set_position(1, 0, 0, -1.7911)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, -2.454, 0, -1.61871, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(-3.63363, 0, -1.50727, nil)
|
||||
game_api.npc_set_position(1, 0, 0, -1.7911)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, -2.454, 0, -1.61871, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(-3.63363, 0, -1.50727, nil)
|
||||
end
|
||||
|
||||
|
||||
elseif (morning_can_open_door_index == 1) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 1
|
||||
@@ -1154,21 +1134,21 @@ function on_aiperi_opens_door()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
if (teacher_door_opened) then
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(16)
|
||||
game_api.fade_object("Room_Cover_South_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
end)
|
||||
game_api.switch_navigation(16)
|
||||
else
|
||||
game_api.switch_navigation(8)
|
||||
end
|
||||
|
||||
|
||||
--Aiperi incoming
|
||||
game_api.npc_set_position(1, 0, 0, -9.77948)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, -2.53977, 0, -9.77852, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(-3.64494, 0, -9.66711, nil)
|
||||
game_api.npc_set_position(1, 0, 0, -9.77948)
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(1, -2.53977, 0, -9.77852, function()
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end)
|
||||
game_api.player_walk_to(-3.64494, 0, -9.66711, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1184,25 +1164,24 @@ game_api.set_location_callbacks(
|
||||
local hp = game_api.getFloatValue("player_hp")
|
||||
game_api.set_player_hp(hp)
|
||||
local day = game_api.getIntValue("day")
|
||||
|
||||
|
||||
print("day is:")
|
||||
print(day)
|
||||
|
||||
if (day > 0) and (game_api.is_night()==false) then
|
||||
if (day > 0) and (game_api.is_night() == false) then
|
||||
print("entered day setup")
|
||||
setDay1setup()
|
||||
game_api.switch_navigation(3)
|
||||
end
|
||||
|
||||
|
||||
print("entered exited-")
|
||||
|
||||
|
||||
if (was_darklands) and (game_api.is_darklands() == false) and game_api.is_dawn() then
|
||||
--Player died in exterior and then in the morning returned back
|
||||
print("setDay1MorningSetup entered-")
|
||||
setDay1MorningSetup()
|
||||
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
|
||||
local need_sleep = game_api.getIntValue("need_sleep")
|
||||
@@ -1221,7 +1200,7 @@ game_api.set_location_callbacks(
|
||||
--player_left_darklands = false
|
||||
local hp = game_api.get_player_hp()
|
||||
game_api.setFloatValue("player_hp", hp)
|
||||
|
||||
|
||||
was_darklands = game_api.is_darklands()
|
||||
end
|
||||
)
|
||||
@@ -1236,9 +1215,9 @@ function debugAllOpen()
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_1_001")
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_2_001")
|
||||
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
|
||||
|
||||
|
||||
game_api.rotate_object("Hall_Leaf001", 90, 0.5, nil)
|
||||
|
||||
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
game_api.rotate_object("Room_S_1_Leaf001", 90, 0.5, nil)
|
||||
game_api.rotate_object("Room_S_0_Leaf001", 90, 0.5, nil)
|
||||
@@ -1246,7 +1225,6 @@ function debugAllOpen()
|
||||
game_api.rotate_object("Room_N_2_Leaf001", -90, 0.5, nil)
|
||||
end
|
||||
|
||||
|
||||
game_api.set_cutscene_callback("game_complete_cutscene001", function()
|
||||
print("---Cutscene done!")
|
||||
game_api.return_to_main_menu()
|
||||
|
||||
Reference in new issue
Block a user