> 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/gpc-developer-guide/constants/trace.md).

# Trace

We updated Trace which TRACE\_1, TRACE\_2, TRACE\_3 are 32bit, TRACE\_4, TRACE\_5 & TRACE\_6 are 16 bit.

| **Trace** | **Description** | **Range**                       |
| --------- | --------------- | ------------------------------- |
| TRACE\_1  | 32 Bit          | -2,147,483,648 to 2,147,483,647 |
| TRACE\_2  | 32 Bit          | -2,147,483,648 to 2,147,483,647 |
| TRACE\_3  | 32 Bit          | -2,147,483,648 to 2,147,483,647 |
| TRACE\_4  | 16 Bit          | -32,768 to 32,767               |
| TRACE\_5  | 16 Bit          | -32,768 to 32,767               |
| TRACE\_6  | 16 Bit          | -32,768 to 32,767               |

***

### What are traces and what do they do?

Traces are boxes of information commonly used to debug a GPC, get the information you may want from a game or get information from mods that may be running, and more. When in Zen Studio simply click Tools > Device Monitor or press the shortcut F3 on your keyboard. This will bring up Device Monitor where traces can be seen on the bottom right of the Device Monitor.

Here is where information will be displayed depending on how you have traces set in a GPC script. The example below is an example of using a trace to verify if a combo is running. When the combo is running the value of trace 1 is 1 and when the mod is off the value of trace 1 is 0.

***

### 16bit example

Code-Snippet

```
main {
    set_val(TRACE_1, combo_running(rapidfire));
    
    if(get_ival(XB1_RT)){
        combo_run(rapidfire);
    }
}

combo rapidfire {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(30);
}
```

In the example above, the value of trace 1 goes between 1 and 0. Due to the nature of the combo being re-run while the right trigger is being held, this is normal and what to look for when using a trace to verify the combo is running.

***

### 32bit Example

Code-Snippet

```
int output_strength;

main {
    set_val(TRACE_1, output_strength);
    
    output_strength = get_polar(POLAR_RS, POLAR_RADIUS) * 1000;
    
    if(get_val(XB1_LT)){
        if(abs(get_ival(XB1_RX)) < 20 && abs(get_ival(XB1_RY)) < 20) {
            set_val(XB1_RY, 20);
        }
        if(abs(get_ival(XB1_RX)) < 20 && abs(get_ival(XB1_RY)) >= 20) {
            set_val(POLAR_RY, output_strength / 1000);
        }
    }
}
```

In this example, the code for a basic dynamic Anti Recoil takes advantage of the higher value limits of 32bit to scale a value up then back down to be used with a polar constant for a much greater degree of accuracy. The value being traced is the radius of the right stick scaled up higher before being scaled back.

***

### Example using TRACE\_1 thru TRACE\_6

Code-Snippet

```
int a = 0xf0;
int b = 0x11;
int menu = 1;
int c = 0x7fffffff;
int d = 0xFfffffff;

main {
    set_val(TRACE_1, c);
    set_val(TRACE_2, d);
    set_val(TRACE_3, a & b);
    set_val(TRACE_4, a ^ b);
    set_val(TRACE_5, a | b);
    set_val(TRACE_6, a << 2);
    
    if (get_ps4_lbar(PS4_BLUE) > 0x20) {
        set_val(PS4_CROSS, 100);
    }
    
    if (get_keyboard(KEY_A) || get_modifiers(MOD_LCTRL)) {
        combo_run(rumble);
    }
    
    if (get_ival(PS4_CROSS)) {
        if (menu) block_all_inputs();
    }
}

combo rumble {
    set_rumble(RUMBLE_A, 40);
    wait(200);
    reset_rumble();
}
```


---

# 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 dynamically by asking a question.

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

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/gpc-developer-guide/constants/trace.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.
