Working on dorm navigation
This commit is contained in:
1 parent
715f2e8c31
commit
8c200974c2
54 files changed
+15832
-15
No files matched your search
+100
-1
@@ -2,6 +2,12 @@
|
||||
-- NPC PATROL WAYPOINTS
|
||||
-- ============================================
|
||||
|
||||
bathroom_door_opened = false
|
||||
player_door_opened = false
|
||||
alik_door_opened = false
|
||||
|
||||
|
||||
|
||||
local function step2()
|
||||
game_api.npc_walk_to(0, 1.03298, 0, -4.61801, step1)
|
||||
end
|
||||
@@ -53,6 +59,7 @@ game_api.start_dialogue("dialog_journal_pickup001")
|
||||
journal_picked_up = true
|
||||
end
|
||||
|
||||
--[[
|
||||
function pickup_phone_zone001_enter_callback()
|
||||
print("pickup_phone_zone001_enter_callback--!")
|
||||
if (not phone_picked_up) or (not journal_picked_up) then
|
||||
@@ -69,7 +76,7 @@ end
|
||||
game_api.set_trigger_zone_callbacks("pickup_phone_zone001",
|
||||
pickup_phone_zone001_enter_callback,
|
||||
pickup_phone_zone001_exit_callback
|
||||
)
|
||||
)]]
|
||||
|
||||
function ladder_zone001_enter_callback()
|
||||
game_api.start_dialogue("dialog_second_floor001")
|
||||
@@ -93,6 +100,93 @@ game_api.set_player_hp(200)
|
||||
end
|
||||
end
|
||||
|
||||
function on_alik_bathroom_click()
|
||||
game_api.start_dialogue("door_bathroom_alik_dialog001")
|
||||
end
|
||||
|
||||
function on_locked_door_click()
|
||||
game_api.start_dialogue("door_locked_dialog001")
|
||||
end
|
||||
|
||||
|
||||
|
||||
function on_alik_door_click()
|
||||
if (alik_door_opened == false) then
|
||||
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
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function on_player_bathroom_click()
|
||||
if (bathroom_door_opened == false) then
|
||||
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)
|
||||
|
||||
|
||||
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
|
||||
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")
|
||||
else
|
||||
if (player_door_opened == false) then
|
||||
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
|
||||
game_api.switch_navigation(2) --ba
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
game_api.set_location_callbacks(
|
||||
function()
|
||||
print("Enter location dorm")
|
||||
@@ -106,5 +200,10 @@ game_api.set_location_callbacks(
|
||||
end
|
||||
)
|
||||
|
||||
game_api.deactivate_interactive_object("Room_Cover_LivingRoom_W_N_2_001")
|
||||
|
||||
game_api.rotate_object("Door_Utility_-1_1_2_Leaf_001", 90, 0.01, nil)
|
||||
game_api.rotate_object("Door_Utility_-1_-1_2_Leaf_001", -90, 0.01, nil)
|
||||
|
||||
game_api.switch_navigation(0)
|
||||
print("Lua script loaded successfully--!")
|
||||
Reference in new issue
Block a user