Working on navigation
This commit is contained in:
1 parent
87fb6d4655
commit
f52b6872b0
17 files changed
+9030
-469
No files matched your search
+70
-77
@@ -9,11 +9,11 @@ alik_door_opened = false
|
||||
|
||||
|
||||
local function step2()
|
||||
game_api.npc_walk_to(0, 1.03298, 0, -4.61801, step1)
|
||||
game_api.npc_walk_to(0, 1.03298, 0, -4.61801, step1)
|
||||
end
|
||||
|
||||
function step1()
|
||||
game_api.npc_walk_to(0, -6.65295, 0, 4.15397, step2)
|
||||
game_api.npc_walk_to(0, -6.65295, 0, 4.15397, step2)
|
||||
end
|
||||
|
||||
step1()
|
||||
@@ -28,12 +28,12 @@ function on_npc_interact(npc_index)
|
||||
local player_alik_aware = game_api.getIntValue("alik_aware")
|
||||
local player_container_aware = game_api.getIntValue("player_container_aware")
|
||||
if player_container_aware == 1 then
|
||||
game_api.start_dialogue("dialog_alik003")
|
||||
game_api.start_dialogue("dialog_alik003")
|
||||
elseif player_alik_aware == 1 then
|
||||
game_api.start_dialogue("dialog_alik002")
|
||||
game_api.setIntValue("player_container_aware", 1)
|
||||
game_api.start_dialogue("dialog_alik002")
|
||||
game_api.setIntValue("player_container_aware", 1)
|
||||
else
|
||||
game_api.start_dialogue("dialog_alik001")
|
||||
game_api.start_dialogue("dialog_alik001")
|
||||
end
|
||||
end
|
||||
if npc_index == 0 then
|
||||
@@ -44,21 +44,20 @@ function on_npc_interact(npc_index)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function on_phone_pickup()
|
||||
game_api.pickup_item("phone")
|
||||
game_api.deactivate_interactive_object("Phone001")
|
||||
game_api.start_dialogue("dialog_phone_pickup001")
|
||||
phone_picked_up = true
|
||||
game_api.quest_set_objective_completed("tutorial_take_items", "take_phone")
|
||||
game_api.pickup_item("phone")
|
||||
game_api.deactivate_interactive_object("Phone001")
|
||||
game_api.start_dialogue("dialog_phone_pickup001")
|
||||
phone_picked_up = true
|
||||
game_api.quest_set_objective_completed("tutorial_take_items", "take_phone")
|
||||
end
|
||||
|
||||
function on_journal_pickup()
|
||||
game_api.pickup_item("journal")
|
||||
game_api.deactivate_interactive_object("Journal001")
|
||||
game_api.start_dialogue("dialog_journal_pickup001")
|
||||
journal_picked_up = true
|
||||
game_api.quest_set_objective_completed("tutorial_take_items", "take_journal")
|
||||
game_api.pickup_item("journal")
|
||||
game_api.deactivate_interactive_object("Journal001")
|
||||
game_api.start_dialogue("dialog_journal_pickup001")
|
||||
journal_picked_up = true
|
||||
game_api.quest_set_objective_completed("tutorial_take_items", "take_journal")
|
||||
end
|
||||
|
||||
--[[
|
||||
@@ -81,33 +80,33 @@ game_api.set_trigger_zone_callbacks("pickup_phone_zone001",
|
||||
)]]
|
||||
|
||||
function ladder_zone001_enter_callback()
|
||||
game_api.start_dialogue("dialog_second_floor001")
|
||||
game_api.start_dialogue("dialog_second_floor001")
|
||||
end
|
||||
|
||||
game_api.set_trigger_zone_callbacks("ladder_zone001",
|
||||
ladder_zone001_enter_callback,
|
||||
nil
|
||||
ladder_zone001_enter_callback,
|
||||
nil
|
||||
)
|
||||
|
||||
function taxi_zone001_enter_callback()
|
||||
game_api.start_dialogue("dialog_taxi001")
|
||||
game_api.call_tutorial_taxi_required()
|
||||
game_api.start_dialogue("dialog_taxi001")
|
||||
game_api.call_tutorial_taxi_required()
|
||||
end
|
||||
|
||||
game_api.set_trigger_zone_callbacks("taxi_zone001",
|
||||
taxi_zone001_enter_callback,
|
||||
nil
|
||||
taxi_zone001_enter_callback,
|
||||
nil
|
||||
)
|
||||
|
||||
function on_bed_sleep()
|
||||
if (not game_api.is_night()) then
|
||||
game_api.start_dialogue("dialog_no_sleep001")
|
||||
else
|
||||
game_api.start_cutscene("sleep_cutscene001")
|
||||
game_api.setIntValue("need_sleep", 0)
|
||||
game_api.set_player_hp(200)
|
||||
--game_api.set_day() - done in cutscene
|
||||
end
|
||||
if (not game_api.is_night()) then
|
||||
game_api.start_dialogue("dialog_no_sleep001")
|
||||
else
|
||||
game_api.start_cutscene("sleep_cutscene001")
|
||||
game_api.setIntValue("need_sleep", 0)
|
||||
game_api.set_player_hp(200)
|
||||
--game_api.set_day() - done in cutscene
|
||||
end
|
||||
end
|
||||
|
||||
function on_alik_bathroom_click()
|
||||
@@ -119,57 +118,52 @@ function on_locked_door_click()
|
||||
end
|
||||
|
||||
function on_sleep_cutscene()
|
||||
print("Cutscene 2 done!")
|
||||
print("Cutscene 2 done!")
|
||||
night_time = true
|
||||
game_api.set_day()
|
||||
end
|
||||
|
||||
|
||||
function on_alik_door_click()
|
||||
if (alik_door_opened == false) then
|
||||
alik_door_opened = true
|
||||
game_api.start_dialogue("door_alik_dialog001")
|
||||
alik_door_opened = true
|
||||
game_api.start_dialogue("door_alik_dialog001")
|
||||
|
||||
game_api.rotate_object("Door_Room_-1_-1_1_Leaf_001", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_LivingRoom_W_S_2_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_S_2_001")
|
||||
end)
|
||||
|
||||
if (bathroom_door_opened) then
|
||||
game_api.switch_navigation(5) -- all open
|
||||
else
|
||||
game_api.switch_navigation(4) --b
|
||||
end
|
||||
|
||||
game_api.rotate_object("Door_Room_-1_-1_1_Leaf_001", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_LivingRoom_W_S_2_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_S_2_001")
|
||||
end)
|
||||
|
||||
if (bathroom_door_opened) then
|
||||
game_api.switch_navigation(5) -- all open
|
||||
else
|
||||
game_api.switch_navigation(4) --b
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function on_player_bathroom_click()
|
||||
if (bathroom_door_opened == false) then
|
||||
bathroom_door_opened = true
|
||||
game_api.start_dialogue("door_bathroom_dialog001")
|
||||
bathroom_door_opened = true
|
||||
game_api.start_dialogue("door_bathroom_dialog001")
|
||||
|
||||
game_api.rotate_object("Door_Bath_-1_1_1_Leaf_002", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Bath_W_N_2_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Bath_W_N_2_001")
|
||||
end)
|
||||
|
||||
game_api.rotate_object("Door_Bath_-1_1_1_Leaf_002", -90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Bath_W_N_2_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Bath_W_N_2_001")
|
||||
end)
|
||||
|
||||
if (player_door_opened) then
|
||||
if (alik_door_opened) then
|
||||
|
||||
if (player_door_opened) then
|
||||
if (alik_door_opened) then
|
||||
game_api.switch_navigation(5) ---all open
|
||||
else
|
||||
game_api.switch_navigation(3) -- a
|
||||
end
|
||||
else
|
||||
game_api.switch_navigation(1) --ca
|
||||
game_api.switch_navigation(3) -- a
|
||||
end
|
||||
else
|
||||
game_api.switch_navigation(1) --ca
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function on_player_door_click()
|
||||
if (not phone_picked_up) or (not journal_picked_up) then
|
||||
game_api.start_dialogue("dialog_phone001")
|
||||
@@ -178,20 +172,20 @@ function on_player_door_click()
|
||||
player_door_opened = true
|
||||
game_api.player_stop()
|
||||
game_api.rotate_object("Door_Room_-1_1_1_Leaf_001", 90, 0.25, nil)
|
||||
|
||||
|
||||
game_api.fade_object("Room_Cover_Main_Hall_And_Corridors_002", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Main_Hall_And_Corridors_002")
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
game_api.fade_object("Room_Cover_Utility_W_N_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Utility_W_N_3_001")
|
||||
end)
|
||||
|
||||
|
||||
game_api.fade_object("Room_Cover_Utility_W_S_3_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Utility_W_S_3_001")
|
||||
end)
|
||||
|
||||
|
||||
if (bathroom_door_opened) then
|
||||
game_api.switch_navigation(3) --a
|
||||
else
|
||||
@@ -201,7 +195,6 @@ function on_player_door_click()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
game_api.set_enter_night_callback(
|
||||
function()
|
||||
game_api.start_dialogue("dialog_video001")
|
||||
@@ -234,23 +227,23 @@ game_api.set_chat_callbacks(
|
||||
)
|
||||
|
||||
function on_aiperi_dialog_over()
|
||||
print("on_aiperi_dialog_over called")
|
||||
print("on_aiperi_dialog_over called")
|
||||
|
||||
game_api.close_phone()
|
||||
game_api.close_phone()
|
||||
end
|
||||
|
||||
game_api.set_location_callbacks(
|
||||
function()
|
||||
function()
|
||||
print("Enter location dorm")
|
||||
local hp = game_api.getFloatValue("player_hp")
|
||||
local hp = game_api.getFloatValue("player_hp")
|
||||
game_api.set_player_hp(hp)
|
||||
game_api.set_teleport_active(0, false)
|
||||
end,
|
||||
function()
|
||||
end,
|
||||
function()
|
||||
print("Exit location dorm")
|
||||
local hp = game_api.get_player_hp()
|
||||
local hp = game_api.get_player_hp()
|
||||
game_api.setFloatValue("player_hp", hp)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_N_2_001")
|
||||
@@ -267,4 +260,4 @@ game_api.set_call_taxi_callback(
|
||||
|
||||
|
||||
game_api.switch_navigation(0)
|
||||
print("Lua script loaded successfully--!")
|
||||
print("Lua script loaded successfully--!")
|
||||
Reference in new issue
Block a user