AMELS Framework [BETA 0.1]

:information_source: This framework is still in development!

:military_helmet: Expect bugs, poor code quality, unfinished features and more.
:screwdriver: Current Version: BETA 0.1

:rotating_light: The AMELS framework provides a versatile platform for creating customizable emergency lighting patterns for vehicles. This framework offers flexibility and ease of use, allowing developers to define intricate lighting sequences tailored to specific vehicles and scenarios.

:books: Bulletin-Board

Key Features

1. Customizable Patterns :bookmark_tabs:

  • Define unique lighting patterns for different stages.
  • Specify patterns for individual lights or groups of lights on the vehicle.
  • Adjust timing, intensity, and synchronization to create dynamic visual effects.
-- Define a pattern for Stage1 with specific lighting sequences
Stage1 = {
    patterns = {
        all = {
            _delay = 0.1,
            _tween = false,
            _rps = 2,
            _TA = true,
            L_ = {2, 0, 3, 0},
            FR_ = {0, 2, 0, 3},
            M_ = {2, 2, 3, 3},
        },
    }
}

2. Stage Management :moyai:

  • Organize lighting patterns into stages to simulate different emergency scenarios.
  • Enable or disable specific stages based on the situation.
  • Seamlessly transition between stages to reflect changing conditions.
-- Define stages for different emergency scenarios
Stage1 = {
    _allowsiren = false,
    patterns = { ... },
}

Stage2 = {
    _allowsiren = false,
    patterns = { ... },
}

Stage3 = {
    _allowsiren = true,
    patterns = { ... },
}

3. Synchronization :arrow_right_hook:

Not the best, update on the rewrite (BETA 0.4)

  • Maintain synchronization among multiple lights to ensure a cohesive visual presentation.
  • Dynamically adjust timing and delays based on pattern.

4. Flexibility :muscle:

  • Easily customize patterns and stages to suit different vehicle types and emergency response scenarios.
  • Add new lights or modify existing ones without extensive reworking of the framework.
-- Customize patterns for different vehicle types and emergency scenarios
Stage1 = {
    patterns = {
        all = { ... },
    }
}

Stage2 = {
    patterns = {
        all = { ... },
        lbback = { ... },
    }
}
Getting Started

To use the ELS framework:

Requirements :carpentry_saw:

  • A-Chassis T Build 6.5 or higher
  • Knowlege of lua tables, lists and module scripts

Setting up (Server) :roll_of_toilet_paper:

  • Place all the files in to the desired folders and services
  • Navigate to ReplicatedStorage > AMELS > GlobalConfigs
  • Create a new module script and name it your config name (will be needed later)
Starting clean (Not recommended!)
local ELSCfg = {

	keybinds = {
	},

	sirens = {
	},

	colors = {
	},

	assign = {
	},

	stages = {
		
		stage_zero = {

			_allowsiren = false,
			_pausesirenonhorn = true,

		},

	}

}

return ELSCfg

:information_source: Then follow the Code Explained section on this page!

Starting with a template
local ELSCfg = {

	keybinds = {		--recommended keybind config: (Might conflit with tools!)
		horn = "h",			--H for horn
		man = "t",			--T for manua
		srn1 = "one",		--1 for wail
		srn2 = "two",		--2 for yelp
		srn3 = "three",		--3 for priority
		srn4 = "four",		--4 for hi-lo
		dual1 = "five",		--5 for second wail
		dual2 = "six",		--6 for second yelp
		stg = "j",			--j for stage toggle
		ta = "k",			--k for ta toggle
	},

	sirens = {		--recommended siren config (roblox audio ID's):
		horn = 0, 		--horn
		man = 0,		--manual
		srn1 = 0,		--wail
		srn2 = 0,		--yelp
		srn3 = 0,		--priority
		srn4 = 0,		--hi-lo
		dual1 = 0,		--wail
		dual2 = 0,		--yelp
	},

	colors = {				--recommended color config:
		"255, 255, 255",		-- White
		"190, 104, 98",			-- Red
		"94, 128, 202",			-- Blue
		"218, 133, 65"			-- Yellow
	},

	assign = {

		stgOrder = {"Stage1"}, 	--you can leave out stages and use them else were like the ta

		taOrder = {"ta"}, 		--same as stgOrder but for TA

		TDLights = false, 		--takedown light names

		Alleys = {
			Left = false, 		--Alley Left light names
			Right = false, 		--Alley Right light names
			Scene = false, 		--Alley Scene light names
		}

	},

	stages = {

		stage_zero = {					--This must exit for reference

			_allowsiren = false,		--Allow toggle siren on stage?
			_pausesirenonhorn = true,	--Should horn pause sirens?

		},

		Stage1 = {						--Stage name

			_allowsiren = false,		--Allow toggle siren on stage?

			patterns = {				--Patterns table

				all = {					--Pattern name

					_delay = 0.1,		--delay
					_tween = false,		--use tweens? Good for fading!
					_rps = 2,			--This will repeat each step by the amount set
					_TA = true,			--Should be on when TA is on?

					--Light sequeces (see more on docs)

				},

			}

		},

		ta = {							--Stage name

			patterns = {				--Patterns table

				back = {				--Pattern name

					_delay = 0.1,		--delay
					_tween = false,		--use tweens? Good for fading!
					_rps = 0,			--This will repeat each step by the amount set
					_TA = true,			--Should be on when TA is on?

					--Light sequeces (see more on docs)

				},

			}

		},

	}

}

return ELSCfg

:information_source: Then follow the Code Explained section on this page!

Setting up (Vehicle) :red_car:

  • Get the AMELS local script (Placed on a test vehicle or the workspace)
  • Navigate to your vehicle > A-Chassis > Plugins
  • Place it there and open the module script inside it
Vehicle CFG Template
local VehicleConfig = {
	
	use_cfg = "Your Global CFG Name",
	
	click_sounds = false, --place the click sound ID here if you want click sounds
}

return VehicleConfig

Testing :hammer_and_wrench:

Test the lighting patterns, stages and sirens in various scenarios to ensure they meet your requirements.

Customization :paintbrush:

Customize as needed to suit your specific needs, including the main framework (if you know how to)

Code Explained

Framework Pattern Creation :bookmark:

In this framework, pattern creation is a flexible and customizable process that allows anyone to define intricate lighting sequences for vehicles. The framework leverages special characters and clone patterns to simplify the creation of complex lighting effects.

:warning: This section will explain most of the code and how it works, this can change on version updates

1. Search Magic Character (_)

The underscore (_) serves as a search magic character in pattern creation. It allows developers to match multiple lights (parts) based on a common prefix. For example, using a_ will match all lights starting with a followed by any characters.

-- Match all lighting configurations starting with "a"
a_ = { ... }

2. Clone Pattern

The clone pattern enables the duplication of existing lighting configurations with additional modifications or transformations. Specify an existing configuration to clone and apply additional operations to the cloned configuration.

-- Clone the "RXR_" lighting configuration
RXWL_ = {_clone = "RXR_", ops = {}}

2.1 Replacing Colors

Replacing colors allows modifications the color scheme of cloned lighting configurations. By specifying color replacement operations, developers can dynamically adjust the colors of specific lighting elements within the cloned configuration.

-- Clone the "RXR_" lighting configuration and replace colors
RXWL_ = {_clone = "RXR_", ops = {"c 2 -> 1", "c 3 -> 1"}}

2.2 Reversing

Reversing lighting configurations allows the mirror or inverse effects for cloned configurations. This technique is useful for creating symmetrical or complementary lighting patterns on vehicles.

-- Clone the "RXR_" lighting configuration and reverse it
RXWL_ = {_clone = "RXR_", ops = {"rev"}}

2.3 Multiple ops

Combine the color replacement and reversing to allow for more possibilities with the pattern creation

-- Clone the "RXR_" lighting configuration, reverse it and change colors
RXWL_ = {_clone = "RXR_", ops = {"rev", "c 2 -> 1"}}

Conclusion

By leveraging search magic characters, clone patterns, color replacement, and reversing techniques, it allows to create dynamic and visually appealing lighting patterns for vehicles within the framework. These advanced features offer flexibility and customization options to meet the specific requirements of different vehicles and scenarios.

Development Roadmap

:flight_departure: Expected roadmap for updates, can change depending on needs.
Im not working on this full-time, this is just a side project of mine!

:white_check_mark: BETA 0.1 Initial release
:arrow_forward: BETA 0.2 Better pattern syncing
:arrow_forward: BETA 0.3 Better vehicle cfg
:arrow_forward: BETA 0.4 Expansion support (Plugins)
:arrow_forward: BETA 0.5 Rewrite (Usage of classes)
:arrow_forward: BETA 0.6 Single digit vehicle syncing
:arrow_forward: BETA 0.7 Double digit vehicle syncing
:arrow_forward: BETA 0.8 Vehicle UI completion
:arrow_forward: BETA 0.9 Better server-client events

:fast_forward: PRE-RELEASE 1 Code optimizations
:fast_forward: PRE-RELEASE 2 Server optimizations
:fast_forward: PRE-RELEASE 3 UI optimizations

:checkered_flag: FINEAL RELEASE Prob everything will be done

AMELS BETA01.rbxm (2.8 MB)

tigas778 @ 2024
Github | Roblox