This page will outline and explain how to create a configuration module and how to configure the vehicle for its setup.
Creating a configuration module
1
Navigate to the modules folder
Please navigate to the modules folder within the resource, which can be found at the following path.
settings > modules
2
Create a new file
Now that you are in the appropriate location, please proceed to create your module file. This can be accomplished by copying and pasting the provided example file.
3
Renaming your file
Now you have a new module file, Please ensure the name of the file is the spawn code you entered in the cfg.vehicles table.
4
Vehicle Configuration
You now have a new work vehicle! Within the file you create, there are configurable variables and values that are unique to the vehicle. The details regarding this content are explained later on this page.
Tanks
This table facilitates the customization of the vehicle's foam and water tanks. Here, you can select whether the vehicle should carry water or foam, as well as specify the storage capacity for each.
---@field tanks table---@description: This table facilitates the configuration of the vehicles' foam and water tanks.['tanks'] = { canCarryWater =true, canCarryFoam =true, ['water'] = {start =1800.0, capacity =1800.0}, ---@comment 'Measured in liters' ['foam'] = {start =200.0, capacity =200.0}, ---@comment 'Measured in liters'},
Panel offset
This vector3 value represents the offset in which you can find the pumping panel interaction on the vehicle
---@field panelOffset vector3---@description: This parameter enables the configuration of the panel interaction position on the vehicle.panelOffset =vector3(-0.919, 0.34, 0.77),
Valves
This table allows for the creation and editing of the vehicles valves, These valves are section into sub tables of Intakes and discharges.
When creating an intake valve, you will be provided with two variables: label and offset. The label represents the text displayed on the pump interface, allowing for easy identification of the valve, while the offset indicates the valve's position on the vehicle.
If you are developing a discharge valve, you will receive three variables: label, offset, and type. The label represents the text displayed on the pump interface, facilitating easy identification of the valve. The offset indicates the valve's position on the vehicle, while the type allows for customization of the valve's purpose. There are four types of discharges available: water, foam, water & foam, and relay.
This table includes various functions related to the Pumping User Interfaces vehicle page. These functions have been designed to be open, allowing you to specify and configure them for your vehicles.
areLockersOpen
This function determines whether the vehicle's lockers or shutters are open, enabling the code to accurately display information on the vehicle's page. If the lockers are open, this will be reflected on the page. If this function is not configured correctly, the lockers will default to closed.
By default, the function will check for .ycd file animations, a common method used in vehicles to realistically depict the opening and closing of lockers. If your vehicle does not utilize .ycd animations, you can modify this function to check whether specific extras or doors are open. Examples are provided in the section below for further clarification.
---@param vehicle int---@returnbooleanareLockersOpen=function(vehicle)ifnotIsVehicleAConvertible(vehicle, true) thenreturnfalseendlocal state =GetConvertibleRoofState(vehicle)return state ==1or state ==2or state ==6end
Example for vehicles that utilize .ycd animations.
---@param vehicle int---@returnbooleanareLockersOpen=function(vehicle)ifnotIsVehicleAConvertible(vehicle, true) thenreturnfalseendlocal state =GetConvertibleRoofState(vehicle)return state ==1or state ==2or state ==6end
Example for vehicles that utilize toggleable extras.
---@param vehicle int---@returnbooleanareLockersOpen=function(vehicle)local extras = {4, 5}local isOpen =falsefor _, extra inpairs(extras) doifDoesExtraExist(vehicle, extra) thenifIsVehicleExtraTurnedOn(vehicle, extra) then isOpen =truebreakendendendreturn isOpenend
Example for vehicles that utilize toggleable doors
This function verifies whether the vehicle's emergency lights are activated. It will update the vehicle page on the pump interface to reflect the status of the lights. In the event of an error, this function will default to false.
By default, this function is integrated into z_els. If z_els is not utilized, additional examples are provided below this expandable section.
This function verifies whether the vehicle's emergency lights are activated. It will update the vehicle page on the pump interface to reflect the status of the lights. In the event of an error, this function will default to false.
By default, this function is integrated into z_els. If z_els is not utilized, additional examples are provided below this expandable section.
Example for vehicles that utilize toggleable extras.
---@param vehicle int---@returnboolean | nilareSceneLightsOn=function(vehicle)local extras = {4, 5}local isOn =falsefor _, extra inpairs(extras) doifDoesExtraExist(vehicle, extra) thenifIsVehicleExtraTurnedOn(vehicle, extra) then isOn =truebreakendendendreturn isOnend
isAdvisorLightOn
This function verifies whether the vehicle's advisor lights are activated. It will update the vehicle page on the pump interface to reflect the status of the advisor. In the event of an error, this function will default to false.
By default, this function is integrated into z_els. If z_els is not utilized, additional examples are provided below this expandable section.