> For the complete documentation index, see [llms.txt](https://organized-chaos.gitbook.io/organized-chaos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organized-chaos.gitbook.io/organized-chaos-docs/quackmobil/configuration.md).

# Configuration

Every option in the Quackmobil config.lua, with its default.

All options are in `config.lua`. Restart the resource after a change: `restart quackmobil`.

The graphics presets have their own page: [Graphics presets and performance](/organized-chaos-docs/quackmobil/graphics-presets-and-performance.md).

## General

| Option                      | Default | Meaning                                                                                                                                                                                                                                                          |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.SimpleMode`         | `false` | `true` turns the ducks into normal vehicles with a normal horn and headlights, and without flight mode, animation or feathers. Head, wings and feet are still attached, but rigid. Client load is practically zero. Most other options do not apply in this mode |
| `Config.SimpleModeDistance` | `200.0` | In simple mode, the distance in metres up to which ducks get their head, wings and feet                                                                                                                                                                          |

## Texts

`Config.Locale` holds every text players see. Translate them here.

| Option                           | Default                                           | Meaning                                                                                                            |
| -------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `VehicleNames.quackmobil`        | `'Quackmobil'`                                    | Name of the drake in game                                                                                          |
| `VehicleNames.quackmobil_hen`    | `'Quackmobil Hen'`                                | Name of the hen in game                                                                                            |
| `VehicleNames.quackmobil_rubber` | `'Quackmobil Rubber Duck'`                        | Name of the rubber duck in game                                                                                    |
| `MakeName`                       | `'Squeak & Co.'`                                  | Manufacturer name                                                                                                  |
| `KeyHorn`                        | `'Quackmobil: Quack (horn)'`                      | Name of the horn key binding in the FiveM settings                                                                 |
| `KeyFlight`                      | `'Quackmobil: Toggle flight mode'`                | Name of the flight key binding in the FiveM settings                                                               |
| `FlightDenied`                   | `'You are not allowed to fly the Quackmobil.'`    | Shown when a player without permission tries to fly                                                                |
| `QualityCurrent`                 | `'Quackmobil graphics: ~y~%s~s~ (available: %s)'` | Shown by `/quackquality` without an argument. The first `%s` is the current preset, the second the list of presets |
| `QualitySet`                     | `'Quackmobil graphics: ~g~%s'`                    | Confirmation after switching. `%s` is the new preset                                                               |
| `QualityHelp`                    | `'Graphics preset for the Quackmobils'`           | Chat suggestion text                                                                                               |
| `QualityParam`                   | `'preset'`                                        | Name of the chat suggestion parameter                                                                              |
| `NoSuchModel`                    | `'There is no duck called that.'`                 | An item or export asked for a duck that does not exist                                                             |
| `NoModel`                        | `'The duck could not be loaded.'`                 | The duck's model did not load in time                                                                              |
| `PutDownNotNow`                  | `'You cannot set your duck down right now.'`      | The item was used in a vehicle, while swimming, falling, climbing or ragdolling                                    |
| `PickUpFull`                     | `'You cannot carry the duck.'`                    | The inventory cannot take the item back                                                                            |
| `PickUpNotYours`                 | `'That is not your duck.'`                        | With `PickUp.OwnOnly`, another player's duck                                                                       |
| `PickUpLabel`                    | `'Pick up duck'`                                  | The ox\_target option on a duck from an inventory                                                                  |

Keep every `%s` when you translate. `~y~`, `~g~` and `~s~` are GTA colour codes for yellow, green and back to white.

The spawn names stay the same whatever you call the vehicles.

## Horn

`Config.Horn`

| Option           | Default       | Meaning                                                                                                                           |
| ---------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `KeyMapping`     | `true`        | `true` makes the horn a FiveM key binding with no per-frame cost while driving. `false` polls the normal horn control every frame |
| `DefaultKey`     | `'E'`         | Default key for the key binding                                                                                                   |
| `Command`        | `'quackhorn'` | Internal command behind the key binding. Only change it if it clashes with another resource                                       |
| `Volume`         | `0.8`         | Quack volume, from 0.0 to 1.0                                                                                                     |
| `HearDistance`   | `45.0`        | Metres up to which other players hear the quack, quieter further away                                                             |
| `PitchVariation` | `0.05`        | Random pitch change per quack, so every duck sounds slightly different. `0.05` is 5% up or down                                   |
| `Cooldown`       | `350`         | Minimum time between two quacks in milliseconds. The server checks it too, against spam                                           |
| `HopForce`       | `3.0`         | The small hop when quacking on the ground. `0` switches it off                                                                    |

{% hint style="warning" %}
If players on your server use a controller, set `KeyMapping = false`. Otherwise the quack does not work for them.
{% endhint %}

To use your own sound, replace `html/quack.wav` with your own file and keep the name.

## Flight mode

`Config.Flight`

| Option          | Default      | Meaning                                                                                                                               |
| --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Enabled`       | `true`       | `false` disables the flight mode completely                                                                                           |
| `DefaultKey`    | `'X'`        | Default key for the flight mode                                                                                                       |
| `Command`       | `'quackfly'` | Internal command behind the key binding. Only change it if it clashes with another resource                                           |
| `AllowedJobs`   | `{}`         | Job names allowed to fly, for example `{ 'police', 'ambulance' }`. Needs Qbox (`qbx_core`), QBCore (`qb-core`) or ESX (`es_extended`) |
| `AcePermission` | `false`      | ACE permission allowed to fly, for example `'quackmobil.fly'`                                                                         |

If `AllowedJobs` is empty and `AcePermission` is `false`, everyone may fly. See [Commands and permissions](/organized-chaos-docs/quackmobil/commands-and-permissions.md).

### Flight physics

| Option         | Default | Meaning                                                 |
| -------------- | ------- | ------------------------------------------------------- |
| `MaxSpeed`     | `38.0`  | Top speed in metres per second, about 137 km/h          |
| `Acceleration` | `8.0`   | Acceleration with W                                     |
| `Brake`        | `14.0`  | Deceleration with S                                     |
| `Drag`         | `1.0`   | Slow-down without throttle                              |
| `TurnRate`     | `75.0`  | Turning speed with A and D, in degrees per second       |
| `ClimbRate`    | `7.0`   | Climb speed with Space, in metres per second            |
| `DiveRate`     | `10.0`  | Descent speed with Ctrl, in metres per second           |
| `LiftSpeed`    | `8.0`   | Below this speed the duck slowly sinks unless it climbs |
| `StallSink`    | `3.0`   | Sink rate when hovering at zero speed                   |
| `TakeoffHop`   | `5.0`   | Upward push when taking off from the ground             |

### Controls in flight

`Config.Flight.Controls` takes GTA control ids, not keys. They are listed in the [FiveM controls reference](https://docs.fivem.net/docs/game-references/controls/).

| Option       | Default | Key     |
| ------------ | ------- | ------- |
| `Accelerate` | `71`    | W       |
| `Brake`      | `72`    | S       |
| `Steer`      | `59`    | A and D |
| `Up`         | `76`    | Space   |
| `Down`       | `62`    | Ctrl    |

## Swimming

The ducks are amphibious vehicles, so the game itself keeps them afloat, including the rocking on the waves. `Config.Swim` adds the push and the turning on water.

| Option         | Default | Meaning                                                                              |
| -------------- | ------- | ------------------------------------------------------------------------------------ |
| `Enabled`      | `true`  | `false` leaves the ducks floating and drifting on water                              |
| `MaxSpeed`     | `9.0`   | Top speed on water in metres per second, about 32 km/h                               |
| `ReverseSpeed` | `3.0`   | Top speed backwards                                                                  |
| `Acceleration` | `3.0`   | Acceleration with W                                                                  |
| `Brake`        | `5.0`   | Braking and reversing with S                                                         |
| `TurnRate`     | `50.0`  | Turning speed with A and D, in degrees per second. Turning also works while standing |
| `Grip`         | `1.5`   | How fast sideways drift fades. Higher goes more exactly where the duck points        |

`Config.Swim.Controls` takes GTA control ids for `Accelerate` (71), `Brake` (72) and `Steer` (59).

### Float height and water drag

These two are set in `data/handling.meta`, which is not encrypted:

| Field               | Default           | Effect                                                                       |
| ------------------- | ----------------- | ---------------------------------------------------------------------------- |
| `fPercentSubmerged` | `45.0`            | How deep the duck floats. Lower floats higher on the water                   |
| `vecMoveResistance` | `x 1, y 25, z 10` | Water drag sideways, forward and vertical. Higher slows the duck down faster |

Players need to reconnect after a change to this file.

## Items

`Config.Item`. How the items work, and how to add them to your inventory, is on the [Items](/organized-chaos-docs/quackmobil/items.md) page.

| Option          | Default         | Meaning                                                                                                                                                                                                                             |
| --------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Enabled`       | `true`          | The ducks as inventory items. `false` turns the items, the pick-up and the `give` and `putDown` exports off                                                                                                                         |
| `Framework`     | `'auto'`        | Which inventory registers the items: `'auto'` takes Qbox, then QBCore, then ESX, else ox\_inventory on its own. Or `'esx'`, `'qb'`, `'qbx'`, `'ox'`, or `false` for an inventory of your own that calls the `putDown` export itself |
| `Items`         | the three ducks | `[item name] = spawn name of the duck it sets down`. Leave out the ones you don't want                                                                                                                                              |
| `Remove`        | `true`          | Setting the duck down takes the item out of the inventory, and picking the duck up puts it back. `false` keeps the item, and a player can set down as many ducks as they like                                                       |
| `OnePerPlayer`  | `true`          | Only with `Remove = false`: setting down another duck puts the last one away, unless someone sits on it                                                                                                                             |
| `RemoveOnLeave` | `true`          | Only with `Remove = false`: a player's duck goes when they leave the server, unless someone sits on it                                                                                                                              |

### Setting down

`Config.Item.PutDown`

| Option      | Default | Meaning                                                                   |
| ----------- | ------- | ------------------------------------------------------------------------- |
| `Animation` | `true`  | The player bends down to set the duck down. `false` puts it there at once |
| `At`        | `0.45`  | How far into the bending-down animation, from 0 to 1, the duck appears    |
| `Distance`  | `2.2`   | Metres in front of the player the duck is set down                        |

### Picking up

`Config.Item.PickUp`

| Option        | Default              | Meaning                                                                                                                                                                                                            |
| ------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Enabled`     | `true`               | "Pick up duck" on ducks that came out of an inventory                                                                                                                                                              |
| `Target`      | `'ox_target'`        | The target script that shows the option. `false` leaves it to a script of your own, with the `pickUp` and `canPickUp` exports                                                                                      |
| `Icon`        | `'fa-solid fa-hand'` | The option's icon in ox\_target                                                                                                                                                                                    |
| `Distance`    | `2.5`                | Metres from the duck the option shows                                                                                                                                                                              |
| `OwnOnly`     | `false`              | `true` lets only the player who set a duck down pick it up                                                                                                                                                         |
| `ServerCheck` | `true`               | The server takes back only ducks it saw come out of an inventory itself. `false` trusts the duck's state bag instead, for a script of your own that marks ducks as items; the game owning the duck can change that |
| `Animation`   | `true`               | The player bends down for the duck                                                                                                                                                                                 |
| `GrabAt`      | `0.45`               | How far into that animation, from 0 to 1, the duck goes into the inventory                                                                                                                                         |

## Look

### Head

`Config.Head`

| Option        | Default | Meaning                                                              |
| ------------- | ------- | -------------------------------------------------------------------- |
| `SteerFactor` | `0.9`   | How strongly the head looks into curves. `0` keeps the head straight |
| `BeakOpen`    | `22.0`  | How far the bill opens when quacking, in degrees                     |

### Wings

`Config.Wings`

| Option       | Default | Meaning                                         |
| ------------ | ------- | ----------------------------------------------- |
| `UnfoldTime` | `0.8`   | Seconds for the wings to spread when taking off |
| `FoldTime`   | `0.7`   | Seconds for the wings to fold back              |

### Eye lights

`Config.EyeLights`. The headlights shine from the eyes and turn with the head.

| Option     | Default                                                           | Meaning                                                                         |
| ---------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `Color`    | `{ 255, 240, 214 }`                                               | Light colour as red, green, blue. The default is a warm white                   |
| `LowBeam`  | `Distance = 40.0, Brightness = 4.0, Radius = 24.0, Falloff = 6.0` | Low beam: reach in metres, brightness, cone width and edge softness             |
| `HighBeam` | `Distance = 70.0, Brightness = 6.0, Radius = 18.0, Falloff = 6.0` | High beam, with the same values                                                 |
| `Glow`     | `Range = 0.45, Intensity = 3.0`                                   | Soft glow inside the eyes. Only shown if `EyeGlow` is on in the graphics preset |

Beyond the preset's `LightDistance`, ducks use the game's normal headlights.

### Feathers

`Config.FeatherEffect`

| Option      | Default        | Meaning                                                               |
| ----------- | -------------- | --------------------------------------------------------------------- |
| `Lifetime`  | `{ 2.2, 3.4 }` | Each feather lives a random time between these two values, in seconds |
| `MaxActive` | `40`           | Most feathers in the air at once, all ducks together                  |

The number of feathers per crash is set in the graphics presets.
