Extra Components

Extra components are parts of a vehicle that can spawn randomly. By default, they always have a chance to appear, but their behavior can be changed with the vehicles.meta configuration and with external scripts.


Model

Extra components are named extra_x, x being a number from 1-9, ten, 11, or 12.


Extras support collisions. For extras with any child objects (such as sirens or nested extras), it is recommended to add a collision to the extra, otherwise these children may stay visible after removing the parent extra.


vehicles.meta

Flags

Flags are set in the flags tag, multiple flags are separated with spaces:

XML: vehicles.meta
<flags>FLAG_EXTRAS_CONVERTIBLE FLAG_EXTRAS_STRONG FLAG_HAS_INTERIOR_EXTRAS</flags>


The following flags affect extras:


Name Description
FLAG_EXTRAS_ALL Always spawns all of extras 1-8. Overrides FLAG_EXTRAS_SCRIPT.
FLAG_EXTRAS_CONVERTIBLE Spawns either extra 1 or 2. In rainy weather, extra 1 never spawns. If extra 1 is active, the front side windows do not spawn.
FLAG_EXTRAS_GANG Unknown, unused by default.
FLAG_EXTRAS_ONLY_BREAK_WHEN_DESTROYED Extras can only fall off when the vehicle is being destroyed.
FLAG_EXTRAS_RARE Lowers chance for extras to spawn. Affects extras 1-8.
FLAG_EXTRAS_REQUIRE Spawns exactly one of extras 1-8 with an equal chance. Doesn't spawn extras 5-8 when used with FLAG_EXTRAS_SCRIPT.
FLAG_EXTRAS_SCRIPT Prevents extras 5-9 from spawning randomly. It is still possible to spawn these extras using required extras, extra includes, or external scripts. Can be combined with FLAG_EXTRAS_REQUIRE. Will be overridden by FLAG_EXTRAS_ALL.
FLAG_EXTRAS_STRONG Prevents extras from falling off in a vehicle collision.
FLAG_EXTRAS_TAXI Always spawns exactly one of extras 5-8. Equal chance to additionally spawn one other extra, excluding extra_9, or none of these extras. If extra 9 exists and extras 7 and 8 are nested under it, either extras 5, 6, 9 and 7, or 9 and 8 will spawn.
FLAG_HAS_INTERIOR_EXTRAS Spawns exactly one of extras 10-12 or none of these extras with an equal chance.


Required Extras

When required extras are set, at least one of these extras will always spawn. If only a single extra is required, it will always spawn.


To set required extras, the extras are listed under the requiredExtras tag, multiple extras are separated with spaces:

XML: vehicles.meta
<requiredExtras>EXTRA_1 EXTRA_2</requiredExtras>

Required extras can be combined with extra includes to force multiple extras to spawn.


Extra Includes

Extra includes require multiple extras to spawn whenever one of the listed extras spawns. This can be used for example to spawn different extras on multiple doors at the same time.


Includes are added in the extraIncludes tag. Each include set requires its own Item tag. The following example will always force extra_1 and extra_2 to spawn at the same time, as well as extra_5, extra_6, and extra_7:

XML: vehicles.meta
<extraIncludes>
    <Item>EXTRA_1 EXTRA_2</Item>
    <Item>EXTRA_5 EXTRA_6 EXTRA_7</Item>
</extraIncludes>

Authors

Don’t have an account yet? Register yourself now and be a part of our community!