# History (/start/history)



<CalloutContainer type="info">
  <CalloutTitle>
    UI screen
  </CalloutTitle>

  <CalloutDescription>
    You can find an example of the history UI screen in the <DynamicLink href="/start/interface-examples#history">interface examples</DynamicLink> section.
  </CalloutDescription>
</CalloutContainer>

<CalloutContainer type="info">
  <CalloutTitle>
    Nomenclature
  </CalloutTitle>

  <CalloutDescription>
    In this documentation, the term "narrative history" refers to the list of all dialogues, choices, and more that have been shown to the player.
  </CalloutDescription>
</CalloutContainer>

Pixi’VN saves all dialogues, choices, responses, and more at every `step` executed during the game. This makes it possible to navigate back to previous steps, letting the player review past events or revisit earlier choices.

## Get [#get]

To get the narrative history, use [`stepHistory.narrativeHistory`](/jsdoc/pixi-vn/index/interfaces/HistoryManagerInterface#narrativehistory).

```ts
const dialogues: NarrativeHistory[] = stepHistory.narrativeHistory;
```

## Remove [#remove]

To delete all narrative history, use [`stepHistory.removeNarrativeHistory`](/jsdoc/pixi-vn/index/interfaces/HistoryManagerInterface#removenarrativehistory).

```ts
stepHistory.removeNarrativeHistory();
```

To delete part of the narrative history, pass a number to remove the first N elements:

```ts
// Delete the first 2 elements
stepHistory.removeNarrativeHistory(2);
```

## Other features [#other-features]

<Accordions>
  <Accordion title="Limit of saved `steps`" id="limit-saved-steps">
    At each `step`, all information about the current game state is saved.

    To prevent the save file from growing too large, there is a limit on the number of `steps` saved. By default, only the last 20 `steps` are saved, but you can increase this limit (e.g., to 100). When the limit is reached, only essential information from older `steps` is kept. This allows you to display the full <DynamicLink href="/start/history">narrative history</DynamicLink>, but you cannot <DynamicLink href="/start/labels-flow#go-back">return</DynamicLink> to a specific `step` beyond the limit.

    You can change the `step` save limit by setting the [`stepHistory.stepLimitSaved`](/jsdoc/pixi-vn/index/interfaces/HistoryManagerInterface#steplimitsaved) property.

    ```ts
    import { stepHistory } from "@drincs/pixi-vn";

    stepHistory.stepLimitSaved = 100;
    ```

    To disable the `step` save limit, set [`stepHistory.stepLimitSaved`](/jsdoc/pixi-vn/index/interfaces/HistoryManagerInterface#steplimitsaved) to `Infinity`.

    ```ts
    import { stepHistory } from "@drincs/pixi-vn";

    stepHistory.stepLimitSaved = Infinity;
    ```
  </Accordion>
</Accordions>
