# gameScriptableSystem

## Description

Only available in-game, and re-created on each load.

See Codeware [ScriptableService](https://github.com/psiberx/cp2077-codeware/wiki#scriptable-services) if you need to add logic outside of game sessions.

## Functions

#### WasRestored() -> Bool

Whether session was restored (e.g. on save load), or not (e.g. on new game).

#### IsSavingLocked() -> Bool

Whether saving is currently disabled or not (e.g. during combat).

#### OnAttach() -> Void

Automatically called when attached to game session (e.g. on save load).

#### OnDetach() -> Void

Automatically called when detached from game session (e.g. on exit to main menu).

#### OnRestored(saveVersion: Int32, gameVersion: Int32) -> Void

Automatically called when restoring game session (e.g. on save load).


---

# 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/classes/gamescriptablesystem.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.
