Jump to content



Photo
- - - - -

How to use controller.vbs for EM and Original tables in depth


  • Please log in to reply
7 replies to this topic

#1 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 11 April 2016 - 06:28 PM

Hi Guys,
 
After the extensive guide for SS tables:
 
http://www.vpforums....topic=33453&hl=
 
Here is the guide for the non rom tables
 
I will describe it in 2 steps, the basis and the extended features related to Force Feedback and DOF
 
So, as for Rom based tables, you need to call the controller.vbs on top of the script, basically after 
 
option explicit
Randomize
 
like this:
 
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
 
You also need a Const cGameName that will define the B2S name, that will be used to memorize the B2S parameters in the B2STableSettings.xml
 
Const cGameName = "GTB2001_1971"

 

It is required by the controller.vbs, and for the DOF of the table is the table gets a DOF Config, most likely available in the configtool:

 

9180.png

 

Next where we need to call the command that will invoke the controller, for non rom tables, the logic will determine B2S controller is installed in the machine of the user, or no controller.

 

It is done here:

 

Sub Table1_init

    LoadEM

    .

    .

    .

End Sub

 

And one thing important is to properly close B2S when the table is stopped:

 

Sub Table1_Exit

    If B2SOn Then Controller.Stop

End Sub

 

That's all for the basis :)

 

Now let's talk about the 3 commands to script the DOF effects in the vp table

 

PlaySound SoundFX("soundname",[DOFContactors,DOFKnocker,DOFChimes,DOFBell,DOFGear,DOFShaker,DOFFlippers,DOFTargets,DOFDropTargets])

DOF DOFIDEffect, [DOFOn,DOFOff,DOFPulse]
SoundFXDOF("soundname",DOFIDEffect,[DOFOn,DOFOff,DOFPulse],[DOFContactors,DOFKnocker,DOFChimes,DOFBell,DOFGear,DOFShaker,DOFFlippers,DOFTargets,DOFDropTargets])

 

basically SoundFXDOF is just a combination of SoundFX and DOF methods

 

So

 

So for example 
 
DOF 101, DOFPulse
PlaySound SoundFX("solenoid",DOFContactors)
 
and 
 
PlaySound SoundFXDOF("solenoid",101,DOFPulse,DOFContactors)

 

are doing exactly the same, just SoundFXDOF can do 2 operations in one line

 

here are examples on how to map the flippers and the slingshots

 

Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftFlipperKey AND CANBEGIN=1 AND GKMM=0 AND VMOn=0 AND Tilted=0 Then    
LeftFlipper.RotateToEnd
leftFlipper1.RotateToEnd
PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.05
End If
 
If keycode = RightFlipperKey AND CANBEGIN=1 AND GKMM=0 AND VMOn=0 AND Tilted=0 Then
RightFlipper.RotateToEnd
RightFlipper1.RotateToEnd
PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.05
End If
 
Sub Table1_KeyUp(ByVal keycode)
If keycode = LeftFlipperKey AND GKMM=0 AND CANBEGIN=1 AND VMOn=0 AND Tilted=0 Then
LeftFlipper.RotateToStart
        LeftFlipper1.RotateToStart
PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.05
End If
    
If keycode = RightFlipperKey AND GKMM=0 AND CANBEGIN=1 AND VMOn=0 AND Tilted=0 Then
RightFlipper.RotateToStart
        RightFlipper1.RotateToStart
PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.05
End If
 
Dim RStep, Lstep
Sub LeftSlingShot_Slingshot
If Tilted=0 Then
FlashForMs fl2,100,50,0:FlashForMs fl2a,100,50,0:FlashB2S B2SLight2,200,50,0
DOF 140, DOFPulse
  PlaySound SoundFXDOF("fx_slingshotL",103,DOFPulse,DOFContactors),0,1,-0.05,0.05
    SCORES=SCORES+2580
    LSling.Visible = 0
    LSling1.Visible = 1
    sling1.TransZ = -20
    LStep = 0
    Me.TimerEnabled = 1
OnScoreboardChanged
End If
End Sub
 
Sub RightSlingShot_Slingshot
If Tilted=0 Then
FlashForMs fl1,100,50,0:FlashForMs fl1a,100,50,0:FlashB2S B2SLight1,200,50,0
DOF 142, DOFPulse
  PlaySound SoundFXDOF("fx_slingshotR",105,DOFPulse,DOFContactors), 0, 1, 0.05, 0.05
    SCORES=SCORES+2580
    RSling.Visible = 0
    RSling1.Visible = 1
    sling2.TransZ = -20
    RStep = 0
    Me.TimerEnabled = 1
OnScoreboardChanged
End If
End Sub
 
the id 101, 102, 103 and 105 are the ones which will communicate with DOF if the cGameName matches one entry in the configtool as explained above, and if the ids are mapped in the config of that table, like this in this case
 
why do we start at 101? because we usually expect the first numbers are used for lamp interactions in the backglass, as the DOF method uses the same method that the backglass events, (Controller.B2SSetData)
 
for the flippers we need to activate the effect when we press the flipper button (DOFOn) and deactivate when we release the button (DOFOff)
 
for the slinghots, we just need to pulse the slingshot contactor so we just use a DOFPulse which will do an immediate ON OFF effect 
 
467756dof.png
 
Flippers :  
 
Sub SolLFlipper(Enabled)
    If Enabled Then
        PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers)
        LeftFlipper.RotateToEnd
    Else
        PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers)
        LeftFlipper.RotateToStart
    End If
End Sub
 
Sub SolRFlipper(Enabled)
    If Enabled Then
        PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers)
    Else
        PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers)
        RightFlipper.RotateToStart
    End If
End Sub

 

Configtool

E101 goes to Flipper Left 

E102 goes to Flipper Right


Edited by arngrim, 23 April 2017 - 05:11 PM.


#2 bord

bord

    Pinball Fan

  • Members
  • PipPipPipPip
  • 603 posts

  • Flag: ---------

  • Favorite Pinball: Star Gazer, Whirlwind, Frontier

Posted 25 April 2016 - 02:21 PM

Glad this is a part of the DOF discussion. Chimes and a bell are my must-have items for a virtual cabinet. :tup:



#3 jipeji16

jipeji16

    Enthusiast

  • Members
  • PipPipPip
  • 103 posts

  • Flag: France

  • Favorite Pinball: Creature from the black lagoon

Posted 13 November 2017 - 06:03 PM

Thank you Arngrim for all those informations !!!!! ;) ;) ;) ;) :otvclap:



#4 Outhere

Outhere

    Pinball Wizard

  • Platinum Supporter
  • 4,720 posts

  • Flag: United States of America

  • Favorite Pinball: M M

Posted 25 June 2020 - 06:24 AM

Are these guides -- EM, Original and SS up to Date?



#5 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 31 July 2020 - 06:21 PM

Yes :)

Envoyé de mon SM-G970F en utilisant Tapatalk

#6 crashb4

crashb4

    Neophyte

  • Members
  • Pip
  • 8 posts

  • Flag: United States of America

  • Favorite Pinball: twilight zone

Posted 28 September 2020 - 11:23 AM

arngrim,

How does one go about having a title added to the DOF config tool? I would like to have a go at adding DOF to "Pop A Card" but it is not listed. This is new to me, so I'm trying to learn as I go.



#7 drinkcristal

drinkcristal

    Hobbyist

  • Members
  • PipPip
  • 26 posts

  • Flag: Australia

  • Favorite Pinball: Indiana Jones

Posted 19 December 2021 - 05:33 AM

It starts with having the table listed in DOF Configtool. The table needs to be listed there first and the correct codes aligned to the code in the table. Best make a request to add the table via that web site (look at the signature from arngrim).

 

You are in luck that the tables author has coded it for DOF in VPX it is just that it is not listed in the configtool.

 

All the best with that



#8 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,790 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 19 December 2021 - 07:46 AM

arngrim,

How does one go about having a title added to the DOF config tool? I would like to have a go at adding DOF to "Pop A Card" but it is not listed. This is new to me, so I'm trying to learn as I go.

 

 

You can create a config for personal use for anything you would like in DOFConfigTool
You would have to ask Arngrim about how to have an official submission


If you feel the need to empty your wallet in my direction, i dont have any way to receive it anyways

If you really want to get rid of money you can donate to this

Athena's Wildlife Sanctuary