Content Provider arngrim Posted February 4, 2014 Content Provider Share Posted February 4, 2014 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**, nreverywhere, 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 solenoidAnd 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 ThenController.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0ElseController.B2SSetData dofevent, dofstateEnd IfEnd Sub'********************************************************************That can be placed just before Table_init(), here are two examples on how to use itflipper exampleIf keycode = LeftFlipperKey and InProgress=true and TableTilted=false ThenLeftFlipper.RotateToEndPlaySound "FlipperUp"DOF 101, 1End IfIf keycode = LeftFlipperKey and InProgress=true and TableTilted=false ThenLeftFlipper.RotateToStartPlaySound "FlipperDown"DOF 101, 0End IfBumper exampleSub Bumper1_HitIf TableTilted=false thenPlaySound "bumper1"DOF 107, 2bump1 = 1Bumper1.TimerEnabled = 1If Bumper1.state=1 thenAddScore(100)ElseAddScore(10)End IfToggleBumperend ifEnd SubWhat 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,0Now 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 backglassAnd 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 ThenIf dofstate = 2 ThenController.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0ElseController.B2SSetData dofevent, dofstateEnd IfEnd IfEnd 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 constantif B2SOn thenSet Controller = CreateObject("B2S.Server")Controller.B2SName = "Far_Out_1974"Controller.Run()If Err Then MsgBox "Can't Load B2S.Server."end ifJust 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.iniIf you have other questions Link to comment Share on other sites More sharing options...
Content Provider swisslizard Posted February 4, 2014 Content Provider Share Posted February 4, 2014 This is excellent! Link to comment Share on other sites More sharing options...
Content Provider arngrim Posted February 4, 2014 Author Content Provider Share Posted February 4, 2014 Yeah, i have mapped king pin, with 32 E events in 40 minutes like this, with testing the table included Link to comment Share on other sites More sharing options...
Content Provider swisslizard Posted February 5, 2014 Content Provider Share Posted February 5, 2014 I have added your method to the DOF docu. The published docu will be updated once we have a next DOF release. Link to comment Share on other sites More sharing options...
Content Provider arngrim Posted February 5, 2014 Author Content Provider Share Posted February 5, 2014 thanks this can be of course used for a SS table as well, but it helps a lot more for original tables Link to comment Share on other sites More sharing options...
lizard Posted February 6, 2014 Share Posted February 6, 2014 Thanks Arngrim I just tried this on Westworlds Fast Draw mod which I was having trouble with the 2 controllers it runs. Works great it solved my issue thanks again. Link to comment Share on other sites More sharing options...
lizard Posted February 7, 2014 Share Posted February 7, 2014 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 More sharing options...
Content Provider gtxjoe Posted February 7, 2014 Content Provider Share Posted February 7, 2014 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 More sharing options...
lizard Posted February 7, 2014 Share Posted February 7, 2014 Thanks for the info gtxjoe worked like a treat. Link to comment Share on other sites More sharing options...
cyclemat Posted September 9, 2014 Share Posted September 9, 2014 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 More sharing options...
Content Provider swisslizard Posted September 9, 2014 Content Provider Share Posted September 9, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now