Working on doors and scripting
This commit is contained in:
1 parent
774397f690
commit
0f2b2e55af
11 files changed
+322
-9
No files matched your search
@@ -52,7 +52,7 @@
|
||||
"positionY": 0.95746,
|
||||
"positionZ": 0.786023,
|
||||
"scale": 0.5,
|
||||
"interactionRadius": 1.5,
|
||||
"interactionRadius": 0.3,
|
||||
"activateFunction": "on_book_pickup"
|
||||
},
|
||||
{
|
||||
@@ -107,6 +107,9 @@
|
||||
"positionX": 1.5,
|
||||
"positionY": 0.975,
|
||||
"positionZ": 6.965,
|
||||
"pivotX": 0.0,
|
||||
"pivotY": 0.0,
|
||||
"pivotZ": 0.565,
|
||||
"scale": 1.0,
|
||||
"interactionRadius": 0.5,
|
||||
"activateFunction": "on_library_door_click"
|
||||
@@ -121,6 +124,9 @@
|
||||
"positionX": -1.5,
|
||||
"positionY": 0.975,
|
||||
"positionZ": 6.965,
|
||||
"pivotX": 0.0,
|
||||
"pivotY": 0.0,
|
||||
"pivotZ": 0.565,
|
||||
"scale": 1.0,
|
||||
"interactionRadius": 0.5,
|
||||
"activateFunction": "on_teachers_door_click"
|
||||
@@ -136,6 +142,9 @@
|
||||
"positionY": 0.975,
|
||||
"positionZ": 8,
|
||||
"scale": 1.0,
|
||||
"pivotX": 0.565,
|
||||
"pivotY": 0.0,
|
||||
"pivotZ": 0.0,
|
||||
"interactionRadius": 0.5,
|
||||
"activateFunction": "on_hall_door_click"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"positionX": -0.141875,
|
||||
"positionY": 0.0,
|
||||
"positionZ": 9.75898,
|
||||
"radius": 2.0,
|
||||
"radius": 1.7,
|
||||
"hysteresis": 0.1,
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
@@ -69,10 +69,70 @@
|
||||
"type": "End"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "door_night_dialog001",
|
||||
"start": "line_1",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "line_1",
|
||||
"type": "Line",
|
||||
"speaker": "Бекзат",
|
||||
"portrait": "resources/w/gg/gg2_s_podsvetkoy5.png",
|
||||
"text": "Дверь закрыта на ключ.",
|
||||
"next": "line_2"
|
||||
},
|
||||
{
|
||||
"id": "line_2",
|
||||
"type": "Line",
|
||||
"speaker": "Бекзат",
|
||||
"portrait": "resources/w/gg/gg2_s_podsvetkoy5.png",
|
||||
"text": "Видимо когда я спал, охранник запер дверь.",
|
||||
"next": "line_3"
|
||||
},
|
||||
{
|
||||
"id": "line_3",
|
||||
"type": "Line",
|
||||
"speaker": "Бекзат",
|
||||
"portrait": "resources/w/gg/gg2_s_podsvetkoy5.png",
|
||||
"text": "Это уже не смешно, как я отсюда выберусь?",
|
||||
"next": "end_1"
|
||||
},
|
||||
{
|
||||
"id": "end_1",
|
||||
"type": "End"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "teacher_dialog001",
|
||||
"start": "line_1",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "line_1",
|
||||
"type": "Line",
|
||||
"speaker": "Аида Дженибековна",
|
||||
"portrait": "resources/w/avatar_teacher.png",
|
||||
"text": "Бекзат, не мешай, я занята.",
|
||||
"next": "line_2"
|
||||
},
|
||||
{
|
||||
"id": "line_2",
|
||||
"type": "Line",
|
||||
"speaker": "Бекзат",
|
||||
"portrait": "resources/w/gg/gg2_s_podsvetkoy5.png",
|
||||
"text": "Ладно...",
|
||||
"next": "end_1"
|
||||
},
|
||||
{
|
||||
"id": "end_1",
|
||||
"type": "End"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "teacher_dialog002",
|
||||
"start": "line_1",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "line_1",
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
|
||||
|
||||
hall_door_opened = false
|
||||
teacher_door_opened = false
|
||||
lection_is_over = false
|
||||
|
||||
player_hold_book = false
|
||||
player_hold_knife = false
|
||||
teacher_arrived = false
|
||||
teacher_told_about_book = false
|
||||
|
||||
night_time = false
|
||||
|
||||
@@ -55,6 +58,7 @@ game_api.npc_walk_to(0, -4.57412, 0, 6.78495, on_teacher_arrived2)
|
||||
end
|
||||
|
||||
function on_book_pickup()
|
||||
if (teacher_told_about_book) then
|
||||
if not player_hold_book then
|
||||
game_api.pickup_item("book")
|
||||
game_api.deactivate_interactive_object("Book001")
|
||||
@@ -64,6 +68,7 @@ function on_book_pickup()
|
||||
game_api.activate_interactive_object("Book001")
|
||||
player_hold_book = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function on_bookshelf_clicked()
|
||||
@@ -88,34 +93,52 @@ function on_npc_interact(npc_index)
|
||||
game_api.start_dialogue("knife_dialog001")
|
||||
end
|
||||
if npc_index == 0 then
|
||||
--game_api.start_dialogue("teacher_dialog001")
|
||||
game_api.start_dialogue("teacher_dialog001")
|
||||
--game_api.set_trigger_zone_enabled(2, false)
|
||||
end
|
||||
end
|
||||
|
||||
function teacher_zone001_enter_callback()
|
||||
game_api.start_dialogue("teacher_dialog001")
|
||||
game_api.start_dialogue("teacher_dialog002")
|
||||
game_api.set_trigger_zone_enabled(2, false)
|
||||
teacher_told_about_book = true
|
||||
end
|
||||
|
||||
|
||||
function on_locked_door_click()
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
-- Example: uncomment and replace "DoorName" to animate a door open over 1.5 seconds
|
||||
-- game_api.rotate_object("DoorName", 90, 1.5, function()
|
||||
-- print("Door finished opening!")
|
||||
-- end)
|
||||
end
|
||||
|
||||
function on_library_door_click()
|
||||
if (night_time) then
|
||||
game_api.start_dialogue("door_night_dialog001")
|
||||
else
|
||||
if (not lection_is_over) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function on_teachers_door_click()
|
||||
if (not lection_is_over) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
else
|
||||
if (not teacher_door_opened) then
|
||||
teacher_door_opened = true
|
||||
game_api.rotate_object("Room_S_2_Leaf001", 90, 0.5, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function on_hall_door_click()
|
||||
if (not hall_door_opened) then
|
||||
hall_door_opened = true
|
||||
game_api.rotate_object("Hall_Leaf001", 90, 0.5, nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -151,13 +174,19 @@ function on_computer_clicked()
|
||||
end
|
||||
end
|
||||
|
||||
function on_teacher_arrived_intermediate()
|
||||
game_api.rotate_object("Room_N_2_Leaf001", -90, 0.5, nil)
|
||||
game_api.npc_walk_to(0, 3.19574, 0, 6.45595, on_teacher_arrived)
|
||||
end
|
||||
|
||||
|
||||
game_api.set_cutscene_callback("test_cutscene_01", function()
|
||||
print("Cutscene done!")
|
||||
lection_is_over = true
|
||||
if (player_hold_knife == false) then
|
||||
game_api.set_npc_enabled(1, true)
|
||||
end
|
||||
game_api.npc_walk_to(0, 3.19574, 0, 6.45595, on_teacher_arrived)
|
||||
game_api.npc_walk_to(0, 0.916388, 0, 6.32083, on_teacher_arrived_intermediate)
|
||||
end)
|
||||
|
||||
game_api.set_cutscene_callback("test_cutscene_02", function()
|
||||
@@ -165,6 +194,7 @@ game_api.set_cutscene_callback("test_cutscene_02", function()
|
||||
night_time = true
|
||||
game_api.set_npc_enabled(0, false)
|
||||
game_api.switch_navigation(0)
|
||||
game_api.rotate_object("Room_N_2_Leaf001", 90, 0.01, nil)
|
||||
end)
|
||||
|
||||
game_api.set_trigger_zone_callbacks("teacher_dialog_zone001",
|
||||
|
||||
Reference in new issue
Block a user