Converting vehicle and building workflow to blender2ogre

This commit is contained in:
2025-09-20 05:52:24 +03:00
parent 62e14cf075
commit e967844558
143 changed files with 12687 additions and 51 deletions

View File

@@ -137,6 +137,7 @@ function Quest(name, book)
return
end
if event == "narration_progress" then
print(" in progress...")
this:_narration()
elseif event == "narration_answered" then
local answer = narration_get_answer()
@@ -157,6 +158,7 @@ function Quest(name, book)
local have_choice = false
local have_paragraph = false
if not this.active then
print("not active")
return
end
if this.story:can_continue() then
@@ -191,10 +193,6 @@ function Quest(name, book)
else
print("can NOT continue")
end
if not have_choice and not have_paragraph then
this:complete()
this.active = false
end
print(ret)
if (#choices > 0) then
print("choices!!!")
@@ -202,6 +200,12 @@ function Quest(name, book)
else
narrate(ret)
end
if not have_choice and not have_paragraph then
this:complete()
this.active = false
else
print("can continue")
end
end,
complete = function(this)
print(this.name .. 'complete')
@@ -224,6 +228,11 @@ function StartGameQuest()
quest.activate = function(this)
print('activate...')
local mc_is_free = function()
this.boat_id = ecs_vehicle_set("boat", 0, 0, -20, 1.75)
this.trigger_id = ecs_child_character_trigger(this.boat_id, "entered_boat", 0, 0, 0, 3, 3)
this.boat = true
local npc = ecs_npc_set("normal-female.glb", 0, 2, -20, 1.75)
ecs_character_physics_control(npc, false)
ecs_character_params_set("player", "gravity", true)
ecs_character_params_set("player", "buoyancy", true)
end
@@ -234,15 +243,13 @@ function StartGameQuest()
this.base.complete(this)
this.active = false
if not this.boat then
local boat = ecs_vehicle_set("boat", 0, 0, -20, 1.75)
local trigger = ecs_child_character_trigger(boat, "entered_boat", 0, 0, 0, 3, 3)
local npc = ecs_npc_set("normal-female.glb", 0, 2, -20, 1.75)
this.boat = true
ecs_save_object_debug(boat, 'boat.scene')
end
end
return quest
end
quests = {}
-- ecs_set_debug_drawing(true)
setup_handler(function(event)
print(event)
for k, v in pairs(quests) do
@@ -253,12 +260,11 @@ setup_handler(function(event)
if event == "startup" then
main_menu()
elseif event == "narration_progress" then
_narration()
print("narration progress!")
elseif event == "narration_answered" then
local answer = narration_get_answer()
story:choose(answer)
print("answered:", answer)
_narration()
elseif event == "new_game" then
ecs_character_params_set("player", "gravity", true)
ecs_character_params_set("player", "buoyancy", false)