Jump to content



Photo
* * * * * 1 votes

DOFLinx - Future Pinball - Animated Effects for RGB Flashers in a Pinball Cabinet - Tutorial

DOFLinx Flashers RGB Future Pinball

  • Please log in to reply
No replies to this topic

#1 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,956 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 07 November 2016 - 02:22 AM

Now that we have DOFLinx, Future Pinball can have some pretty cool animated effects with the RGB flashers in a pinball cabinet. This can be added into the script for a table fairly easily.

 

Some examples of what can be done can be seen here in the video demos of the DOFlinx mods I did with Aliens Legacy, Robocop, and Superman.

 

 

 

 

 

I decided to try to explain how to do some of these effects the best I can. I'm still very new to Visual Basic scripting, so bear that in mind if I'm not explaining things exactly correctly. You will be editing the script for a table in Future Pinball as well as creating Timers.

 

 

For an RGB flasher animation you need the following:

 

- a Timer (for how long each cycle will be)

- a Dim variable for setting the "stage" value (where the animation will begin in the animation sub routine)

- command to set the "stage" variable value (where the animation cycle begins), and another to enable the Timer (start the flasher animation)

- the DOFLinx flasher animation sub routine

 

 

I'll use some examples from the Aliens Legacy DOFLinx mod I did.

 

Note: The Future Pinball script entries are in GREEN. Always add a 'DOFLinx  comment with each entry or section that you add for easy reference later.

 

======================================================

 

The Left Turret machine gun flasher animation:

 

 

You can see a video of this effect here at 3:45 

 

https://goo.gl/K0nQh6

 

 

 

TIMER:

 

-create a Timer. I named it DOFLinx_Left_Turret and put it on the Translite. Don't enable it. Timer Interval=50 (this will vary with different animated effects). This Timer will determine the time (in ms) between each cycle of the animation.

 

 

Dim variable for setting the "stage" value:

 

-declare a global variable that will be understood throughout the entire table script. Put this at the beginning of the script with the other Dim variables.

 

Dim DOFLinx_Left_Turret_Stage     'DOFLinx - Left Turret - Flasher animation - Set Stage

 

 

Commands to set "Stage" value, and enable the "DOFLinx_Left_Turret" Timer:

 

- you will need to choose how and when your flasher animation will be triggered. This will vary depending on your needs. For the Left Turret animation, I put the needed commands in the    Sub LeftCanon()  sub routine. These are the commands I needed.

 

DOFLinx_Left_Turret_Stage=1  'DOFLinx - Left Turret - Flasher animation - Set Stage value

DOFLinx_Left_Turret.Enabled=True  'DOFLinx - Left Turret Timer Enabled - Start animation

 

The DOFLinx_Left_Turret_Stage=1 command will set what Stage the animation cycle will begin in the DOFLinx Flasher Animation sub routine.

 

The DOFLinx_Left_Turret.Enabled=True command will enable the Timer which will trigger the DOFLinx flasher animation sub routine (in this case after 50ms). Note, that a Timer does not just run once. It will continually cycle (Timer Interval) over and over until a DOFLinx_Left_Turret.Enabled=False is given.

 

 

DOFLinx RGB Flasher animation sub routine:

 

- this sub routine will be the DOFLinx commands that will trigger your RGB flashers. I tend to have this somewhere in the "Future Pinball Defined Script Events" section.

 

'DOFLinx - Flashers animation for Left Sling Turret - Left to Center
Sub DOFLinx_Left_Turret_Expired()
  Select Case DOFLinx_Left_Turret_Stage
    Case 1 : DOFLinx_Left_Turret_Stage=2
                   FF_Flasher DV_FLOL,FL_FL,2,10,100,"Yellow"
    Case 2 : DOFLinx_Left_Turret_Stage=3
                   FF_Flasher DV_FLIL,FL_FL,2,10,100,"Yellow"
    Case 3 : DOFLinx_Left_Turret_Stage=4
                   FF_Flasher DV_FLCN,FL_FL,2,10,100,"Yellow"
    Case 4 : DOFLinx_Left_Turret_Stage=5
                   FF_Flasher DV_FLOL,FL_FL,2,10,100,"Yellow"
    Case 5 : DOFLinx_Left_Turret_Stage=6
                   FF_Flasher DV_FLIL,FL_FL,2,10,100,"Yellow"
    Case 6 : DOFLinx_Left_Turret_Stage=7
                   FF_Flasher DV_FLCN,FL_FL,2,10,100,"Yellow"
    Case 7 : DOFLinx_Left_Turret_Stage=8
                   FF_Flasher DV_FLOL,FL_FL,2,10,100,"Yellow"
    Case 8 : DOFLinx_Left_Turret_Stage=9
                   FF_Flasher DV_FLIL,FL_FL,2,10,100,"Yellow"
    Case 9 : DOFLinx_Left_Turret_Stage=10
                   FF_Flasher DV_FLCN,FL_FL,2,10,100,"Yellow"
    Case 10 : DOFLinx_Left_Turret_Stage=11
                   FF_Flasher DV_FLOL,FL_FL,2,10,100,"Yellow"
    Case 11 : DOFLinx_Left_Turret_Stage=12
                   FF_Flasher DV_FLIL,FL_FL,2,10,100,"Yellow"
    Case 12 : DOFLinx_Left_Turret_Stage=1
                   FF_Flasher DV_FLCN,FL_FL,2,10,100,"Yellow"
             DOFLinx_Left_Turret.Enabled=false
  end Select
End Sub
 
-every time the  DOFLinx_Left_Turret  Timer expires, Future Pinball will then run the sub routine  Sub DOFLinx_Left_Turret_Expired()
-the   Select Case DOFLinx_Left_Turret_Stage entry means that each time we go back into Sub DOFLinx_Left_Turret_Expired(), the next line run will be determined by the value of  DOFLinx_Left_Turret_Stage  
-since DOFLinx_Left_Turret_Stage=1 was set previously in the script, the first part of this sub routine that will occur is:
           Case 1 : DOFLinx_Left_Turret_Stage=2
                          FF_Flasher DV_FLOL,FL_FL,2,10,100,"Yellow"
-then all the other sections with Case will be ignored for this cycle, and:
           end Select
        End Sub
will end the sub routine. 
-however, since we still have DOFLinx_Left_Turret.Enabled=True , after it expires again, Sub DOFLinx_Left_Turret_Expired() will be run. This time it will run the next Case section.
-we will have this cycle continue on until we get to:
           Case 12 : DOFLinx_Left_Turret_Stage=1
                            FF_Flasher DV_FLCN,FL_FL,2,10,100,"Yellow"
                            DOFLinx_Left_Turret.Enabled=false
-the last part of the DOFLinx flasher animation finishes and we stop the cycle by disabling the DOFLinx_Left_Turret Timer with DOFLinx_Left_Turret.Enabled=false
 
 
This is a fairly simple animation. You can use other variables and Timers to cut down on the commands needed if you want. You could also have the animation repeat itself and have the Timer disabled at another section of the script instead. The Timer and flasher values will need to be adjusted to your specific needs.
 
The DOFLinx flasher animation sub routine can be adjusted to whatever you want with as many flashers or other cabinet toys in each "Case" section as you want. You can mix things up with fading effects, flash / fade and stay on or off, multiple flashers at once, etc.  Lots of different uses!
 
 
 
Other Examples:
 
Here are some other examples from the Aliens Legacy DOFLinx mod I did. The variables, and Timer names,etc will be different but the application of it is still the same.
 
Nuclear Explosion at 10:25 
 
https://goo.gl/lQtl56
 
'DOFLinx - Nuclear_Explosion - Flashers animation
Sub DOFLinx_Nuclear_Explosion_Expired()
  Select Case DOFLinx_Nuclear_Explosion_Stage
    Case 1 : DOFLinx_Nuclear_Explosion_Stage=2
FF_Flasher DV_FLCN,FL_FD,2,20,100,"Orange"
    Case 2 : DOFLinx_Nuclear_Explosion_Stage=3
FF_Flasher DV_FLIL,FL_FD,2,20,100,"Orange"
FF_Flasher DV_FLIR,FL_FD,2,20,100,"Orange"
    Case 3: DOFLinx_Nuclear_Explosion_Stage=4
FF_Flasher DV_FLOL,FL_FD,2,20,100,"Orange"
FF_Flasher DV_FLOR,FL_FD,2,20,100,"Orange"
    Case 4 : DOFLinx_Nuclear_Explosion_Stage=5
FF_Flasher DV_FLCN,FL_FD,2,20,100,"Yellow"
    Case 5 : DOFLinx_Nuclear_Explosion_Stage=6
FF_Flasher DV_FLIL,FL_FD,2,20,100,"Yellow"
FF_Flasher DV_FLIR,FL_FD,2,20,100,"Yellow"
    Case 6: DOFLinx_Nuclear_Explosion_Stage=7
FF_Flasher DV_FLOL,FL_FD,2,20,100,"Yellow"
FF_Flasher DV_FLOR,FL_FD,2,20,100,"Yellow"
    Case 7 : DOFLinx_Nuclear_Explosion_Stage=8
FF_Flasher DV_FLCN,FL_FD,2,20,100,"White"
    Case 8 : DOFLinx_Nuclear_Explosion_Stage=9
FF_Flasher DV_FLIL,FL_FD,2,20,100,"White"
FF_Flasher DV_FLIR,FL_FD,2,20,100,"White"
    Case 9: DOFLinx_Nuclear_Explosion_Stage=10
FF_Flasher DV_FLOL,FL_FD,2,20,100,"White"
FF_Flasher DV_FLOR,FL_FD,2,20,100,"White"
    Case 10 : DOFLinx_Nuclear_Explosion_Stage=11
FF_Flasher DV_FLCN,FL_FD,2,20,100,"Orange"
    Case 11 : DOFLinx_Nuclear_Explosion_Stage=12
FF_Flasher DV_FLIL,FL_FD,2,30,100,"Orange"
FF_Flasher DV_FLIR,FL_FD,2,30,100,"Orange"
    Case 12: DOFLinx_Nuclear_Explosion_Stage=1
FF_Flasher DV_FLOL,FL_FD,2,40,100,"Orange"
FF_Flasher DV_FLOR,FL_FD,2,40,100,"Orange"
DOFLinx_Nuclear_Explosion.Enabled=false
  end Select
End Sub
 
 
Pod Escape Sequence at 10:16. Note that I use another variable (DOFLinx_Pod_Escape_Count) that increases in value after each cycle. Then I disable the animation once DOFLinx_Pod_Escape_Count=3 
 
https://goo.gl/acz53J
 
'DOFLinx Pod Escape Flasher Sequence - Center to Outer cycle
Sub DOFLinx_Pod_Escape_Expired()
  Select Case DOFLinx_Pod_Escape_Stage
    Case 1 : DOFLinx_Pod_Escape_Stage=2
'Leave first Flasher blank for each cycle
    Case 2 : DOFLinx_Pod_Escape_Stage=3
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Yellow"
    Case 3 : DOFLinx_Pod_Escape_Stage=4
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Yellow"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Yellow"
    Case 4 : DOFLinx_Pod_Escape_Stage=5
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Yellow"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Yellow"
   Case 5 : DOFLinx_Pod_Escape_Stage=6
'Leave first Flasher blank for each cycle
    Case 6 : DOFLinx_Pod_Escape_Stage=7
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Green"
    Case 7 : DOFLinx_Pod_Escape_Stage=8
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Green"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Green"
    Case 8 : DOFLinx_Pod_Escape_Stage=9
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Green"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Green"
   Case 9 : DOFLinx_Pod_Escape_Stage=10
'Leave first Flasher blank for each cycle
    Case 10 : DOFLinx_Pod_Escape_Stage=11
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Blue"
    Case 11 : DOFLinx_Pod_Escape_Stage=12
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Blue"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Blue"
    Case 12 : DOFLinx_Pod_Escape_Stage=13
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Blue"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Blue"
   Case 13 : DOFLinx_Pod_Escape_Stage=14
'Leave first Flasher blank for each cycle
    Case 14 : DOFLinx_Pod_Escape_Stage=15
FF_Flasher DV_FLCN,FL_FD,2,10,100,"White"
    Case 15 : DOFLinx_Pod_Escape_Stage=16
FF_Flasher DV_FLIL,FL_FD,2,10,100,"White"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"White"
    Case 16 : DOFLinx_Pod_Escape_Stage=17
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"White"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"White"
   Case 17 : DOFLinx_Pod_Escape_Stage=18
'Leave first Flasher blank for each cycle
    Case 18 : DOFLinx_Pod_Escape_Stage=19
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Red"
    Case 19 : DOFLinx_Pod_Escape_Stage=20
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Red"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Red"
    Case 20 : DOFLinx_Pod_Escape_Stage=21
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Red"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Red"
   Case 21 : DOFLinx_Pod_Escape_Stage=22
'Leave first Flasher blank for each cycle
    Case 22 : DOFLinx_Pod_Escape_Stage=23
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Orange"
    Case 23 : DOFLinx_Pod_Escape_Stage=24
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Orange"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Orange"
    Case 24 : DOFLinx_Pod_Escape_Stage=25
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Orange"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Orange"
   Case 25 : DOFLinx_Pod_Escape_Stage=26
'Leave first Flasher blank for each cycle
    Case 26 : DOFLinx_Pod_Escape_Stage=27
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Cyan"
    Case 27 : DOFLinx_Pod_Escape_Stage=28
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Cyan"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Cyan"
    Case 28 : DOFLinx_Pod_Escape_Stage=29
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Cyan"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Cyan"
   Case 29 : DOFLinx_Pod_Escape_Stage=30
'Leave first Flasher blank for each cycle
    Case 30 : DOFLinx_Pod_Escape_Stage=31
FF_Flasher DV_FLCN,FL_FD,2,10,100,"Purple"
    Case 31 : DOFLinx_Pod_Escape_Stage=32
FF_Flasher DV_FLIL,FL_FD,2,10,100,"Purple"
FF_Flasher DV_FLIR,FL_FD,2,10,100,"Purple"
    Case 32 : DOFLinx_Pod_Escape_Stage=1
               FF_Flasher DV_FLOL,FL_FD,2,10,100,"Purple"
FF_Flasher DV_FLOR,FL_FD,2,10,100,"Purple"
DOFLinx_Pod_Escape_Count=(DOFLinx_Pod_Escape_Count + 1)
IF DOFLinx_Pod_Escape_Count=3 THEN
             DOFLinx_Pod_Escape.Enabled=False
END IF
  end Select
End Sub
 

 

===========================================================

 

Light Sequences:

 

Future Pinball can use something called a Light Sequence to make animated effects easier. However DOFLinx doesn't have an equivalent command to mimic this yet. The following is an example of trying to mimic this with your own DOFlinx flasher animation.

 

The original Future Pinball command will flash a specific flasher on (1) and off (0) with the time in between each cycle set to 100. 

 

FlasherNest.Set BulbBlink, "101000101000", 100

 

This will continue to cycle until  another command is given to stop the light sequence.

 

 

This is an example of a DOFLinx sub routine needed to mimic this. Video example below starts at 8:26

 

https://goo.gl/EcEAfZ

 

You may have to play with the timing for your Timer, etc...

 
'DOFLinx FlasherNest 12 "101000101000", 100
Sub DOFLinx_FlasherNest_12_Expired()
  Select Case DOFLinx_FlasherNest_12_Stage
    Case 1 : DOFLinx_FlasherNest_12_Stage=2
FF_Flasher DV_FLOL,FL_FL,2,30,100,"Yellow"
    Case 2 : DOFLinx_FlasherNest_12_Stage=3
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 3 : DOFLinx_FlasherNest_12_Stage=4
FF_Flasher DV_FLOL,FL_FL,2,30,100,"Yellow"
    Case 4 : DOFLinx_FlasherNest_12_Stage=5
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 5 : DOFLinx_FlasherNest_12_Stage=6
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 6 : DOFLinx_FlasherNest_12_Stage=7
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 7 : DOFLinx_FlasherNest_12_Stage=8
FF_Flasher DV_FLOL,FL_FL,2,30,100,"Yellow"
    Case 8 : DOFLinx_FlasherNest_12_Stage=9
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 9 : DOFLinx_FlasherNest_12_Stage=10
FF_Flasher DV_FLOL,FL_FL,2,30,100,"Yellow"
    Case 10 : DOFLinx_FlasherNest_12_Stage=1
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 11 : DOFLinx_FlasherNest_12_Stage=10
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
    Case 12 : DOFLinx_FlasherNest_12_Stage=1
FF_Flasher DV_FLOL,FL_OFF,0,0,100,"Yellow"
end select
End Sub
 
This sub routine will continue to cycle over and over until the 'DOFLinx_FlasherNest_12.Enabled=False command is triggered elsewhere in the script.
 
 
 
FF_FlasherForMs for a single flasher animation:
 
If you have a single flasher on a table that uses the  flashforms command, you could easily mimic it's flashing exactly with the DOFLinx FF_FlasherForMs command.
 
This is an example of how to use FF_FlasherForMs to have a RGB flasher work with the flashforms values, instead of using FF_Flasher and trying to guess your timings for the flashing.
 
flasher1.flashforms 1000, 500, bulboff   'The Future Pinball flashforms command
 
FF_FlasherForMs 1000,500,bulboff,DV_FLOL,100,"Orchid"   'DOFLinx-Flasher-Outer Left, ends with flasher off (bulboff), 100 % intensity, Colour = Orchid
 
 
 
SUMMARY:
 
I know this seems like alot of stuff to take in....but when you understand how it works, you can just copy and paste each section and just change up the bits you need for your table. Once you have a bunch of different DOFLinx flasher animation effects sub routines, it's actually pretty easy to use.
 
 
Let's see some flashy stuff going on with those Future Pinball tables in your cabinets!

Edited by TerryRed, 07 November 2016 - 03:34 AM.






Also tagged with one or more of these keywords: DOFLinx, Flashers, RGB, Future Pinball