diff --git a/RootDesk/MyDesk/LobbyMobility.codeblock b/RootDesk/MyDesk/LobbyMobility.codeblock index a17c0b8..f86f89a 100644 --- a/RootDesk/MyDesk/LobbyMobility.codeblock +++ b/RootDesk/MyDesk/LobbyMobility.codeblock @@ -47,7 +47,7 @@ "Name": null }, "Arguments": [], - "Code": "self.Tries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.Tries = self.Tries + 1\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil and lp.PlayerControllerComponent ~= nil then\n\t\tlocal pc = lp.PlayerControllerComponent\n\t\tpc.Enable = true\n\t\tpc.FixedLookAt = false\n\t\tlocal rb = lp.RigidbodyComponent\n\t\tif rb ~= nil then rb.WalkAcceleration = 0.7 end\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.Tries > 50 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", + "Code": "self.Tries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.Tries = self.Tries + 1\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil and lp.PlayerControllerComponent ~= nil then\n\t\tlocal pc = lp.PlayerControllerComponent\n\t\tpc.Enable = true\n\t\tpc.FixedLookAt = 0\n\t\tlocal rb = lp.RigidbodyComponent\n\t\tif rb ~= nil then rb.WalkAcceleration = 0.7 end\n\t\tlocal mv = lp.MovementComponent\n\t\tif mv ~= nil then\n\t\t\tmv.InputSpeed = 5\n\t\t\tmv.JumpForce = 5\n\t\tend\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.Tries > 50 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", "Scope": 2, "ExecSpace": 6, "Attributes": [], diff --git a/RootDesk/MyDesk/PlayerLock.codeblock b/RootDesk/MyDesk/PlayerLock.codeblock index a0bc96d..5eb1aa8 100644 --- a/RootDesk/MyDesk/PlayerLock.codeblock +++ b/RootDesk/MyDesk/PlayerLock.codeblock @@ -47,7 +47,7 @@ "Name": null }, "Arguments": [], - "Code": "self.LockTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.LockTries = self.LockTries + 1\n\tlocal pc = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tpc = lp.PlayerControllerComponent\n\tend\n\tif pc ~= nil then\n\t\tpc.LookDirectionX = 1\n\t\tpc.FixedLookAt = true\n\t\tpc.Enable = false\n\tend\n\tif lp ~= nil and lp.RigidbodyComponent ~= nil then\n\t\tlp.RigidbodyComponent.WalkAcceleration = 0\n\tend\n\tif pc ~= nil then\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.LockTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", + "Code": "self.LockTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.LockTries = self.LockTries + 1\n\tlocal pc = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tpc = lp.PlayerControllerComponent\n\tend\n\tif pc ~= nil then\n\t\tpc.LookDirectionX = 1\n\t\tpc.FixedLookAt = true\n\t\tpc.Enable = false\n\tend\n\tif lp ~= nil then\n\t\tif lp.RigidbodyComponent ~= nil then lp.RigidbodyComponent.WalkAcceleration = 0 end\n\t\tif lp.MovementComponent ~= nil then lp.MovementComponent.InputSpeed = 0; lp.MovementComponent.JumpForce = 0 end\n\tend\n\tif pc ~= nil then\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.LockTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", "Scope": 2, "ExecSpace": 6, "Attributes": [], diff --git a/tools/map/gen-lobby-map.mjs b/tools/map/gen-lobby-map.mjs index e5f361c..f949865 100644 --- a/tools/map/gen-lobby-map.mjs +++ b/tools/map/gen-lobby-map.mjs @@ -47,6 +47,10 @@ function makeSpriteEntity(base, name, x, y, ruid, withInteract, npcId) { m.jsonString.name = name; m.path = `/maps/lobby/${name}`; m.jsonString.path = m.path; + // NOTE: 베이스 모델(chasemonster)이 script.Monster/MonsterAttack를 inheritance로 끌고 와서 + // DuplicateComponent(LobbyNpc와 공존) 경고 + MonsterAttack.OnBeginPlay AnimationClip 에러가 뜬다. + // 둘 다 비치명적(로비엔 전투 컨텍스트가 없어 Monster는 휴면, 에러는 전투맵 몬스터와 공유되는 기존 lint). + // modelId를 비우면 fresh load에서 렌더가 깨질 위험이 있어 proven-good(모델 유지)로 둔다. const tr = compOf(m, 'MOD.Core.TransformComponent'); if (tr) { tr.Position.x = x; tr.Position.y = y; } const sp = compOf(m, 'MOD.Core.SpriteRendererComponent'); diff --git a/tools/player/gen-lobby-npc.mjs b/tools/player/gen-lobby-npc.mjs index 2d18e09..59fdf3e 100644 --- a/tools/player/gen-lobby-npc.mjs +++ b/tools/player/gen-lobby-npc.mjs @@ -4,7 +4,11 @@ import { writeFileSync } from 'node:fs'; // · LobbyNpc — NPC 엔티티에 부착. 근접 폴링→머리위 마크 토글, TouchEvent(클릭)/UpArrow(근접)→Interact→컨트롤러 호출. // · LobbyMobility — 로비 맵 루트에 부착. 진입 시 플레이어 이동 잠금 해제(정찰 확정: WalkAcceleration이 진짜 레버). // 공격 키(LeftControl) 바인딩은 SlayDeckController(/common, 1회 등록·로비 가드)에서 처리 — 여기 두지 않음. -const WALK_ACCEL = 0.7; // 정찰: freeze가 0으로 만든 RigidbodyComponent.WalkAcceleration 복원값(이동·점프 정상 확인) +// 정찰: 이동에는 RigidbodyComponent.WalkAcceleration(가속)과 MovementComponent.InputSpeed(속도)가 +// 둘 다 양수여야 함 — freeze-turn-player가 둘 다 0으로 만들었으므로 둘 다 복원해야 걷는다(실측 확인). +const WALK_ACCEL = 0.7; +const WALK_SPEED = 5; +const JUMP_FORCE = 5; const PROX = 1.2; // 근접 임계(맵 NPC 간격 2.5와 분리) function prop(Type, Name, DefaultValue = 'nil') { @@ -77,9 +81,14 @@ local function apply() if lp ~= nil and lp.PlayerControllerComponent ~= nil then local pc = lp.PlayerControllerComponent pc.Enable = true - pc.FixedLookAt = false + pc.FixedLookAt = 0 local rb = lp.RigidbodyComponent if rb ~= nil then rb.WalkAcceleration = ${WALK_ACCEL} end + local mv = lp.MovementComponent + if mv ~= nil then + mv.InputSpeed = ${WALK_SPEED} + mv.JumpForce = ${JUMP_FORCE} + end _TimerService:ClearTimer(eventId) elseif self.Tries > 50 then _TimerService:ClearTimer(eventId) diff --git a/tools/player/gen-player-lock.mjs b/tools/player/gen-player-lock.mjs index d5169c4..80bf445 100644 --- a/tools/player/gen-player-lock.mjs +++ b/tools/player/gen-player-lock.mjs @@ -65,8 +65,9 @@ local function apply() pc.FixedLookAt = ${FIXED_LOOK_AT} pc.Enable = ${CONTROLLER_ENABLE} end - if lp ~= nil and lp.RigidbodyComponent ~= nil then - lp.RigidbodyComponent.WalkAcceleration = 0 + if lp ~= nil then + if lp.RigidbodyComponent ~= nil then lp.RigidbodyComponent.WalkAcceleration = 0 end + if lp.MovementComponent ~= nil then lp.MovementComponent.InputSpeed = 0; lp.MovementComponent.JumpForce = 0 end end if pc ~= nil then _TimerService:ClearTimer(eventId)