# 0.9.0 Map Changes

### 기존 맵 파일 최신화 방법

1. 스튜디오를 실행하고 Blank 맵을 생성해주세요.

   <figure><img src="/files/WPRTKYpp0kd6XwV6xwU0" alt=""><figcaption></figcaption></figure>

2. Blank 맵에서 아래와 같은 오브젝트들을 선택한 뒤, 복사해주세요. **( Ctrl + C )**

   <figure><img src="/files/q9wi3tNAX7bb8eVqBIXk" alt=""><figcaption></figcaption></figure>

3. 이전 버전에서 작업했던 맵 파일을 열어주세요.

   <figure><img src="/files/wFmJbmMhSPAGQGRiJ7xb" alt=""><figcaption></figcaption></figure>

4. Blank 맵에서 복사한 오브젝트들을 붙여넣기 해주세요. **( Ctrl + V )**

   <figure><img src="/files/RTQUDM1zcvcfC3AYdVZL" alt=""><figcaption></figcaption></figure>

5. **기존에 있던 스크립트**를 확인 후, \
   **새로 붙여넣기 한 스크립트**에 옮겨야 하는 부분이 있다면 적용해주세요.

   <figure><img src="/files/gvK6tUewadlN2ooCccqM" alt=""><figcaption></figcaption></figure>

6. 모두 적용했다면, **기존에 있던 스크립트**를 삭제해주세요.

   <figure><img src="/files/P05R9FTbxU8u1Yjcf0z2" alt=""><figcaption></figcaption></figure>

7. **새로 붙여넣기 한 스크립트**의 위치를 아래와 같이 수정해주세요.

   <figure><img src="/files/Yzv5V1LQqa2434CSgQh1" alt=""><figcaption></figcaption></figure>

***

***

### 스크립트 변경 사항

#### 1. 조작 그룹

조작 그룹의 구조가 기존과 다르게 변경되었어요.

아래 변경 사항을 확인하신 후, 조작 그룹을 사용하는 곳이 있다면 수정해주세요. ✏

* 조작 그룹 및 이벤트 추가 함수

<table><thead><tr><th width="495">기존</th><th width="427">변경</th></tr></thead><tbody><tr><td>Input:<strong>AddGroup</strong>("DefaultInput")</td><td><mark style="color:blue;">DefaultInput =</mark> Input:<strong>AddGroup</strong>("DefaultInput")</td></tr><tr><td><mark style="color:red;">Input</mark>:<strong>AddAxisKeyEvent</strong>(<mark style="color:red;">"DefaultInput",</mark> "MoveForward", .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>AddAxisKeyEvent</strong>("MoveForward", .. )</td></tr><tr><td><mark style="color:red;">Input</mark>:<strong>AddActionKeyEvent</strong>(<mark style="color:red;">"DefaultInput",</mark> "Jump", .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>AddActionKeyEvent</strong>("Jump", .. )</td></tr></tbody></table>

* 키 이벤트 연결 함수

<table><thead><tr><th width="378">기존</th><th width="369">변경</th></tr></thead><tbody><tr><td><mark style="color:red;">LocalPlayer</mark>:<strong>ProcessInputAxisEvent</strong>( .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>ProcessInputAxisEvent</strong>( .. )</td></tr><tr><td><mark style="color:red;">LocalPlayer</mark>:<strong>ProcessInputActionEvent</strong>( .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>ProcessInputActionEvent</strong>( .. )</td></tr><tr><td><mark style="color:red;">LocalPlayer</mark>:<strong>ProcessTouchAxisEvent</strong>( .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>ProcessTouchAxisEvent</strong>( .. )</td></tr><tr><td><mark style="color:red;">LocalPlayer</mark>:<strong>ProcessTouchActionEvent</strong>( .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>ProcessTouchActionEvent</strong>( .. )</td></tr></tbody></table>

* 조작 이벤트 제거 함수

<table><thead><tr><th width="479">기존</th><th width="411">변경</th></tr></thead><tbody><tr><td><mark style="color:red;">Input</mark>:<strong>RemoveActionKeyEvent</strong>(<mark style="color:red;">"DefaultInput",</mark> "Jump", .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>RemoveActionKeyEvent</strong>("Jump", .. )</td></tr><tr><td><mark style="color:red;">Input</mark>:<strong>RemoveAxisKeyEvent</strong>(<mark style="color:red;">"DefaultInput",</mark> "Turn", .. )</td><td><mark style="color:blue;">DefaultInput</mark>:<strong>RemoveAxisKeyEvent</strong>("Turn", ..)</td></tr></tbody></table>

#### 2. 리더보드

<figure><img src="/files/imiUTwZ1LTD33BSCEmiy" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">게임 통계 데이터</mark> 객체를 생성할 수 있는 함수가 추가되었어요. ✨

이에 따라, 기존 리더보드 함수에서 <mark style="color:red;">저장소 키 이름</mark>을 작성했던 인자에, \ <mark style="color:blue;">게임 통계 데이터</mark> 객체를 작성하도록 변경되었어요. 🔧

<table><thead><tr><th width="316">함수 이름</th><th width="577">기존 인자</th><th width="401">변경된 인자</th></tr></thead><tbody><tr><td>NewGameStatisticsData</td><td>(<mark style="color:blue;">게임 통계 데이터</mark> 객체를 생성하는 함수가 추가되었습니다)</td><td>저장소 키 이름, 오름차순 정렬 여부, 덮어쓰기 여부</td></tr><tr><td>GetGameStatisticsData</td><td><mark style="color:red;">저장소 키 이름, 덮어쓰기 여부</mark>, Offset 값, Count 값, 연결 함수</td><td><mark style="color:blue;">게임 통계 데이터</mark>, Offset 값, Count 값, 연결 함수</td></tr><tr><td>SaveGameStatisticsData</td><td>PlayerID, <mark style="color:red;">저장소 키 이름</mark>, 저장할 데이터, <mark style="color:red;">덮어쓰기 여부, 오름차순 정렬 여부</mark></td><td>PlayerID, <mark style="color:blue;">게임 통계 데이터</mark>, 저장할 데이터</td></tr><tr><td>SendToClient_GameStatisticsData</td><td>PlayerID, <mark style="color:red;">저장소 키 이름, 오름차순 정렬 여부</mark>, Offset 값, Count 값</td><td>PlayerID, <mark style="color:blue;">게임 통계 데이터</mark>, Offset 값, Count 값</td></tr><tr><td>Broadcast_GameStatisticsData</td><td><mark style="color:red;">저장소 키 이름, 오름차순 정렬 여부</mark>, Offset 값, Count 값</td><td><mark style="color:blue;">게임 통계 데이터</mark>, Offset 값, Count 값</td></tr></tbody></table>

❕ 아래에서 리더보드 함수의 사용 예시를 확인해주세요. 😀

* **NewGameStatisticsData** (string KeyString, bool Ascending, bool Overwrite)

  ```lua
  local SaveKeyName = "LeaderBoard2022" --저장소 키 이름이에요.
  local LeaderBoardData = nil           --게임 통계 데이터를 저장할 변수에요.

  --게임 통계 데이터 객체를 만들어요. (저장소 키 이름, 오름차순 정렬 여부, 덮어쓰기 여부)
  LeaderBoardData = Game:NewGameStatisticsData(SaveKeyName, true, true)
  ```

* **GetGameStatisticsData** (GameStatisticsData Data, number Offset, number Count, function CallBackFunction)

  ```lua
  local LeaderBoard = {} --리더보드 테이블이에요.

  --얻은 데이터를 리더보드 테이블에 저장해요.
  local function CompleteAquireData(count, data)
      for i = 1, count do            
          LeaderBoard[data[i].PlayerID] = data[i].Value
      end
  end

  --LeaderBoardData 객체에 해당하는 데이터를 얻을 수 있어요. (게임 통계 데이터, Offset 값, Count 값, 연결 함수)
  Game:GetGameStatisticsData(LeaderBoardData, 0, 10, CompleteAquireData)
  ```

* **SaveGameStatisticsData** (number PlayerID, GameStatisticsData Data, number SaveValue)

  ```lua
  function AddLeaderBoard(player, saveValue)   
      --특정 유저의 게임 통계 데이터를 저장할 수 있어요. (PlayerID, 게임 통계 데이터, 저장할 데이터)
      Game:SaveGameStatisticsData(player:GetPlayerID(), LeaderBoardData, saveValue)
  end
  ```

* **SendToClient\_GameStatisticsData** (number PlayerID, GameStatisticsData Data, number Offset, number Count)

  ```lua
  local function RefreshLeaderboard()		
      local playerList = Game:GetAllPlayer()
      
      for i = 1, #playerList do 
  	--특정 플레이어의 클라이언트에 리더보드 데이터를 보낼 수 있어요. (PlayerID, 게임 통계 데이터, Offset 값, Count 값)
          Game:SendToClient_GameStatisticsData**(**playerList[i], LeaderBoardData, 0, 10)
      end
  end
  ```

* **Broadcast\_GameStatisticsData** (GameStatisticsData Data, number Offset, number Count)

  ```lua
  local function RefreshAllPlayer()      
      --모든 플레이어의 클라이언트에 리더보드 데이터를 보낼 수 있어요. (게임 통계 데이터, Offset 값, Count 값)
      Game:Broadcast_GameStatisticsData(LeaderBoardData, 0, 10)
  end
  ```

자세한 활용 방법은 CrossJump 템플릿에 있는 리더보드 스크립트를 참고해주세요. 🐸

<figure><img src="/files/9S9PR9FkbwW6iEUXJeTD" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ditoland-utplus.gitbook.io/ditoland/release-note/script-changes/0.9.0-map-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
