Editor Objects

Timer


Timer

Timers can be used to add a pause after a Hit event.

Timer Button

First Lets Create a Timer:If you don’t have a table already opened File / New to open a new Table.

Click on the Timer button Move Cursor towards the table you are building.Iit should turn into a Timer cursor, click this where you would like your Timer placed. and you get a Timer.

Note: Placing Timers on the side will help you to find them in an easier way. They can also be placed on Backdrop to be use for attractmode or other advanced display technics.


Now that we have a Timer Created we can look at the Timer Option Properties.

Click on options in the ToolBar and select the Timer by clicking on it

Doing this will show us the Timer properties.

Timer- Name for type of object you have selected.

Name – Timer1 The name of the Timer, you can change this to whatever you want. The name is used to address the object through the script.

Timer Enabled -needs additional script. Default is checked

Timer Interval – Default is 100, dela befor procedure is starting.

UserValue – This Variable is userdefined and can be use for wathever you want. I use it often as event flag in the script.

Note: Timers can be place anywhere, on Table or Backdrop.


Timer Script

Using demo6timer.zip

Timers are pretty simple to get working. In the above example you can open it up & check the Timers out, in action. The script for the Timers is at the bottom of the script in this demo.

Note: In the Timer Options, Enabled is unchecked, it is Enabled by dropping both targets.

In Sub CheckTarget Timer1 is enabled

Sub CheckTarget()
If Target.Isdropped = True And Target1.IsDropped = True Then ‘checks to see if both targets are dropped
Timer1.Enabled = True ‘ if they are both dropped timer will start
End IF
End Sub
‘**************************Target Stuff Ends Here
In Sub Timer1_Timer the Timer & Targets are reset, Timer is no longer enabled until both targets are knocked down again.
Sub Timer1_Timer() ‘in timer options look at the interval, its 2500 2 1/2 seconds
Timer1.Enabled = False ‘after 2 1/2 seconds Timer1 stops and finishes the Sub
PlaySound “targetup”
Target.IsDropped = False ‘pops the target back up
Target1.Isdropped = False ‘pops the target back up
End Sub

 

Source: www.armuco.ch

Category: Tags:
 
1 Comment

Comments are closed.

  1. Scottacus 7 days ago

    Timers were hard for me to use at first until I realized that timers are essentially “timed loops” that continue to loop at a specific time interval until turned off. This makes them very useful when you need the table to do something repeatedly at very specific time intervals. For example if you want to ring a bell X number of times every 150ms, set the timer interval to 150, set the X variable to however many times you want the bell to ring and call the timer in your code (Bell.enabled = 1) and with something like this:

    Sub Bell_timer
    If X = 0 then Bell.enabled = 0
    PlaySound “Bell”
    X = X – 1
    End Sub

    What this code does is:
    Check if X = 0 and if so turns the timer off
    Plays the Bell sound
    Decrease X by 1
    ***Wait 150 ms***
    Loop back to see if X = 0

    The key here is that you can control the speed that the timer loops on itself. That speed can also be changed in the script (“Bell.interval = 300” sets the timer for 300ms) so you can change the timing of your loops to suit your needs.

©2018 VPinBall.com

WP Facebook Auto Publish Powered By : XYZScripts.com

Log in with your credentials

or    

Forgot your details?

Create Account