[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | `IsMapMoving` 플래그가 true일 때 플레이어의 움직임에 어떤 영향을 주는지, 그리고 이 값을 변경하는 일반적인 조건은 무엇인가요? [answer] | `IsMapMoving` 플래그가 `true`가 되면 플레이어의 조작이 비활성화됩니다. 구체적으로 `CanControl()` 메서드가 `false`를 반환하여 이동 및 액션 입력을 처리하지 않게 됩니다. 이 값을 변경하는 일반적인 조건은 맵 진입과 맵 이탈 이벤트입니다. 1. **맵 진입 시 (`OnMapEnter`)**: `IsMapMoving` 값이 `false`로 설정되어 조작이 활성화됩니다. 2. **맵 이탈 시 (`OnMapLeave`)**: `IsMapMoving` 값이 `true`로 설정되어 조작이 비활성화됩니다 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | 필요한 Property를 아래와 같이 작성합니다. ```lua Property: [None] boolean IsValid = false [None] table ActionKeys = {} [None] table ActionConditions = {} [None] table HoldActions = {} [None] table InteractionKeys = {} [None] table InputKeys = {} [None] table PressedKeys = {} [None] number HorizontalInput = 0 [No
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | CacheComponents 함수에서 self.Entity 를 통해 접근하는 StateComponent 와 MovementComponent 의 차이점이 무엇인가요? [answer] | 제시된 참고 문서에는 `StateComponent`와 `MovementComponent`의 구체적인 기능 차이, 내부 구조, 또는 동작 방식에 대한 설명이 포함되어 있지 않습니다. 문서에서 확인 가능한 정보는 다음과 같습니다: 1. **접근 방식의 동일성**: 두 컴포넌트 모두 `self.Entity`를 통해 직접 접근합니다. ```lua self.StateComponent = entity.StateComponent self.MovementComponent = entity.MovementComponent [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void CacheComponents() { local entity = self.Entity self.StateComponent = entity.StateComponent self.MovementComponent = entity.MovementComponent self.PlayerControllerComponent = entity.PlayerControllerComponent self.RigidbodyComponent = entity.RigidbodyCompone
[task] | two_turn [pass] | ⏳ 미판정 [title] | AvatarAction Editor [question] | `defined_actionname`이 `stand1`인 액션에서 `frameindex` 0번 프레임의 `move_y` 값이 -1로 설정되어 있을 때, 이 값이 아바타의 위치나 애니메이션 재생에 미치는 구체적인 영향은 무엇이며, 이 값을 0으로 수정하려면 JSON의 어떤 부분을 어떻게 변경해야 하나요? [answer] | `frameindex` 0번 프레임의 `move_y` 값이 -1로 설정되어 있을 때, 해당 프레임이 재생되는 동안 아바타는 Y축 방향으로 -1만큼 이동합니다. 이는 애니메이션 재생 중 프레임마다 적용되는 이동 값이므로, 아바타의 위치가 해당 프레임 구간 동안 변화하게 됩니다. 이 값을 0으로 수정하려면 JSON 파일에서 `Data` > `NewAvatarAction` > `Frames` 배열의 첫 번째 객체(즉, `frameindex`가 0인 객체)를 찾아 `move_y` 필드의 값을 `0`으로 변경하면 됩니다. 변경 후 JSO [followup] | 만약 `flip` 속성이 `true`로 변경되면 `move_x`와 `move_y`의 값도 함께 반전되는지, 아니면 좌우 반전에만 적용되는지 구분하는 로직이나 코드 예시가 있나요? [followup_answer] | 제공된 참고 문서에는 `flip` 속성이 `true`로 설정되었을 때 `move_x` 또는 `move_y` 값이 자동으로 반전되는지, 아니면 단순히 렌더링 시 좌우 이미지만 반전되는지에 대한 로직이나 코드 예시가 포함되어 있지 않습니다. 문서에는 `flip` 필드에 대해 "좌우 반전 여부입니다."라고만 정의되어 있으며, 이동 값(`move_x`, `move_y`)과의 상호작용이나 내부 처리 방식에 대한 추가 설명은 없습니다. [scores] | [judge_reason] | [source_doc] | AvatarAction JSON 파일의 구조는 아래와 같습니다. ```lua { "Data": { "NewAvatarAction": { "Frames": [ { "defined_actionname": "stand1", "frameindex": 0, "framedelay": 0.156, "move_x": 0, "move_y": -1, "rotation": 0, "flip":
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | RemoveAllConditions, PassByCondition, IsHoldAction, AddPressedKey, RemovePressedKey 함수들의 실행 공간([client only])과 매개변수, 반환값을 표로 정리해서 출력하세요. [answer] | | 함수명 | 실행 공간 | 매개변수 | 반환값 | | :--- | :--- | :--- | :--- | | `RemoveAllConditions` | `[client only]` | `string actionName` | `void` (없음) | | `PassByCondition` | `[client only]` | `string actionName` | `boolean` | | `IsHoldAction` | `[client only]` | `string actionName` | `boolean` | | `AddPressedKey [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | IsHoldAction 함수가 true를 반환하기 위해 self.HoldActions 테이블에서 해당 액션이 어떤 상태여야 하나요? [answer] | `IsHoldAction` 함수가 `true`를 반환하려면 `self.HoldActions[actionName]` 값이 `nil`이 아니어야 합니다. 즉, 해당 액션 이름(`actionName`)을 키로 하는 항목이 `self.HoldActions` 테이블에 존재해야 합니다. 코드에서는 `self.HoldActions[actionName] ~= nil` 조건을 확인하므로, 값이 `false`나 `0` 등 `nil`이 아닌 어떤 값이든 들어가 있다면 `true`가 반환됩니다. [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | AddPressedKey와 RemovePressedKey 메서드에서 PressedKeys 테이블의 값은 각각 어떤 값으로 설정되나요? [answer] | `AddPressedKey` 메서드에서는 `self.PressedKeys[actionName]` 값을 `true`로 설정합니다. 반면, `RemovePressedKey` 메서드에서는 `self.PressedKeys[actionName]` 값을 `false`로 설정합니다. ```lua [client only] void AddPressedKey(string actionName) { self.PressedKeys[actionName] = true } [client only] void RemovePressedKey(string [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | `AddCondition` 메서드에서 `funcList` 초기화 시 `actionConditions` 변수 재할당 오류가 발생하지 않도록 하는 올바른 코드 수정안만 출력하고 설명은 주석으로 작성하세요. [answer] | `AddCondition` 메서드에서 `actionConditions[actionName]`이 `nil`일 경우, 로컬 변수 `funcList`에 새 테이블을 생성하여 대입해야 합니다. 원본 코드에서는 `actionConditions = funcList`로 로컬 변수 자체를 재할당하고 있어, 실제 `self.ActionConditions` 테이블에는 새로운 조건 함수 리스트가 저장되지 않는 버그가 있습니다. 올바른 수정안은 `funcList`에 생성된 테이블을 대입한 후, 이를 `actionConditions[actionName] [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | 기존 컴포넌트와 동일한 인터페이스의 Action, Condition을 관리할 수 있는 메소드를 만들어봅시다. - `GetActionName()`: 키에 매핑된 액션 이름을 반환합니다. - `SetActionKey()`: 키에 액션 이름을 매핑합니다. - `RemoveActionKey()`: 특정 키의 매핑을 제거합니다. - `RemoveAllActionKeyByActionName()`: 특정 액션에 매핑된 모든 키를 제거합니다. - `AddCondition()`: 액션 실행 조건 함수를 추가합니다. - `RemoveAllCondi
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | RemoveAllConditions 메서드 호출 시 해당 액션의 조건이 어떤 방식으로 삭제되나요? [answer] | `RemoveAllConditions` 메서드는 `self.ActionConditions` 테이블에서 전달된 `actionName`을 키(key)로 찾아 해당 값을 `nil`로 설정하는 방식으로 동작합니다. 구체적인 코드 로직은 다음과 같습니다: ```lua [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } ``` 이 메서드는 클라이언트에서만 실행되며(`[client only]`), 특정 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | PassByCondition 함수에서 특정 액션의 조건 리스트가 nil일 때 반환되는 값은 무엇인가요? [answer] | `PassByCondition` 함수에서 특정 액션의 조건 리스트(`self.ActionConditions[actionName]`)가 `nil`일 경우, 함수는 **`true`**를 반환합니다. 조건 리스트가 존재하지 않는다는 것은 해당 액션에 대해 특별히 만족해야 할 조건이 없음을 의미하므로, 조건을 통과했다고 간주하여 `true`를 반환하도록 로직이 구성되어 있습니다. ```lua [client only] boolean PassByCondition(string actionName) { local funcList = s [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | 이 코드에서 self.StateComponent 등 변수들이 로컬 변수(local)가 아닌 인스턴스 변수로 선언되는 이유는 무엇인가요? [answer] | 제공된 문서의 코드 예시에서 `self.StateComponent`와 같은 변수들이 `local` 변수가 아닌 인스턴스 변수(Property)로 선언되는 이유는 다음과 같습니다. 1. **생성 시점과 사용 시점의 분리**: `CacheComponents()` 메서드(또는 초기화 로직)에서 `self.Entity`로부터 컴포넌트 참조를 가져와 저장한 뒤, 이후 다른 메서드(예: `OnControlEnabled`, `OnMapEnter` 등)에서 해당 컴포넌트를 다시 가져오지 않고 바로 사용하기 위함입니다. `local` 변수는 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void CacheComponents() { local entity = self.Entity self.StateComponent = entity.StateComponent self.MovementComponent = entity.MovementComponent self.PlayerControllerComponent = entity.PlayerControllerComponent self.RigidbodyComponent = entity.RigidbodyCompone
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | PassByCondition 함수의 코드만 출력하고, 각 단계별 로직 설명은 코드 내부 주석으로만 작성하세요. [answer] | ```lua [client only] boolean PassByCondition(string actionName) { -- 1. 해당 액션 이름에 연결된 조건 함수 목록을 가져옴 local funcList = self.ActionConditions[actionName] -- 2. 조건 함수 목록이 없으면(nil) 조건을 통과한 것으로 간주하고 true 반환 if funcList == nil then return true end -- 3. 등록된 모든 조건 함 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | `OnMapEnter`, `OnMapLeave`, `CanControl`, `OnControlEnabled` 메서드의 실행 순서와 역할을 4단계 번호 목록으로 정리하세요. [answer] | 제공된 문서에 따르면, 맵 이동 및 컨트롤 관리에 사용되는 4가지 메서드의 역할과 실행 흐름은 다음과 같습니다. 1. **`OnMapEnter(Entity enteredMap)`** * **역할**: 플레이어가 맵에 진입했을 때 호출됩니다. * **동작**: 매개변수로 받은 `enteredMap`이 존재하면 `self.MapComponent`를 해당 맵의 `MapComponent`로 갱신합니다. 이후 `IsMapMoving` 플래그를 `false`로 설정하고 `OnControlEnabled(true)`를 호 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### 핸들러 메소드 HitEvent 발생 시 StateComponent의 상태를 "HIT"로 변경할 수 있도록 기존 HitEventHandler를 제거하고 커스텀 핸들러를 등록합니다. ```lua Method: [client only] void InitStateComponentEventHandler() { local stateComponent = self.Entity.StateComponent if stateComponent == nil then return end stat
[task] | two_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | 커스텀 PlayerController에서 InteractionComponent의 KeyCode를 직접 관리하기 위해 SetInteractionKey와 RemoveInteractionKey를 어떻게 구현하나요? [answer] | 커스텀 PlayerController 컴포넌트를 사용할 때는 `InteractionComponent`의 `KeyCode`를 직접 관리하기 위해 `SetInteractionKey`와 `RemoveInteractionKey` 메서드를 구현해야 합니다. 두 메서드는 모두 클라이언트에서만 실행되도록 `[client only]` 속성을 지정합니다. 구현 방법은 다음과 같습니다. 1. **`SetInteractionKey(any key)`**: * 먼저 컴포넌트가 유효한지(`self.IsValid`)를 확인하여 유효하지 않으면 [followup] | [client only] 공간에서 self.IsValid 체크를 포함하여 키 등록 및 제거 메서드의 mLua 코드 블록을 작성해 주세요. [followup_answer] | ```lua Method: [client only] void SetInteractionKey(any key) { if not self.IsValid then return end self.InteractionKeys[key] = true } [client only] void RemoveInteractionKey(any key) { self.InteractionKeys[key] = nil } ``` [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | 문서에 명시된 커스텀 액션 이벤트 전송 메서드 이름과 그 역할을 한 문장으로 설명해 주세요. [answer] | `SendActionEventToServer()`는 커스텀 액션 이벤트를 서버로 전송하는 역할을 합니다. [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | `InitEventHandlers()`에서 `InputService`의 키 입력 이벤트에 연결된 핸들러 메소드를 아래와 같이 작성합니다. - `OnKeyDown()`: 키를 누르는 순간의 입력을 처리하여 액션을 실행하고 입력 상태를 갱신합니다. - `SendActionEventToServer()`: 커스텀 액션 이벤트를 서버로 전송합니다. - `OnKeyUp()`: 키에서 손을 떼는 순간의 입력을 처리하여 관련 상태를 해제합니다. - `OnKeyHold()`: 키를 누르고 있는 동안의 입력 상태를 갱신합니다. - `BlockInp
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | SetInteractionKey와 RemoveInteractionKey 메소드를 사용할 때 각각 어떤 데이터 타입의 키를 전달해야 하나요? [answer] | `SetInteractionKey`와 `RemoveInteractionKey` 메서드에 전달하는 키(`key`)의 데이터 타입은 **`any`**입니다. 참고 문서의 메서드 시그니처를 보면 두 메서드 모두 파라미터 타입이 `any`로 정의되어 있습니다. 이는 특정 타입에 제한되지 않고, 다양한 타입의 값을 상호작용 키로 등록하거나 제거할 수 있음을 의미합니다. ```lua [client only] void SetInteractionKey(any key) { if not self.IsValid then ret [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | 커스텀 PlayerController를 만들 때 InteractionComponent의 KeyCode를 직접 관리해야 하는 이유는 무엇인가요? [answer] | PlayerControllerComponent를 대신하여 새로운 커스텀 컴포넌트를 사용하는 경우, InteractionComponent의 KeyCode를 직접 컴포넌트에 등록해야 합니다. 이는 커스텀 컨트롤러가 상호작용 키 입력을 올바르게 감지하고 처리하기 위해 해당 키를 자체적으로 관리해야 하기 때문입니다. 이러한 키 관리를 위해 `SetInteractionKey()`와 `RemoveInteractionKey()` 메서드를 작성하여 상호작용 키의 등록과 제거를 수행합니다. ```lua [client only] void SetI [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | OnKeyDown 처리 흐름에서 조건 불충족 시 호출되는 입력 차단 메서드 명을 코드 블록으로만 출력해 주세요. [answer] | ```lua self:BlockInputKey(key) ``` [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | `InitEventHandlers()`에서 `InputService`의 키 입력 이벤트에 연결된 핸들러 메소드를 아래와 같이 작성합니다. - `OnKeyDown()`: 키를 누르는 순간의 입력을 처리하여 액션을 실행하고 입력 상태를 갱신합니다. - `SendActionEventToServer()`: 커스텀 액션 이벤트를 서버로 전송합니다. - `OnKeyUp()`: 키에서 손을 떼는 순간의 입력을 처리하여 관련 상태를 해제합니다. - `OnKeyHold()`: 키를 누르고 있는 동안의 입력 상태를 갱신합니다. - `BlockInp
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | PassByCondition 함수 내에서 funcList의 요소가 nil인 경우 해당 반복은 어떻게 처리되나요? [answer] | `PassByCondition` 함수에서는 `funcList`를 순회하는 과정에서 각 요소(`func`)가 `nil`인 경우 해당 반복을 건너뜁니다. 구체적인 처리 로직은 다음과 같습니다. ```lua [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void RemoveAllConditions(string actionName) { self.ActionConditions[actionName] = nil } [client only] boolean PassByCondition(string actionName) { local funcList = self.ActionConditions[actionName] if funcList == nil then return true end for i = 1, #fu
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | RemoveInteractionKey에서 self.InteractionKeys[key] = nil로 설정하면 해당 키가 완전히 삭제되는 것인가요? [answer] | 네, 해당 키가 완전히 삭제됩니다. mLua는 Lua 5.3 기반이며, 테이블(table)에서 특정 인덱스의 값을 `nil`로 설정하면 해당 인덱스-값 쌍이 테이블에서 제거됩니다. 따라서 `RemoveInteractionKey` 메서드에서 `self.InteractionKeys[key] = nil`을 실행하면, 해당 `key`가 `InteractionKeys` 테이블에서 삭제되어 더 이상 존재하지 않게 됩니다. 이후 `self.InteractionKeys[key]`를 조회하면 `nil`을 반환하며, 이는 해당 키가 등록되지 않은 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | `GetActionName`, `SetActionKey`, `RemoveActionKey` 메서드의 매개변수 타입과 반환값, 주요 처리 순서를 표로 정리하세요. [answer] | 요청하신 `GetActionName`, `SetActionKey`, `RemoveActionKey` 메서드의 매개변수 타입, 반환값, 그리고 주요 처리 순서를 아래 표로 정리했습니다. | 메서드 이름 | 매개변수 | 반환값 | 주요 처리 순서 | | :--- | :--- | :--- | :--- | | `GetActionName` | `key` (any) | `string`<br>(없으면 `""`) | 1. `self.ActionKeys[key]` 값을 `actionName` 변수에 저장<br>2. `actionName`이 `ni [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | 기존 컴포넌트와 동일한 인터페이스의 Action, Condition을 관리할 수 있는 메소드를 만들어봅시다. - `GetActionName()`: 키에 매핑된 액션 이름을 반환합니다. - `SetActionKey()`: 키에 액션 이름을 매핑합니다. - `RemoveActionKey()`: 특정 키의 매핑을 제거합니다. - `RemoveAllActionKeyByActionName()`: 특정 액션에 매핑된 모든 키를 제거합니다. - `AddCondition()`: 액션 실행 조건 함수를 추가합니다. - `RemoveAllCondi
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | CacheComponents 함수를 OnBeginPlay 대신 OnUpdate 에서 호출하면 어떤 문제가 발생할 수 있나요? [answer] | OnBeginPlay 대신 OnUpdate에서 CacheComponents를 호출할 경우, 매 프레임마다 반복적으로 컴포넌트 참조를 갱신하는 비효율적인 상황이 발생합니다. OnUpdate는 게임이 실행되는 동안 매 프레임마다 호출되는 함수입니다. CacheComponents 함수의 역할은 StateComponent, MovementComponent 등 엔티티의 다양한 컴포넌트 참조를 self 변수에 저장하는 것입니다. 이 작업은 게임 로직이 시작되는 시점(OnBeginPlay)에 한 번만 수행하면 되는 초기화 과정입니다. 만약 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | [client only] void CacheComponents() { local entity = self.Entity self.StateComponent = entity.StateComponent self.MovementComponent = entity.MovementComponent self.PlayerControllerComponent = entity.PlayerControllerComponent self.RigidbodyComponent = entity.RigidbodyCompone
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | SetInteractionKey와 RemoveInteractionKey 메서드 시그니처 및 본문 로직을 코드 블록으로만 출력하고, 각 라인별 동작은 주석으로 설명하세요. [answer] | ```lua [client only] void SetInteractionKey(any key) { if not self.IsValid then return end self.InteractionKeys[key] = true } [client only] void RemoveInteractionKey(any key) { self.InteractionKeys[key] = nil } ``` [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | SetInteractionKey 메서드에서 self.IsValid 체크가 필요한 이유를 3문장 이내로 설명하세요. [answer] | `self.IsValid` 체크는 커스텀 컴포넌트가 아직 초기화되거나 비활성화된 상태에서 메서드가 호출되는 것을 방지하기 위함입니다. 이 조건이 참이 아닐 때 함수를 즉시 종료함으로써, 잘못된 상태의 프로퍼티 접근으로 인한 스크립트 오류를 예방합니다. [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | instruction_following [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | InteractionKey 관리 메서드 2개의 기능 차이를 한 줄로 비교하여 표로 정리하세요. [answer] | | 메서드 | 기능 | | :--- | :--- | | `SetInteractionKey()` | `InteractionKeys` 테이블에 특정 키를 `true` 값으로 등록하여 상호작용 키로 활성화합니다. | | `RemoveInteractionKey()` | `InteractionKeys` 테이블에서 특정 키를 `nil` 값으로 설정하여 상호작용 키 등록을 해제합니다. | [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | SetInteractionKey 메소드에서 self.IsValid 확인을 먼저 수행하는 이유는 무엇인가요? [answer] | `SetInteractionKey` 메소드에서 `self.IsValid`를 먼저 확인하는 이유는 컴포넌트가 유효한 상태인지 확인하기 위해서입니다. 코드의 논리 흐름을 보면 다음과 같습니다. ```lua [client only] void SetInteractionKey(any key) { if not self.IsValid then return end self.InteractionKeys[key] = true } ``` 1. **유효성 검사:** `self.IsValid` 프로퍼티가 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | DisconnectHitEvent와 ConnectEvent를 사용하여 커스텀 핸들러를 등록할 때, 기존 HitEventHandler를 제거하지 않으면 어떤 문제가 발생할 수 있나요? [answer] | 기존 `HitEventHandler`를 제거하지 않고 `ConnectEvent`로 새로운 핸들러를 등록하면, `HitEvent`가 발생할 때 기존 핸들러와 커스텀 핸들러가 모두 실행될 수 있습니다. 이는 다음과 같은 문제를 유발할 수 있습니다: 1. **중복 상태 변경**: 기존 핸들러가 이미 특정 상태(예: "HIT")로 변경한 후, 커스텀 핸들러가 다시 상태를 변경하거나 추가 로직을 실행하여 의도하지 않은 동작이 발생할 수 있습니다. 2. **예기치 못한 충돌**: 두 핸들러가 서로 충돌하는 로직(예: 서로 다른 애니메이션 트 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### 핸들러 메소드 HitEvent 발생 시 StateComponent의 상태를 "HIT"로 변경할 수 있도록 기존 HitEventHandler를 제거하고 커스텀 핸들러를 등록합니다. ```lua Method: [client only] void InitStateComponentEventHandler() { local stateComponent = self.Entity.StateComponent if stateComponent == nil then return end stat
[task] | code [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | `CustomPlayerActionEvent` EventType에 `PlayerEntity`와 `ActionName` 프로퍼티를 설정하고, 해당 이벤트를 발행하여 커스텀 액션을 트리거하는 `CustomPlayerControllerComponent` 메서드를 작성해줘 [answer] | `CustomPlayerActionEvent`를 발행하여 커스텀 액션을 트리거하는 `CustomPlayerControllerComponent`의 메서드를 작성했습니다. 참고 문서에 따르면, `CustomPlayerActionEvent` EventType에는 `PlayerEntity`(Entity 타입)와 `ActionName`(string 타입) 프로퍼티가 필요합니다. 이벤트 발행을 위해 `_EventService`를 사용하며, 이벤트 핸들러에서는 해당 이벤트를 수신받아 처리하는 로직을 포함했습니다. ```lua Property [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | PlayerControllerComponent 대신, 크리에이터의 월드 특성에 맞는 조작과 입력 방식을 가진 커스텀 컨트롤러를 직접 만들 수 있습니다. 이 가이드에서는 CustomPlayerControllerComponent를 만드는 예시를 하나 소개합니다. 예시 외에 크리에이터의 의도에 따라 다른 움직임을 구현할 수도 있습니다. ##### 참고 가이드 - [플레이어 설정과 제어](/docs/?postId=547) - [캐릭터 초기 속성 편집](/docs/?postId=48) ### UseCustomScript 사용 Playe
[task] | single_turn [pass] | ⏳ 미판정 [title] | 커스텀 PlayerController 만들기 [question] | InteractionKeys 테이블에 키를 등록할 때 true를 값으로 저장하는 방식의 장점은 무엇인가요? [answer] | InteractionKeys 테이블에 키를 등록할 때 `true`를 값으로 저장하는 방식의 장점은 **키의 존재 여부를 빠르게 확인하고 관리할 수 있다는 점**입니다. mLua(Lua)에서 테이블은 해시 맵처럼 사용할 수 있으며, 특정 키가 테이블에 존재하는지 확인하는 가장 일반적이고 효율적인 방법은 해당 키의 값이 `nil`인지 아닌지를 체크하는 것입니다. * **존재 확인이 직관적입니다:** `self.InteractionKeys[key]`의 값이 `nil`이 아니면 해당 키가 등록되어 있다는 의미입니다. 값의 구체적 내 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | #### InteractionKey 관리 메소드 PlayerControllerComponent 대신 새로운 커스텀 컴포넌트를 사용하게 되면, **InteractionComponent**의 `KeyCode`를 직접 컴포넌트에 등록해야 합니다. 아래 2가지 메소드로 상호작용 키를 관리할 수 있도록 작성합니다. - `SetInteractionKey()`: 상호작용 키를 등록합니다. - `RemoveInteractionKey()`: 등록된 상호작용 키를 제거합니다. ```lua [client only] void SetInteract
[task] | code [pass] | ⏳ 미판정 [title] | AvatarAction Editor [question] | `AvatarAction` JSON의 `Frames` 배열에서 `move_x`가 0이 아닌 프레임을 찾아 `_TimerService:SetTimerOnce`를 통해 해당 프레임의 `framedelay` 시간만큼 대기 후 `defined_actionname`을 `log`로 출력하는 스크립트를 작성해줘. [answer] | 제공된 참고 문서에는 `AvatarAction` JSON 파일을 로드하거나 파싱하는 mLua API(예: JSON 파일 읽기 함수, AvatarAction 컴포넌트 접근자 등)가 포함되어 있지 않습니다. 따라서 mLua 스크립트 내에서 직접 JSON 파일을 열고 `Frames` 배열을 순회하는 코드를 작성할 수 있는 공식 API를 확인할 수 없습니다. 또한, `_TimerService:SetTimerOnce`는 특정 함수를 지정된 시간 후에 실행하는 타이머 서비스이며, JSON 데이터의 특정 필드(0이 아닌 `move_x`)를 조 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | AvatarAction JSON 파일의 구조는 아래와 같습니다. ```lua { "Data": { "NewAvatarAction": { "Frames": [ { "defined_actionname": "stand1", "frameindex": 0, "framedelay": 0.156, "move_x": 0, "move_y": -1, "rotation": 0, "flip":
[task] | code [pass] | ⏳ 미판정 [title] | AvatarAction Editor [question] | BodyAction JSON 파일 구조를 기반으로 Data 필드 내 NewBodyAction 배열의 play_type 값이 1일 때 Loop, 2일 때 Zigzag로 매핑하는 로직을 구현하는 스크립트를 작성해줘 [answer] | BodyAction JSON 파일 구조에서 `play_type` 필드는 정수 인덱스이며, `1`은 `Loop`, `2`는 `Zigzag`를 의미합니다. 주어진 문서에는 `AvatarStateAnimationComponent`나 `StateToAvatarBodyActionSheet`를 mLua 스크립트 코드(예: `self.Entity.TransformComponent` 또는 특정 컴포넌트 메서드)로 직접 조작하는 API가 명시되어 있지 않습니다. 따라서 요청하신 **JSON 데이터 해석 및 `play_type` 값에 따른 매핑 로 [followup] | [followup_answer] | [scores] | [judge_reason] | [source_doc] | 제작한 BodyAction은 AvatarStateAnimationComponent의 StateToAvatarBodyActionSheet의 **Key**에 등록해 사용해야 합니다. 기본적으로 AvatarStateAnimationComponent에는 메이플스토리 원작과 동일한 움직임을 구현한 Key들이 지정되어 있습니다. 만약 이 기존 Key에서 AvatarBodyAction을 제작한 BodyAction으로 연결할 경우 크리에이터의 예상과 다르게 동작할 수 있습니다. 기본 State와 연결된 BodyAction에 맞는 PlayRate