From f1d101f6a41c2f39d06804c2da58e442fd4626c2 Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 9 Jun 2026 23:35:58 +0900 Subject: [PATCH] =?UTF-8?q?feat(map-camera):=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=91=20=EC=8B=9C=20=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=96=B4=20=EC=9E=85=EB=A0=A5=20=EC=B0=A8=EB=8B=A8=C2=B7?= =?UTF-8?q?=EC=98=A4=EB=A5=B8=EC=AA=BD=20=EB=B0=94=EB=9D=BC=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=20+=20map01=20=EB=AA=AC=EC=8A=A4=ED=84=B0=203?= =?UTF-8?q?=EB=A7=88=EB=A6=AC=20=EB=B0=B0=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MapCamera 스크립트(맵 진입 OnBeginPlay)가 카메라에 더해 플레이어도 셋업: - PlayerControllerComponent.LookDirectionX=1 (오른쪽 — 기본은 -1 왼쪽) - FixedLookAt=true (방향 고정) - Enable=false (키보드 입력 차단: 이동/점프/공격) - map01: 몬스터 3마리 배치(사용자 의도 변경 포함) - 메이커 Play 검증: LookDirectionX=1·Enable=false 확인, 오른쪽키 입력→플레이어 미이동(입력 차단), 아바타 정상, 카메라 zoom90·offset(1.5,-1) 유지 Co-Authored-By: Claude Opus 4.8 (1M context) --- RootDesk/MyDesk/MapCamera.codeblock | 2 +- map/map01.map | 148 +--------------------------- tools/gen-camera.mjs | 11 +++ 3 files changed, 15 insertions(+), 146 deletions(-) diff --git a/RootDesk/MyDesk/MapCamera.codeblock b/RootDesk/MyDesk/MapCamera.codeblock index b9810fc..0f0fe49 100644 --- a/RootDesk/MyDesk/MapCamera.codeblock +++ b/RootDesk/MyDesk/MapCamera.codeblock @@ -47,7 +47,7 @@ "Name": null }, "Arguments": [], - "Code": "self.CamTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.CamTries = self.CamTries + 1\n\tlocal cam = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tcam = lp.CameraComponent\n\tend\n\tif cam == nil then\n\t\tcam = _CameraService:GetCurrentCameraComponent()\n\tend\n\tif cam ~= nil then\n\t\tcam.ZoomRatio = 90\n\t\tcam.ScreenOffset = Vector2(0.5, 0.655)\n\t\tcam.ConfineCameraArea = true\n\t\tcam.CameraOffset = Vector2(1.5, -1)\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.CamTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)", + "Code": "self.CamTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.CamTries = self.CamTries + 1\n\tlocal cam = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tcam = lp.CameraComponent\n\tend\n\tif cam == nil then\n\t\tcam = _CameraService:GetCurrentCameraComponent()\n\tend\n\tif cam ~= nil then\n\t\tcam.ZoomRatio = 90\n\t\tcam.ScreenOffset = Vector2(0.5, 0.655)\n\t\tcam.ConfineCameraArea = true\n\t\tcam.CameraOffset = Vector2(1.5, -1)\n\tend\n\tlocal pc = nil\n\tif lp ~= nil then\n\t\tpc = lp.PlayerControllerComponent\n\t\tif pc ~= nil then\n\t\t\tpc.LookDirectionX = 1\n\t\t\tpc.FixedLookAt = true\n\t\t\tpc.Enable = false\n\t\tend\n\tend\n\tif cam ~= nil and pc ~= nil then\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.CamTries > 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/map/map01.map b/map/map01.map index 0bb0ea2..01f5e66 100644 --- a/map/map01.map +++ b/map/map01.map @@ -6483,8 +6483,8 @@ }, { "@type": "MOD.Core.MovementComponent", - "Enable": false, - "InputSpeed": 0 + "InputSpeed": 0, + "Enable": false }, { "@type": "script.Monster", @@ -6533,7 +6533,7 @@ { "@type": "MOD.Core.TransformComponent", "Position": { - "x": 6.6, + "x": 2.08546019, "y": 0.03499998, "z": 999.999 }, @@ -6805,148 +6805,6 @@ ], "@version": 1 } - }, - { - "id": "a6d1d4be-0b0a-4581-b2a8-a3cddecb44bd", - "path": "/maps/map01/monster-43", - "componentNames": "MOD.Core.TransformComponent,MOD.Core.StateAnimationComponent,MOD.Core.SpriteRendererComponent,MOD.Core.RigidbodyComponent,MOD.Core.MovementComponent,MOD.Core.StateComponent,MOD.Core.HitComponent,MOD.Core.DamageSkinSpawnerComponent,script.Monster,script.MonsterAttack,MOD.Core.KinematicbodyComponent,MOD.Core.SideviewbodyComponent", - "jsonString": { - "name": "monster-43", - "path": "/maps/map01/monster-43", - "nameEditable": true, - "enable": true, - "visible": true, - "localize": false, - "displayOrder": 7, - "pathConstraints": "///", - "revision": 1, - "origin": { - "type": "Model", - "entry_id": "MoveMonster", - "sub_entity_id": null, - "root_entity_id": "a6d1d4be-0b0a-4581-b2a8-a3cddecb44bd", - "replaced_model_id": null - }, - "modelId": "movemonster", - "@components": [ - { - "@type": "MOD.Core.TransformComponent", - "Position": { - "x": 2.4, - "y": 1.27528822, - "z": 999.999 - }, - "QuaternionRotation": { - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "Enable": true - }, - { - "@type": "MOD.Core.StateAnimationComponent", - "ActionSheet": { - "stand": "3eb72eab0a394c78b13e88c8dc4a5ed0", - "move": "c96c11f9a3f845a4b6a27d9ca10ab103", - "hit": "4b67b539c09d4ce183ae6a73f908511f", - "die": "7681817f225a4245a27943da77d5f5b1", - "skill": "75c873675b6d45c38f24c8d7b98b4800", - "attack": "9db703c9da694490965897db7f2d4d92", - "skill2": "beabf049b5e34c25907ae69d2c1f835e", - "skill3": "e84c350104ca436b93db6c502faf53b3", - "skill4": "a5fb992ff4c04431a171bdd2fbfb372c", - "skillAfter4": "53de30457ceb44eca4ef2a81396e6adb", - "attack2": "52c1da942bec459b9d46c81c03233c0c" - }, - "Enable": true - }, - { - "@type": "MOD.Core.SpriteRendererComponent", - "ActionSheet": {}, - "EndFrameIndex": 0, - "RenderSetting": 1, - "SortingLayer": "MapLayer0", - "SpriteRUID": "3eb72eab0a394c78b13e88c8dc4a5ed0", - "StartFrameIndex": 0, - "Enable": true - }, - { - "@type": "MOD.Core.RigidbodyComponent", - "MoveVelocity": { - "x": 0, - "y": 0 - }, - "RealMoveVelocity": { - "x": 0, - "y": 0 - }, - "Enable": true - }, - { - "@type": "MOD.Core.MovementComponent", - "InputSpeed": 0, - "JumpForce": 0, - "Enable": false - }, - { - "@type": "MOD.Core.StateComponent", - "IsLegacy": false, - "Enable": true - }, - { - "@type": "MOD.Core.HitComponent", - "BoxSize": { - "x": 0.87, - "y": 1.04 - }, - "ColliderOffset": { - "x": 0.0150000155, - "y": 0.669999957 - }, - "IsLegacy": false, - "Enable": true - }, - { - "@type": "MOD.Core.DamageSkinSpawnerComponent", - "Enable": true - }, - { - "@type": "script.Monster", - "Enable": true, - "IsDead": false - }, - { - "@type": "script.MonsterAttack", - "Enable": true, - "SpriteSize": { - "x": 0, - "y": 0 - }, - "PositionOffset": { - "x": 0, - "y": 0 - } - }, - { - "@type": "MOD.Core.KinematicbodyComponent", - "MoveVelocity": { - "x": 0, - "y": 0 - }, - "Enable": true - }, - { - "@type": "MOD.Core.SideviewbodyComponent", - "MoveVelocity": { - "x": 0, - "y": 0 - }, - "Enable": true - } - ], - "@version": 1 - } } ] } diff --git a/tools/gen-camera.mjs b/tools/gen-camera.mjs index 5ac6790..d28df39 100644 --- a/tools/gen-camera.mjs +++ b/tools/gen-camera.mjs @@ -64,6 +64,17 @@ local function apply() cam.ScreenOffset = Vector2(${CAM.screenOffsetX}, ${CAM.screenOffsetY}) cam.ConfineCameraArea = ${CAM.confineCameraArea} cam.CameraOffset = Vector2(${CAM.cameraOffsetX}, ${CAM.cameraOffsetY}) + end + local pc = nil + if lp ~= nil then + pc = lp.PlayerControllerComponent + if pc ~= nil then + pc.LookDirectionX = 1 + pc.FixedLookAt = true + pc.Enable = false + end + end + if cam ~= nil and pc ~= nil then _TimerService:ClearTimer(eventId) elseif self.CamTries > 30 then _TimerService:ClearTimer(eventId) -- 2.49.1