> For the complete documentation index, see [llms.txt](https://brunx-mods.gitbook.io/brunx-mods-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brunx-mods.gitbook.io/brunx-mods-docs/products/scripts/brunx-bridge/cayo-perico-integration.md).

# Cayo Perico Integration

The bridge loads Cayo Perico into the normal map: the island IPLs, its ambient sound zones, and island paths and water while players are near it. This only happens while the map resource `brnx_cayopericobridge` is started.

## How it works

* **Map started:** the island IPLs load for everyone, the North Yankton zone is disabled and the island sound zones switch on.
* **Within the radius:** island AI paths and water load, and deep ocean waves are flattened around the island.
* **Leaving the radius:** the normal paths, water and ocean return.
* **Map or bridge stopped:** everything is removed again.

## Configuration

Settings live in `shared/cayo.lua`.

{% code title="shared/cayo.lua" %}

```lua
Config.Cayo = {
    resource = 'brnx_cayopericobridge',

    coords = vec3(5046.0, -5106.0, 6.0),
    radius = 1500.0,

    water = {
        detector = 'auto',
        resource = false,
        defaultFile = false,
        cayoFile = false,
        supported = {
            -- { name = 'my_water_resource', defaultFile = 'water/default.xml', cayoFile = 'water/cayo.xml' },
        }
    },

    ipls = { --[[ full list in the file ]] }
}
```

{% endcode %}

| Option     | Description                                                       |
| ---------- | ----------------------------------------------------------------- |
| `resource` | Map resource that switches Cayo Perico on                         |
| `coords`   | Centre of the island                                              |
| `radius`   | Distance from the centre where island paths and water are loaded  |
| `water`    | Optional custom `water.xml` handling, see below                   |
| `ipls`     | IPLs that are loaded. Optional extras are commented at the bottom |

## Custom water

Using a resource with its own `water.xml`? The bridge can swap between your normal water file and an island version.

* `detector = 'auto'`: uses the first started resource from `supported`.
* `detector = 'force'`: always uses `resource`, `defaultFile` and `cayoFile`.

```lua
water = {
    detector = 'auto',
    supported = {
        { name = 'my_water', defaultFile = 'data/water.xml', cayoFile = 'data/water_cayo.xml' }
    }
}
```
