# Compiler(腳本設計及編譯)

{% hint style="info" %}
Compiler這個介面是提供玩家可以自行編寫GPC腳本, 除錯及編譯成GPC燒錄檔, 玩家也可以將下載下來的GPC檔在此打開, 再進行修改編寫的動作, 完成後點選COMPILER >>> Compile進行除錯並編譯成GPC燒錄檔, 便可於Programmer介面進行燒錄進克麥2的動作.
{% endhint %}

![Compiler介面](https://2586037549-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4XDpPMxF6nBZHbUPPh%2F-M7uLjs05I7vVdeKKo_F%2F-M7uM1xRcxKLiBTv2C0o%2Fimage.png?alt=media\&token=f9d1be3f-3e1b-45e2-84f8-f66b420e096e)

## **Compiler Tab Bar(Compiler 標籤區)**

![](https://gblobscdn.gitbook.com/assets%2F-LuPv_lMrFV1b9PLExvq%2F-M8QV4_652vRT1lPYv9z%2F-M8QXoxiYq-R8k6iC55H%2Fimage.png?alt=media\&token=e07e86b1-3c03-4a30-93ec-fb2f4ae17c52)

此區為載入到Compiler的GPC腳本, 依先後載入順序排列, 設計者可以點選個別標籤來對個別的GPC腳本進行編譯動作, 有被修改過的腳本於標籤位置會出現一個(\*)符號, 提醒設計者此檔修改過但未存檔, 只要一存檔(\*)符號也會消失.

## **Compiler Editor(Compiler編輯區)**

<div align="left"><img src="https://2586037549-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4XDpPMxF6nBZHbUPPh%2F-MBJ-cpks_uPVsGVIyR6%2F-MBJ0IJIPBD4LjHK4Lmz%2Fimage.png?alt=media&#x26;token=87595a5e-3f80-49ca-808d-998ed2a9b2c2" alt=""></div>

此區為GPC腳本編輯區, 設計者可於此區撰寫編輯腳本.

## **Compiler Output(Compiler輸出訊息區)**

<div align="left"><img src="https://2586037549-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4XDpPMxF6nBZHbUPPh%2F-MBJ-cpks_uPVsGVIyR6%2F-MBJ0Ot_oqDjcaYlW3Vg%2Fimage.png?alt=media&#x26;token=35321736-61d4-4a44-81ab-247cac35aca5" alt=""></div>

此區會顯示Compiler(組議)後的結果, 包含警告訊息(WARNING), 錯誤訊息(ERROR), 腳本使用容量(Byte Size), 總共宣告即使用多少變數(variables)...等.

## **Compiler Menu(Compiler選單)**

### Font Size(字體大小)

設定字體大小可點選**Compiler**:point\_right:**Font Size**進行字體大小的設定.

### **Compile(編譯)**

欲針對當下撰寫的 GPC腳本進行Compiler(編譯)可點&#x9078;**"Compile"** (或按**F7**), 腳本必需要進行Compiler(編譯)的程序確認沒有錯誤(ERROR)方能燒錄進克麥2裏, 設計者在點擊Compiler後檢視下方輸出訊息欄有無錯誤訊息, 有錯誤的GPC腳本事無法拖曳進Programmer的記憶體槽位裏.&#x20;

### **Build and Run(編譯同時執行腳本)**

在Compiler確認無誤後, 設計者可以直接點&#x64CA;**"Build and Run"** (或按**F5**), 系統會把腳本暫寫入克麥2的RAM裏並運作執行, 同時會開啟Device Monitor來檢視腳本運作的狀況, 這對於設計腳本時是十分省時跟方便, 但若克麥2與Zen Studio斷線後RAM裏的腳本也會清除.

{% hint style="success" %}
在DEVICE(裝置設定)裏可以設定點擊"Build and Run"後是否要開啟DEVICE MONITOR
{% endhint %}

🔎 **DEVICE及Device Monitor相關資訊請參考下方連結**��**:**

{% content-ref url="device" %}
[device](https://zen.cronusmax.com.tw/cronuszen/software/zen-studio/device)
{% endcontent-ref %}

{% content-ref url="../device-monitor" %}
[device-monitor](https://zen.cronusmax.com.tw/cronuszen/software/device-monitor)
{% endcontent-ref %}


---

# 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://zen.cronusmax.com.tw/cronuszen/software/zen-studio/compiler.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.
