> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/start-here/first-mistakes-to-recognize.md). Agents can also search and read this documentation through its [MCP server](https://guide.cronuszen.com/~gitbook/mcp).

# First mistakes to recognize

### Declaring inside a block

```cpp
main {
    int value;  // invalid: runtime variables must be top-level
}
```

Move `int value;` above `init` / `main`.

***

### Confusing assignment and comparison

```cpp
if(mode = 2) { }   // assigns 2; the condition is then true
if(mode == 2) { }  // compares; usually what was intended
```

Zen Studio Live warns about assignment in a condition, but write the intended operator.

***

### Using the wrong letter case

`PS5_CROSS`, `ps5_cross`, and `PS5_Cross` are different names. Only the defined constant is valid.

***

### Assuming a function changes its caller's variable

Function arguments are values held in local parameters:

```cpp
int amount = 10;

main {
    amount = add_five(amount);  // store the returned value
}

function add_five(value) {
    value = value + 5;
    return value;
}
```

***

### Writing forever in an inner loop

```cpp
while(TRUE) { }  // do not do this in live real-time code
```

`main` is already the repeating loop. Inner loops should complete quickly and have an obvious bound.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/start-here/first-mistakes-to-recognize.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
