# Local Retry Settings

Local settings are those Retry options that can be configured on a level-specific basis. These options must be inserted in the `retry_config/settings_local.asm` file. If you used older version of Retry, these are equivalent to the various tables you had to change the values of, but made simpler by not having to manage big tables of hex data.

If you still prefer the table approach, you can set `!use_legacy_tables = 1` in `settings_global.asm` and edit the tables in `legacy/tables.asm` as you're used to. In this case, ignore this document and the `settings_local.asm` file.

### Overview

This approach of configuring the level-specific settings uses instructions that enable some setting for a specified level number. Each instruction must be put on a separate line in the asm file.

There are various instruction types, but most times you'll probably only use one or two of them for any given level, if any.

The instruction types are the following:

- %checkpoint(level, value)
- %retry(level, value)
- %checkpoint_retry(level, checkpoint, retry)
- %sfx_echo(level)
- %no_reset_rng(level)
- %no_room_cp_sfx(level)
- %no_lose_lives(level)
- %settings(level, checkpoint, retry, sfx_echo, no_reset_rng, no_room_cp_sfx, no_lose_lives)

### %checkpoint(level, value)

This allows you to configure the checkpoint behavior for the specified level. `value` can have one of the following values:

- `0`: vanilla checkpoint. The midway bar in the corresponding sublevel will lead to the midway entrance of the main level.
- `1`: the midway bar in the corresponding sublevel will lead to the midway entrance of the sublevel.
- `2`: any main/secondary/midway entrance through door/pipe/etc. whose destination is the corresponding sublevel will trigger a checkpoint like midway bars, and the checkpoint will lead to this entrance.
- `3`: this enables both the effects of `1` and `2`.

If this option isn't specified for a level, then it will default to `0` (vanilla checkpoint behavior).

Examples:

- `%checkpoint($105,2)`: sublevel $105 will have automatic checkpoints on any entrance to it.
- `%checkpoint($025,3)`: sublevel $025 will have automatic checkpoints on any entrance to it and its midway will lead to sublevel $025's midway entrance instead of the main level's midway entrance.

Note that you can also use custom midway objects (that look like vanilla midway bars) to have multiple midways. See Custom Midway Instructions for more information.

### %retry(level, value)

This allows to override the Retry type for the specified level. `value` can have one of the following values:

- `0`: follow the global setting (`!default_prompt_type` in `settings_global.asm`).
- `1`: enable Retry prompt and play the death jingle when the player dies. Recommended if you want the music to restart on each death.
- `2`: enable Retry prompt and only play the death sfx when the player dies (music won't be interrupted).
- `3`: enable instant Retry and only play only the deaht sfx (the fastest option, as if "Retry" is chosen automatically in the Retry prompt).
- `4`: Retry disabled (as if "Exit" is chosen automatically in the Retry prompt). Use this to have the vanilla death sequence.

If this option isn't specified for a level, then it will default to `0` (follow the global setting).

Examples:

- `%retry($001,2)`: sublevel $001 will have Retry prompt with death sfx.
- `%retry($069,3)`: sublevel $069 will have instant Retry.
- `%retry($1FF,4)`: sublevel $1FF will have no Retry.

### %checkpoint_retry(level, checkpoint, retry)

This is a shorthand to configure the checkpoint and Retry type for a level with the same instruction. `checkpoint` follows the `%checkpoint` format and `retry` follows the `%retry` format.

Examples:

- `%checkpoint_retry($101,1,1)`: sublevel $101 will have the sublevel midway bar behavior and Retry prompt with death jingle.
- `%checkpoint_retry($102,2,0)`: sublevel $102 will have automatic checkpoints on entrance and follow the global Retry setting.

### %sfx_echo(level)

This will enable SFX echo in the specified sublevel. Note that this option only works if AddmusicK is used in the ROM, and the SFX uses the same echo as the music (if the music has no echo, then the SFX also won't have echo).

Examples:

- `%sfx_echo($105)`: sublevel $105 will have SFX echo enabled.

### %no_reset_rng(level)

Normally Retry resets the RNG seed every time a level is reloaded, to make setups consistent between deaths. Using this option will make the RNG not reset when retrying in this sublevel.

Examples:

- `%no_reset_rng($105)`: sublevel $105 won't have the RNG reset when reloading it with Retry.

### %no_room_cp_sfx(level)

If a level uses the checkpoint type `2` or `3`, then a SFX is played when the automatic checkpoint is triggered (the SFX is defined by `!room_cp_sfx` in `settings_global.asm`).

If you use this, then the automatic checkpoints in the specified sublevel won't have any SFX. If `!room_cp_sfx = 0`, you can ignore this.

Examples:

- `%no_room_cp_sfx($105)`: sublevel $105 won't have any SFX when getting an entrance checkpoint.

### %no_lose_lives(level)

If infinite lives is disabled (`!infinite_lives = 0` in `settings_global.asm`), you can prevent life loss in specific sublevels using this option (for example for tutorial rooms or cutscenes).

If `!infinite_lives = 1`, you can ignore this.

Examples:

- `%no_lose_lives($105)`: dying in sublevel $105 won't reduce lives.

### %settings(level, checkpoint, retry, sfx_echo, no_reset_rng, no_room_cp_sfx, no_lose_lives)

This is a shorthand to configure all the settings for the specified level at the same time.

The arguments are:

- `level`: the sublevel number.
- `checkpoint`: same as `value` in `%checkpoint`.
- `retry`: same as `value` in `%retry`.
- `sfx_echo`: if `0`, SFX echo is disabled in the sublevel. Otherwise, it is enabled.
- `no_reset_rng`: if `0`, RNG is reset when retrying in the sublevel. Otherwise, it is not reset.
- `no_room_cp_sfx`: if `0`, automatic checkpoints in the sublevel will play the SFX. Otherwise, they won't play the SFX.
- `no_lose_lives`: if `0`, life loss is enabled in the sublevel (if infinite lives is disabled globally). Otherwise, it is disabled.

Return to main page