Configuration
An overview of ULC features and configuration options.
ULC was designed to be as user-friendly and flexible as possible.
It loads vehicle configurations from a file called ulc.lua
that is located
within the vehicle resources themselves. This allows for easy setup,
and easy sharing of vehicle configurations. Vehicle developers can ship their
vehicles with a pre-configured ulc.lua
file to make them ULC ready
out-of-the-box!
Review the global settings
The top section of the config.lua
file in the root of the resource contains
a series of global settings. These settings determine the behavior of some
features.
Most of these settings can be left at their default values.
If you're using Luxart Vehicle Controls or a similar resource that plays a
tone when lights are turned on you should set muteBeepForLights
to true
-- whether to mute the tone that plays when lights are turned on
-- use if you have another resources that already plays a tone.
muteBeepForLights = true,
-- global toggle for UI (affects all clients)
hideHud = false,
-- whether to use KPH instead of MPH
useKPH = false,
-- health threshold for effect (probably don't touch this)
healthThreshold = 990,
ParkSettings = {
-- Vehicle will be considered "parked" below this speed
speedThreshold = 1,
-- whether to disable the effect when a door is open (highly recommended)
checkDoors = true,
-- delay between checks, should not be lower than 0.5
delay = 0.5,
-- distance to sync park pattern (32 is roughly the Yellow Jack parking lot)
syncDistance = 32,
-- cooldown between sync attempts
syncCooldown = 10,
},
SteadyBurnSettings = {
nightStartHour = 18,
-- should always be a lower number than start hour
nightEndHour = 6,
-- delay between checks, this can be very long, it will only make it more realistic
delay = 10,
},
...
Configure your first vehicle
By default, no vehicles are affected by ULC. In order for a vehicle to be affected by ULC there must be a configuration for it. Let's start by setting up your first vehicle.
To do this, we will create a ulc.lua
configuration file in your vehicle
resource folder, and then point ULC to that file so it can load it.
Follow the steps below!
If your vehicle came with a ulc.lua
file, skip to step 7.
Create ulc.lua
file
Create a file at the root of your vehicle resource and name it ulc.lua
Open the ULC Generator (opens in a new tab)
https://ulc.dwnstr.com/generator (opens in a new tab)
Define the model name
Add the name of your vehicle to the names={}
table.
Configure vehicle settings
Configure buttons
Populate the ulc.lua
file
Copy the contents of the generator and paste them into your ulc.lua
file.
Add config to ULC
Open your ULC config.lua
file and find the ExternalVehResources
table.
Here you can add the resource name of the vehicle you just configured.
This will tell ULC about the vehicle, and make it load the configuration
from the ulc.lua
file.
ExternalVehResources = {
"pd4",
},
Done!
Your vehicle is now configured and ready to go!
Restart ULC and test it out and then repeat for your other vehicles!
Configuring a vehicle pack
If you have a resource with multiple vehicles in it that all use the same
ULC configuration, you can use a single ulc.lua
file for all of them.
Simply include all of the model names in the names
field of the ulc.lua
file!
Thant's it!
names = {"pd4","pd5", "pd6"},
If there are vehicles in the resource that use a different configuration you can
create an additional configuration object within the same ulc.lua
file.
You can use the ULC Config Generator (opens in a new tab) to do this easily.
Multi-Config ulc.lua Example
return {names = {"sp20", "pd20"},
steadyBurnConfig = {
forceOn = false, useTime = false,
disableWithLights = false,
sbExtras = {}
},
parkConfig = {
usePark = true,
useSync = true,
syncWith = {'sp20', 'sp18chrg'},
pExtras = {10, 11},
dExtras = {}
},
hornConfig = {
useHorn = true,
hornExtras = {12}
},
brakeConfig = {
useBrakes = false,
speedThreshold = 3,
brakeExtras = {},
disableExtras = {}
},
-- example button
-- {label = 'STAGE 2', key = 5, extra = 8},
buttons = {
{label = 'stage 2', key = 5, extra = 8, offExtras = {10, 11}},
{label = 'TA', key = 6, extra = 9, offExtras = {}},
{label = 'AUX1', key = 7, extra = 10, offExtras = {}},
{label = 'AUX 2',key = 8,extra = 11, offExtras = {}},
{label = 'SCENE',key = 9,extra = 12, offExtras = {}},
},
defaultStages = {
useDefaults = false,
enableKeys = {},
disableKeys = {}
}
},
{names = {'pdram'},
steadyBurnConfig = {
forceOn = false,
useTime = false,
disableWithLights = false,
sbExtras = {}
},
parkConfig = {
usePark = true,
useSync = true,
syncWith = {'sp20', 'sp18chrg'},
pExtras = {10, 11},
dExtras = {}
},
hornConfig = {
useHorn = true,
hornExtras = {12}
},
brakeConfig = {
useBrakes = false,
speedThreshold = 3,
brakeExtras = {},
disableExtras = {}
},
-- example button
-- {label = 'STAGE 2', key = 5, extra = 8},
buttons = {
{label = 'stage 2', key = 1, extra = 8, offExtras = {10, 11}},
{label = 'TA', key = 2, extra = 9, offExtras = {}},
{label = 'TKD',key = 3,extra = 12, offExtras = {}},
}
defaultStages = {
useDefaults = false,
enableKeys = {},
disableKeys = {}
}
}
Creating Non-ELS Vehicles for ULC
Vehicle developers who are creating vehicles compatible with ULC can provide a local configuration file within their vehicle resources for use by users.
By providing a configuration file your vehicle will be pre-configured for all users who use it. Users will be able to simply plug-and-play your vehicle with ULC functionality.
Follow steps 1-5 above to learn how to create a ulc.lua file.
Extras with Sirens
The concept of nesting Sirens into an Extra is critical to proper usage of ULC. Most of the features of ULC require sirens to be contained within extras.
All you have to do to set this up is parent your Sirens to an Extra once they are compounded. Your extra can have any other parts also attached. I.E you could have a divider to block the emissives behind the emissives you want to show, such as in the case of a traffic advisor.
ULC works best when extras don't have collisions. If you have a collision on your extra, ULC will not be able to turn it on or off consistently.
What to Read Next
For detailed info about each feature and their config values see the below pages.