# GLOBALS

#### GetGameInstance() -> ScriptGameInstance

When [Codeware](https://github.com/psiberx/cp2077-codeware/wiki) is installed, you can use this function without issues. Otherwise, you may need to get \[GameInstance] through other functions like \[GameObject.GetGame] for example.

This function will only work when the game engine is initialized, meaning a \[GameInstance] do exists.

#### FTLog(value: script\_ref:String) -> Void

Use this function to write in logs, along with \[FTLogWarning] and \[FTLogError].

See [wiki](https://wiki.redmodding.org/redscript/references-and-examples/logging) for more about logging.

#### LogChannel() -> Void

See \[FTLog] instead.


---

# 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://wiki.redmodding.org/nativedb-documentation/globals.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.
