Yue Posted April 29 Author Posted April 29 When I don't speak English, when my forte is not mathematics, that's where my perception comes into play, I know how to position rigid bodies correctly on the mesh. Now at least the AI gives me suggestions, and shows me the way to go in the project. -- 💎 Transformar posición del hueso a posición global local localPos = self.bones.head:GetPosition(true) local worldMatrix = self.model:GetMatrix(true) local worldPos = TransformPoint(localPos, worldMatrix, Mat4()) -- desde modelo ➜ mundo -- ✨ Posicionar la esfera en la cabeza self.bodies.head:SetPosition(worldPos) 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 1 Author Posted May 1 After having a long conversation with an AI, I learned how to use these commands, I am not an expert, but trying to do this before was super complicated for me, because sometimes I have more desire than knowledge and that is not enough. The AI explained me the commands with details and exercises and the result is really great. In Leadwerks 4 I couldn't do it, not because I couldn't, but because I didn't have the knowledge I have now. Translated with DeepL.com (free version) function this:UpdateBonesFromBodies() for name, bone in pairs(self.bones) do local body = self.bodies[name] if bone and body then local worldPos = body:GetPosition(true) local modelMatrix = self.model:GetMatrix(true) local localPos = TransformPoint(worldPos, Mat4(), modelMatrix) -- de mundo a modelo bone:SetPosition(localPos, true) local worldRot = body:GetRotation(true) -- rotación global del cuerpo físico local localRot = TransformRotation(worldRot, nil, self.model) bone:SetRotation(localRot, true) end end end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 4 Author Posted May 4 I'm about to give up, but I need to do this effect that keeps me awake at night. A continuous learning process, and it's not that I have the ability, it's that now I'm fighting with the AI and I'm learning by the way. Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 5 Author Posted May 5 Let's go with the synchronization of bones with rigid bodies and joints. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 6 Author Posted May 6 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 6 Author Posted May 6 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 6 Author Posted May 6 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 7 Author Posted May 7 After struggling for a long time with this code I found the perfect solution for the compensation of bones and rigid bodies. function this:AlignBodyToBone(body, bone, offset) local worldPos = TransformPoint(bone:GetPosition(true), self.model, nil) if offset then local offsetWorld = TransformVector(offset, self.model, nil) worldPos = worldPos + offsetWorld end body:SetPosition(worldPos, true) local worldRot = TransformRotation(bone:GetRotation(true), self.model, nil) body:SetRotation(worldRot, true) end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 8 Author Posted May 8 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 8 Author Posted May 8 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 8 Author Posted May 8 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 8 Author Posted May 8 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 9 Author Posted May 9 Next steps, hud, life, oxygen, stamine etc. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 11 Author Posted May 11 I'm still with ragdoll, I'll create a blog to comment on my experience with this new attempt. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 11 Author Posted May 11 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 13 Author Posted May 13 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 13 Author Posted May 13 @Josh Ragdoll Perfect!! 2 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 16 Author Posted May 16 Video Dev Log ▼01 Here I show what I have advanced, Leadwerks 5 is great, and I think I have improved a bit in this coding. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 16 Author Posted May 16 Hud Player. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 18 Author Posted May 18 Main File Lua Script. --##************************************************## --## Proyecto : AstroCuco v0.0 | Pre‑Alpha ## --## Scripters : Yue Rexie & Kara 💙 ## --## Fichero : Main.lua ## --## Fecha : 18 de Mayo 2025 ## --##************************************************## --## Notas : Fichero principal con control ## --## de escenas, GUI y depuración ## --##************************************************## -- Importación de clases base import("Source/Classes/Window.lua") import("Source/Classes/Input.lua") import("Source/Classes/World.lua") import("Source/Classes/GUI.lua") import("Source/Classes/Debug.lua") import("Source/Classes/UI/UI_MainMenu.lua") import("Source/Classes/UI/UI_LoadingScene.lua") import("Source/Classes/UI/UI_Level01.lua") import("Source/Classes/SoundManager.lua") import("Source/Classes/SettingsManager.lua") import("source/Classes/Player.lua") local window = Window:New("AstroCuco", 100, 100, 1280, 720) local input = Input:New(window:GetWindow()) -- 🌍 Mundos. local WMenu3D = World:New("Menu3D") local WLoading = nil local WLevel01 = nil local world = WMenu3D:GetWorld() -- GUIs. local GUIMenu3D = GUI:New(WMenu3D, window) local GUILoading = nil local GUILevel01 = nil local uiMainMenu = UI_MainMenu:New(GUIMenu3D, window) local uiLoading = nil local uiLevel01 = nil ui = uiMainMenu:Get() local Ela = nil local onLevel = 0 while true do collectgarbage() world:Update() if Ela and world:GetName() == "Level01" then Ela:Update() end if ui == uiMainMenu:Get() then local result = ui:Update() if result == true then break elseif result == "return_level01" then world = WLevel01:Get() ui = uiLevel01:Get() onLevel = 0 elseif result =="scene_loading" then WLoading = World:New("Loading") GUILoading = GUI:New(WLoading, window) uiLoading = UI_LoadingScene:New(GUILoading, window) world = WLoading:Get() ui = uiLoading:Get() elseif result == "restart" or result == "restart_confirm" then ui:Destroy() ui = nil window:Destroy() window = nil uiMainMenu:Destroy() if uiLoading then uiLoading:Destroy() uiLoading = nil end if uiLevel01 then uiLevel01:Destroy() uiLevel01 = nil end input:Destroy() input = nil window = Window:New("AstroCuco", 100, 100, 1280, 720) input = Input:New(window:GetWindow()) GUIMenu3D = GUI:New(WMenu3D,window) -- Si te funciona como "uiMainMenu:New" lo dejo, pero lo ideal es llamar al constructor de clase: uiMainMenu = UI_MainMenu:New(GUIMenu3D,window) if WLevel01 then Ela = Player:New(WLevel01,input) uiMainMenu:SetStartMode("continue") GUILevel01 = GUI:New(WLevel01, window) uiLevel01 = UI_Level01:New(GUILevel01, window) end ui = uiMainMenu:Get() if result == "restart" then uiMainMenu:ShowPanelConfirm("Do you confirm\n this new resolution?\n(" .. window:GetWidth() .. " x " .. window:GetHeight() .. ")") end end -- Agregado: chequeo que uiLoading no sea nil antes de llamar uiLoading:Get() elseif uiLoading and ui == uiLoading:Get() then local result = ui:Update() if ui:GetProgress() >= 0.5 and not WLevel01 then uiMainMenu:SetStartMode("continue") input:FlushMouse() WLevel01 = World:New("Level01") GUILevel01 = GUI:New(WLevel01, window) uiLevel01 = UI_Level01:New(GUILevel01, window) end if result == "scene_level01" and WLevel01 then world = WLevel01:Get() ui = uiLevel01:Get() -- Si ya existe Ela, destruir antes de crear nueva if Ela then Ela:Destroy() Ela = nil end Ela = Player:New(world,input) end end -- Retornar desde el nivel if WLevel01 and Ela then if input:GetKeyUp(KEY_ESCAPE) then onLevel = 1 -onLevel end if onLevel== 1 then world = WMenu3D:Get() ui = uiMainMenu:Get() else local center = input:GetWindowCenter() input:SetMousePosition(center.x, center.y) world = WLevel01:Get() ui = uiLevel01:Get() end end world:Render(window:GetFramebuffer()) if input:GetKeyHit(KEY_K) then return end if input:GetKeyHit(KEY_Q) then -- Acción reservada end end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 18 Author Posted May 18 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 19 Author Posted May 19 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 19 Author Posted May 19 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 22 Author Posted May 22 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 22 Author Posted May 22 Recovering Health. Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.