Creating Patterns
This page provides comprehensive information about our configuration files, assisting in the setup of the resource.
Introduction
z_els provides the opportunity to personalize your own lighting patterns for ELS capable vehicles. This page will guide you through the process of creating and modifying these patterns to be used in your server.
To start, please access the file /config/patterns.lua. Inside this file, you'll come across an array of various objects/tables, each associated with a distinct lighting feature of the vehicle, such as rear reds and front blues.
Zea Development offers a range of pre-designed lighting patterns that are readily and conveniently configured for vehicle use.
Creating a new pattern: Part 1
In order to develop a new lighting pattern for a specific lighting feature, it is necessary to create a new object/table within the existing lighting features object/table. This new object/table should be positioned below the comment that marks the end of the previous table. These comments have been designed to clearly indicate the beginning and end of each object/table.
To generate a new object/table, please input the following code: ['PATTERN_NAME'] = {}
. A sample is shown underneath for reference.
Now that we have successfully created our object/table, we can proceed with establishing the lighting pattern within it. We strongly recommend choosing a name for the pattern that is both coherent and easily recognizable for future purposes.
Creating a new pattern: Part 2
In order to generate the precise lighting pattern indicated in the script, we must establish an array of tables within the pattern table. Each table will symbolize a single flash of some extras. For instance:
{ activate = {7}, delay = 250 }
This object/table will activate extra number 7 and subsequently deactivate it after a duration of 250 milliseconds.
We have the capability to incorporate numerous supplementary features into the activate section by modifying the code as follows: { activate = {1, 2, 3, 4, 5}, delay = 250 }
. Consequently, this object/table will activate extras 1-5 for a duration of 250 milliseconds.
We have the capability to incorporate multiple instances of these objects/tables into the pattern in order to simulate a more realistic lighting pattern. Below, you will find an example showcasing a straightforward slow left and right pattern.
Please make sure to include a comma after each closing bracket. Failure to do so will result in an error and the script will cease to function.
Last updated