Jump to content

Easy Methods To Dof An Original Table


Recommended Posts

  • Content Provider

I have mapped a lot of tables for DOF, including originals, and these are the most tricky, so I have created a method that makes the change of the table script of the originals less painful,

The idea was not to copy everywhere this command (That allows to send an info from the table to B2S.Server and then to DOF)

Controller.B2SSetData 1**, nr
everywhere, to have a easier command to call.

Secondly, i didn't want to copy the same line twice for a pulse of a switch of solenoid

And lastly, I wanted to be able to disable the DOF E events with just one change of one variable, and to not put conditions to check on every DOF call if the variable is set to true to false.

Here is the method:

'*DOF method for non rom controller tables by Arngrim****************
'*******Use DOF 1**, 1 to activate a ledwiz output*******************
'*******Use DOF 1**, 0 to deactivate a ledwiz output*****************
'*******Use DOF 1**, 2 to pulse a ledwiz output**********************
Sub DOF(dofevent, dofstate) 
If dofstate = 2 Then
Controller.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0
Else
Controller.B2SSetData dofevent, dofstate
End If
End Sub
'********************************************************************


That can be placed just before Table_init(), here are two examples on how to use it


flipper example


If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
LeftFlipper.RotateToEnd
PlaySound "FlipperUp"
DOF 101, 1
End If


If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
LeftFlipper.RotateToStart
PlaySound "FlipperDown"
DOF 101, 0
End If

Bumper example


Sub Bumper1_Hit
If TableTilted=false then
PlaySound "bumper1"
DOF 107, 2
bump1 = 1
Bumper1.TimerEnabled = 1
If Bumper1.state=1 then
AddScore(100)
Else
AddScore(10)
End If
ToggleBumper
end if
End Sub

What happens here is, 107 means E107, and this info is intercepted by B2S.server, but to have the effect escalated into your ledwiz, you need to map the E event on the mapping of the table in the configtool.

So when you generate a directoutputconfig.ini, the line will contain these events and DOF will be able to trigger the event that B2S.Server intercepted.

Far_Out_1974,E114 Blink fu500 fd600,ON,0,0,E103,E104,E107/E125 300 I32,E109/E126 300 I32,E101/E105/E127,E102/E105/E106,E108,0,E115,E115 300/E131 400 10,0,0,E107 Yellow/E119 Red f200/E123 Orange f200/E125 Blue f50/E127 Yellow/E129 Yellow w400 f200,E103 Red/E116 Cyan f200/E120 Orange f200/E129 Orange w200 f200,E105 White fd800/E108 Red/E117 Yellow f200/E129 Cyan f200/E130 Red f200,E104 Red/E118 Cyan f200/E121 Orange f200/E129 Orange w200 f200,E109 Yellow/E122 Red f200/E124 Orange f200/E126 Blue f50/E129 Yellow w400 f200,0


Now if you want your table to be fully compatible without B2S, you can add a constant variable on top of the table script:

Const B2SOn = True 'True/False if want backglass

And The DOF method becomes this:

'*DOF method for non rom controller tables by Arngrim****************
'*******Use DOF 1**, 1 to activate a ledwiz output*******************
'*******Use DOF 1**, 0 to deactivate a ledwiz output*****************
'*******Use DOF 1**, 2 to pulse a ledwiz output**********************
Sub DOF(dofevent, dofstate) 
If B2SOn=True Then
If dofstate = 2 Then
Controller.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0
Else
Controller.B2SSetData dofevent, dofstate
End If
End If
End Sub
'********************************************************************


If you change the variable from true to false, all the DOF calls will be ignored  ;)

This constant variable can also be used to define the call of the B2S.Server or not, so here's a very practical way to use that constant


if B2SOn then
Set Controller = CreateObject("B2S.Server")
Controller.B2SName = "Far_Out_1974"
Controller.Run()
If Err Then MsgBox "Can't Load B2S.Server."
end if

Just as a reminder, the part i put in bold is the way to call B2S.Server for an original table, that can be placed on the table_init() method of the script.

And the B2SName must match the rom name of the table of the configtool, in order for DOF to take the respective line in your directoutputconfig.ini

If you have other questions

Link to comment
Share on other sites

Alright I thought I had this beaten i set up the flippers and bumpers last night and they are working fine. I am trying to get the ballrelease contactor to fire and it is a bit confusing. There is no playsound in the script for the trough instead it is like this

' Trough

Set bsTrough = New cvpmBallStack

With bsTrough

.InitSw 0, 67, 0, 0, 0, 0, 0, 0

.InitKick BallRelease, 80, 6

.InitEntrySnd "Solenoid", "Solenoid"

.InitExitSnd "ballrel", "Solenoid"

.Balls = 1

End With

I have tried putting the DOF line everywhere but it doesn't seem to want to fire the contactor.

Do i have to do something different for this to work with this type of script.

Cheers

Link to comment
Share on other sites

  • Content Provider

Look for bsTrough.ExitSol_On and add the DOF call in that subroutine

 

If you don't find bsTrough.ExitSol_On, look for something like SolCallback(sBallRelease) = “bsTrough.SolOut”

and replace it with

 

SolCallback(sBallRelease) = “SolBallRelease

 

Sub SolBallRelease(enabled)
   If enabled Then
      bsTrough.ExitSol_On
      DOF xxx,1
   End if
End Sub
Link to comment
Share on other sites

  • 7 months later...
Hi why DOF didnt use a Toylist for Orginal Tables like the in the Online Config tool when anybody write a Table he insert only the Toy

Value into the table and the DOF uses the Port where the Toy is mapped for people with more than one controller we can make the same schemata like the DOFconfigs

 

toyConfig.ini

toyConfig2.ini

Toyconfig40.ini

 

so we have Hardcoded events but its easy!

Link to comment
Share on other sites

  • Content Provider

There are several resoans why DOF is working differently.

 

The most important reason is that DOF is just a extension/plugin to the B2S.Server. The only thing which the B2S.Server can consume are table evenets (either coming from Pinmame or from E commands in the table script). So there isn't much of a option to do things differently.

 

Another reason is flexifility. If specific toy would be targeted in the table script, it would be very hard to start using a toy which wasn't around when the table was scripted and everybody who has a different hardware setup would run into problems (e.g. I have 10 contatcors, 5 flashers, approx 300 other rgb leds, plus some DMX effects, but most table creators have a somewhat more moderate setup). By simply processing events, DOF can easily be adjusted to different hardware setups.

 

Another point is separation of responsibilities. With the event based system which DOF is using, the table author only has to tell DOF that a element on a table has changed its state, but he doens't need to care what should happen in terms of feedback. So that makes life a bit easier for the table authors since they dont need to care about DOF.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...