> For the complete documentation index, see [llms.txt](https://xeavin.gitbook.io/ff12-lua-loader/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xeavin.gitbook.io/ff12-lua-loader/events/events/on-map-jump.md).

# On Map Jump

### Signature

```csharp
u32 onMapJump(s32 locationId, s32 posIndex, u32 flags, u32 unknown)
```

### Description

Fires when a location is entered.

### Arguments

#### Location Identifier

The identifier of the location.

#### Position Index

Determines at which position the party will spawn. In some locations, it can also have additional effects such as a foe spawning or not (e.g. trial stage).

If a value of `-1` is passed, it will be changed to that of `telepoIndex` in the location script (ebp section 0).

If a value of `-2` is passed, it will be changed to that of `saveIndex` in the location script (ebp section 0).

If a value of `-3` is passed, it will be changed to that of `anchorIndex` in the location script (ebp section 0).

#### Flags

Controls fade out and teleport animation.

<table><thead><tr><th width="118">Bit</th><th width="194">Name</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>No Fade Out</td><td>Do not use a fade out.</td></tr><tr><td>1</td><td>Fade Out Color</td><td>Use black (0) or white (1) as fade out color.</td></tr><tr><td>2</td><td>Default Fadeout Time</td><td>Use default fade out duration instead of 0,8 seconds.</td></tr><tr><td>3</td><td>Teleport Animation</td><td>Use teleport animation on arrival.</td></tr></tbody></table>

#### Unknown

The purpose of this argument is unknown.

### Notes

{% hint style="warning" %}
Starting a new game or loading a save game does not trigger a map jump, even though the location technically changes.
{% endhint %}

{% hint style="info" %}
For a list of location identifiers, you can view the location spreadsheet in [Resources](/ff12-lua-loader/getting-started/resources.md).
{% endhint %}
