Wecoc
Pinball Wizard
- Joined
- Dec 7, 2021
- Messages
- 81
- Reaction score
- 124
- Points
- 40
- Favorite Pinball Machine
- Cirqus Voltaire
Script Light Sequencer (SLSeq) is a Future Pinball Script that recreates the default Light Sequencer, but on an open source and customizable VBScript code. The script is not meant to overwrite the default Sequencer, but to use it side by side when the default one falls short. They're therefore compatible, and for the most part they work in a very similar way.
SLSeq is also compatible with BAM and FizX. No credits are required.
Current version: 2.00
----------------------------------------
[7th November 2023]: New version 2.00 available! The topic still includes both, but I highly recommend using the last version.
The new version removes the limit of 500 lights per sequencer and the upper bound of 50 pending effects in queue. It also includes new functionalities for BAM, that allow more complex effects with multicolour lights, or lights that can be turned on/off smoothly. Check the new demo for more details!
----------------------------------------
- The default limitation of only one light per each 15x15 millimeter cell is no longer applied.
- You can define the rect where the sequencer applies, instead of always using the full table / translite. With this, you can have more control on the effect applied on "light grids" or a mini-playfield. (See for example the 5x5 light grid in Jack Bot).
- The "Virtual Center" coordinates can be changed dynamically.
- Custom Random-like and List Order effects are easier to implement using a For Loop.
- Multiple Sequencers can be reduced to only one Editor Object (Timer).
- It's possible to control the state cache (preservation of the original light states) when the queue ends.
- It's possible to control if the effect is ignored on lights that are already lit.
- You can create custom light effects using a grayscale image as a mask.
- [Advanced] You can create custom light effects with "variable tail lengths" using an additional mask.
First, import the two VBS scripts to your table's code.
LightScriptEffects.vbs is used to define the effects. You can make custom ones at the end of this code, or in your table's code after importing it.
LightScriptSequencer.vbs controls how the sequencer works under the hood.
Then, define a variable for your sequencer, add each Light on the Sequencer, and define which Timer it uses. Usually, the Timer will always be enabled.
Finally, you can use it as always, with Play, StopPlay, etc.
You will find more details in the Manual.
SLSeq is also compatible with BAM and FizX. No credits are required.
Current version: 2.00
----------------------------------------
[7th November 2023]: New version 2.00 available! The topic still includes both, but I highly recommend using the last version.
The new version removes the limit of 500 lights per sequencer and the upper bound of 50 pending effects in queue. It also includes new functionalities for BAM, that allow more complex effects with multicolour lights, or lights that can be turned on/off smoothly. Check the new demo for more details!
----------------------------------------
Properties and Enhancements
- The code is open and can be further modified according to your table.- The default limitation of only one light per each 15x15 millimeter cell is no longer applied.
- You can define the rect where the sequencer applies, instead of always using the full table / translite. With this, you can have more control on the effect applied on "light grids" or a mini-playfield. (See for example the 5x5 light grid in Jack Bot).
- The "Virtual Center" coordinates can be changed dynamically.
- Custom Random-like and List Order effects are easier to implement using a For Loop.
- Multiple Sequencers can be reduced to only one Editor Object (Timer).
- It's possible to control the state cache (preservation of the original light states) when the queue ends.
- It's possible to control if the effect is ignored on lights that are already lit.
- You can create custom light effects using a grayscale image as a mask.
- [Advanced] You can create custom light effects with "variable tail lengths" using an additional mask.
Instructions
I included a Manual on the demo, but here's a summary on how this works.First, import the two VBS scripts to your table's code.
Code:
ExecuteGlobal LoadExternalScript("LightScriptEffects.vbs")
ExecuteGlobal LoadExternalScript("LightScriptSequencer.vbs")
LightScriptEffects.vbs is used to define the effects. You can make custom ones at the end of this code, or in your table's code after importing it.
LightScriptSequencer.vbs controls how the sequencer works under the hood.
These two files are all you need on your table from the demo, everything else was made as a helper.
Then, define a variable for your sequencer, add each Light on the Sequencer, and define which Timer it uses. Usually, the Timer will always be enabled.
Code:
Dim LightSeq : Set LightSeq = New LightScriptSequencer
LightSeq.Name = "LightSeq"
LightSeq.SetLight(Bumper1)
LightSeq.SetLight(Bumper2)
LightSeq.SetLight(RampFlasher)
'(...)
LightSeq.SetTimer(LightSeqTimer)
Sub LightSeqTimer_Expired() : LightSeq.Timer_Expired() : End Sub
Finally, you can use it as always, with Play, StopPlay, etc.
Because of VBScript limitations, you will have to define the number of arguments of Play with an extra digit on its name, in those cases where not all parameters are defined.
Code:
Sub SetLightsForAttractMode
LightSeq.Play3 ScriptSeqUpOn, 50, 2
LightSeq.Play3 ScriptSeqDownOn, 50, 2
LightSeq.Play2 ScriptSeqStripe1VertOn, 50
End Sub
You will find more details in the Manual.
Attachments
Last edited: