- View New Content
-
Getting Started
-
Tutorials
Tutorial Categories
Tutorials Main Page Installation and Setup Downloadable TutorialsROM Adjustments
Number of Balls Adjustments Volume Adjustments
-
Visual Pinball Tables
VP 8 Desktop Tables
All VPM Recreations VP Recreations VP/VPM MODs VP Originals ROMsVP 9 Desktop Tables
All VPM Recreations VP Recreations VP/VPM MODs VP Originals ROMsVP9 Cabinet Tables
All Full Screen Cabinet Full Screen B2S Cabinet Spanned Cabinet Tables Media Packs ROMsVPX Tables
All VPinMAME Recreations VPX- - /VPinMAME - MOD Tables VPX Recreations VPX Originals Media Packs ROMs VR
-
Frontend Media & Backglass
Media Packs
Complete Media Packs Wheel Logos VideosBackglasses
dB2S Animated Backglasses UVP Animated Backglasses Topper Images
- Future Pinball Tables
-
Design Resources
Main Resources
Table Templates Playfield Images Image Library Sound Library Key CodesVP Guides
VP8 Guide - English VP8 Guide - Deutsch VP9 Guide - English VP9.1.x Guide - English VP Object Guide VPM DocumentationFuture Pinball Resources
Playfield Images 3D Model LibraryFuture Pinball Guides
FP Script Guide Big Draco Script Guide FP Table Design Guide FP DMD Guide
- Other Features
- Bug Tracker
- Image Gallery
- Blogs
-
More
Submitter
SUPPORT TOPIC File Information
- Submitted: Nov 12 2012 06:09 PM
- Last Updated: Nov 12 2012 06:12 PM
- File Size: 1.62MB
- Views: 2511
- Downloads: 97
Download Rosve's Fading Lights System 1.0
Fading Lights scripting
Here is a demo table and a description on how to use my fading lights code.
This system is specially made to make it easy to create really good looking lights on EM and original tables. It gives you much more control over the lights than the standard VP lights.
I have been using this code in tables like Starship Troopers, SPACE:1999, Red Dwarf, SkyRocket and many more.
---------------------------------------------------------------------------------
MANUAL (also included in the download)
- Add the Fading Lights code to the end of the table script.
- Create a new timer and name it "FLTimer". Set the interval to 33 and Enable it.
- Create a light somewhere besides the table and name it "DummyLight"
- Create 2 new collections, "L1" and "L2". Put the DummyLight in both collections.
- Make 3 playfield images with the Lights Off, Lights Halfe On, Lights Full On.
- Add all the lights needed on the playfield (light1 - 14 on the demo table).
On all the lights, Set the Off Image to the 'Lights Off' image. Set the On Image to the 'Lights Halfe On' image.
- Enter the lights into the "L1" collection.
- Copy and paste all the lights so that you get two lights in the same position.
On all the new lights, Set the Off Image to the 'Lights Halfe On' image. Set the On Image to the 'Lights Full On' image.
- Enter the new lights into the "L2" collection.
- set the variable "FLMaxLight" (3rd line in the fading lights code) to the number of lights that you made. 14 in the demo table.
YOU ARE NOW READY TO USE THE FADING LIGHTS.
-------------------------------------------
- Insert this line in the table _Init sub to initialize the fading lights system,
FLFlash 1, FLMaxLight, 0, 1, 4, 0
Use the following instructions to set a light (or a group of lights) ON, OFF or FLASHING
FLSetOn light1, light2, delay
- Light number from Light1 to Light 2 is set to ON.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights ON.
FLSetOff light1, light2, delay
- Light number from Light1 to Light 2 is set to OFF.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights OFF.
FLFlash light1, light2, repeats, on_duration, off_duration, delay
- Light number from Light1 to Light 2 is set to FLASHING.
- repeats is how many times the lights shall flash, 999 is continous flashing.
- on_duration and off_duration specifies how many timer intervals the light shall stay on and off in the flashing cycle.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights to FLASHING.
EXAMPLES
--------
Set light 4 on.
FLSetOn 4, 4, 0
Set light 3 to 6 on after a small delay,
FLSetOn 3, 6, 10
Set light 4 off.
FLSetOff 4, 4, 0
Flash light 6 three times,
FLFlash 6, 6, 2, 2, 4, 0
Flash all light one time
FLFlash 1, FLMaxLight, 0, 1, 4, 0
------------------------------------------------------------------------------------
To use it with VPM you also need this code snippet to read the lamp states.
Solenoid controlled flasher states are read like this,
This system is specially made to make it easy to create really good looking lights on EM and original tables. It gives you much more control over the lights than the standard VP lights.
I have been using this code in tables like Starship Troopers, SPACE:1999, Red Dwarf, SkyRocket and many more.
---------------------------------------------------------------------------------
MANUAL (also included in the download)
- Add the Fading Lights code to the end of the table script.
- Create a new timer and name it "FLTimer". Set the interval to 33 and Enable it.
- Create a light somewhere besides the table and name it "DummyLight"
- Create 2 new collections, "L1" and "L2". Put the DummyLight in both collections.
- Make 3 playfield images with the Lights Off, Lights Halfe On, Lights Full On.
- Add all the lights needed on the playfield (light1 - 14 on the demo table).
On all the lights, Set the Off Image to the 'Lights Off' image. Set the On Image to the 'Lights Halfe On' image.
- Enter the lights into the "L1" collection.
- Copy and paste all the lights so that you get two lights in the same position.
On all the new lights, Set the Off Image to the 'Lights Halfe On' image. Set the On Image to the 'Lights Full On' image.
- Enter the new lights into the "L2" collection.
- set the variable "FLMaxLight" (3rd line in the fading lights code) to the number of lights that you made. 14 in the demo table.
YOU ARE NOW READY TO USE THE FADING LIGHTS.
-------------------------------------------
- Insert this line in the table _Init sub to initialize the fading lights system,
FLFlash 1, FLMaxLight, 0, 1, 4, 0
Use the following instructions to set a light (or a group of lights) ON, OFF or FLASHING
FLSetOn light1, light2, delay
- Light number from Light1 to Light 2 is set to ON.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights ON.
FLSetOff light1, light2, delay
- Light number from Light1 to Light 2 is set to OFF.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights OFF.
FLFlash light1, light2, repeats, on_duration, off_duration, delay
- Light number from Light1 to Light 2 is set to FLASHING.
- repeats is how many times the lights shall flash, 999 is continous flashing.
- on_duration and off_duration specifies how many timer intervals the light shall stay on and off in the flashing cycle.
- If the Delay is larger than 0 the code will wait the specified number of timer intervals before setting the lights to FLASHING.
EXAMPLES
--------
Set light 4 on.
FLSetOn 4, 4, 0
Set light 3 to 6 on after a small delay,
FLSetOn 3, 6, 10
Set light 4 off.
FLSetOff 4, 4, 0
Flash light 6 three times,
FLFlash 6, 6, 2, 2, 4, 0
Flash all light one time
FLFlash 1, FLMaxLight, 0, 1, 4, 0
------------------------------------------------------------------------------------
To use it with VPM you also need this code snippet to read the lamp states.
Dim NewState(200) Dim OldState(200) FLTimer.Interval = 21 LampTimer.Interval = 10 LampTimer.Enabled = 1 Sub SetFlasher(nr, value) NewState(nr) = abs(value) End Sub Sub LampTimer_Timer() Dim chgLamp, num, chg, ii chgLamp = Controller.ChangedLamps If Not IsEmpty(chgLamp) Then For ii = 0 To UBound(chgLamp) ' **UPDATE LAMP STATES *** If chgLamp(ii, 1)=0 then FLSetOff chgLamp(ii, 0), chgLamp(ii, 0), 0 else FLSetOn chgLamp(ii, 0), chgLamp(ii, 0), 0 end if Next End If For ii=81 to 88 ' ******** FLASHER NUMBERS ************* If NewState(ii) <> OldState(ii) then OldState(ii)=NewState(ii) If NewState(ii)=0 then FLSetOff ii, ii. 0 else FLSetOn ii, ii, 0 end if end if Next End Sub
Solenoid controlled flasher states are read like this,
SolCallBack(25)="SetFlasher 81, " 'red x 4 SolCallBack(26)="SetFlasher 82, " 'yellow x 4 SolCallBack(27)="SetFlasher 83, " 'green x 4 SolCallBack(28)="SetFlasher 84, " 'blue x 4 SolCallBack(29)="SolWarrior" 'flash multiball x 4 SolCallBack(30)="SetFlasher 86, " 'left ramp x 4 SolCallBack(31)="SetFlasher 87, " 'right ramp x 4 SolCallBack(32)="SetFlasher 88, " 'pops x 2
Other files you may be interested in ..
- 18,404 Total Files
- 57 Total Categories
- 874 Total Authors
- 25,503,174 Total Downloads
- Comics (Rally 1968) Latest File
- batch Latest Submitter
user(s) are online (in the past 15 minutes)
members, guests, anonymous users










are all trademarks of VPFORUMS.