Zea Development - Documentation
StoreWebsiteDiscord
  • Welcome
  • General
    • Downloading Resources
    • Transferring Resources
    • Resource Support
    • Escrow Errors
  • Our Resources
    • z_hose
      • Resource Configuration
        • Configuration Modules
      • Compatibility with ox_inventory
      • Resource Usage
      • Developer Resources
        • Client Exports
        • Server Exports
    • z_boot (Coming Soon!)
      • Resource Configuration
        • Configuration Modules
        • Item Creation
      • Developer Resources
        • Client Exports
    • z_els
      • Resource Configuration
      • Resource Usage
      • Developer Exports
      • Creating Patterns
      • Directional Types
    • z_fires
      • Resource Configuration
      • JSON Configuration
      • Resource Usage
      • Developer Exports
      • Materials List
    • z_ppvfan
      • Resource Configuration
      • Resource Usage
    • zTurnout-System
      • Resource Configuration
      • Resource Usage
      • Trigger Events
    • zWigWags
      • Resource Configuration
      • Resource Usage
      • Trigger Events
    • zFire-Alarm
      • Resource Configuration
      • Resource Usage
    • z9m-Ladder
      • Resource Configuration
      • Resource Usage
    • z105m-Ladder
      • Resource Configuration
      • Resource Usage
    • z135m-Ladder
      • Resource Configuration
      • Resource Usage
    • zCustody-Alarm
      • Resource Configuration
      • Resource Usage
    • zFire-Pole
      • Resource Configuration
      • Resource Usage
    • zTurnout-Rack
      • Resource Configuration
      • Resource Usage
    • zPager
      • Resource Configuration
      • Resource Usage
    • zTurnouts
      • Resource Configuration
      • Resource Usage
Powered by GitBook
On this page
  • Introduction
  • Creating a new pattern: Part 1
  • Creating a new pattern: Part 2
  1. Our Resources
  2. z_els

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.

patterns['rearReds'] = {
   -- Table Start --
   ['Slow-Reds'] = {
      { activate = {7}, delay = 250 },
      { activate = {}, delay = 75 },
      { activate = {9}, delay = 250 },
      { activate = {}, delay = 75 },
   },
   -- Table End --
   -- Table Start --
   ['PATTERN_NAME'] = {},
   -- Table End --
}

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.

patterns['rearReds'] = {
   -- Table Start --
   ['Slow-Reds'] = {
      { activate = {7}, delay = 250 },
      { activate = {}, delay = 75 },
      { activate = {9}, delay = 250 },
      { activate = {}, delay = 75 },
   },
   -- Table End --
   -- Table Start --
   ['PATTERN_NAME'] = {
      { activate = {1, 2}, delay = 250 },
      { activate = {}, delay = 75 },
      { activate = {3, 4}, delay = 250 },
      { activate = {}, delay = 75 },
   },
   -- Table End --
}

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.


PreviousDeveloper ExportsNextDirectional Types

Last updated 9 months ago

Page cover image