Tutorial How to add DOF (Direct Output Framework) support to any Future Pinball table.

TerryRed

Pinball Master
Joined
Feb 11, 2020
Messages
1,990
Solutions
9
Reaction score
2,427
Points
145
Favorite Pinball Machine
My Virtual Pinball Cabinet
********** How to Add DOF support to a Future Pinball table **********

by TerryRed



6W0SQPK.png



What will this do?

- this will add support for DOF (Direct Output Framework) for cabinet feedback and lighting

What this will not do

- this will NOT add SSF (surround sound feedback)
- this will NOT have all the same DOF features as TerryRed's PinEvent tables / mods

What does this need?

- latest DOF R3++ installed


- latest version of BAM


What this does NOT use

- this does NOT use or require the PinEvent vbs files
- this does not use or require DOFLinx
- you should NOT have DOFLinx running when playing a table that uses this code (so both aren't accessing DOF at the same time)





PinEvent

Please, DO NOT use the name PinEvent when using this code, or when adding DOF to a FP table

PinEvent = TerryRed's FP tables / mods and pup-pack releases only


DO NOT use or modify my PinEvent DOF configs for my tables on DOF Config Tool!

  • I have VERY specific DOF configs that are designed to work only with my PinEvent table updates (they start with FP_PE)
  • everyone is free to use the standard FP DOF configs to mod other FP tables for DOF





****** How to do it ******

Copy the code below to the script of any Future Pinball table under Option Explicit



Code:
'/////////////////////// iCOM BAM PLUG-IN - USE COM OBJECTS ////////////////////////////

' The iCOM plug-in for BAM must be installed and enabled in the BAM Plug-ins menu!

' This will allow programs such as DOF, Pinup Player, and more to work directly with Future Pinball.

Dim icom : Set icom = xBAM.Get("icom") ' "icom" is name of "icom.dll" in BAM\Plugins dir

Function CreateObject(className)
   Set CreateObject = icom.CreateObject(className)
End Function

'///////////////////////////////////////////////////////////////////////////////////////


'//////////////////////// DOF: STARTUP & CONTROL SECTION   /////////////////////////////

' This is used for the startup and control of DOF (Direct Output Framework)

Dim useDOF: useDOF = false
Dim DOFStatus:DofStatus=false
Dim DOFObject
Dim cGamename

Sub DOFStart(DOFProfile)  'Start DOF Session
    if DofStatus=true then Exit Sub
    if useDOF=true Then
        Set DOFObject = CreateObject("DirectOutput.ComObject")
            If DOFObject is Nothing Then
                AddDebugText "DOF is not installed or detected"
                useDOF=false
                DofStatus=false
            else
                DOFObject.Init "B2SServer","",DOFProfile
                DOFStatus=true
                AddDebugText "Start DOF"
            end if
    End if
end sub

Sub DOFClose()  'PinEvent - Close out DOF session. Add this to FuturePinball_EndPlay()
    if DOFStatus=false then Exit Sub
    DOFStatus=false
    DOFObject.Finish()
    Set DOFObject=nothing
end sub

Sub dof(dID,dValue)
    if DOFStatus=false then Exit Sub
    if dValue=0 Then DOFObject.UpdateNamedTableElement "E"&dID,0
    if dValue=1 Then DOFObject.UpdateNamedTableElement "E"&dID,1
    if dValue=2 Then
        DOFObject.UpdateNamedTableElement "E"&dID,1
        DOFObject.UpdateNamedTableElement "E"&dID,0
    End If
end Sub

' Usage: dof(dID,dValue)

' dID = DOF Exxx trigger
' dValue = trigger action. 0 = off, 1 = on, 2 = pulse

' Example:

' dof 103,1

' The above example will trigger DOF event E103 as ON


'///////////////////////////////////////////////////////////////////////////////////////


'////////////// START DOF ////////////////

useDOF = true                   ' enable DOF
cGamename = "FP_TABLE_NAME"     ' name of this table's DOF Config as listed on the "DOF Config Tool" web site
DOFStart(cGamename)             ' check for DOF - If found, then start DOF Session

'/////////////////////////////////////////





Make sure you replace FP_TABLE_NAME in the above code with the "rom" name used for the table on DOF Config Tool


Make sure you add the command DOFClose to the FuturePinball_EndPlay() sub, to close out the DOF session when you exit the table.



Code:
Sub FuturePinball_EndPlay()
    DOFClose()
End Sub





****** DOF COMMAND ******

Use the DOF command throughout your table script to trigger the DOF event for whatever feedback / lighting you want

dof(dID,dValue)

dID = DOF Exxx trigger
dValue = trigger action. 0 = off, 1 = on, 2 = pulse

Example:

dof 103,1

The above example will trigger DOF event E103 as ON

dof 103,0

The above example will trigger DOF event E103 as OFF

dof 103,2

The above example will trigger DOF event E103 for a short pulsed duration






****** DOF Config Tool Commands ******

You will only use Exxx commands with DOF Config Tool since all FP tables don't use roms.

For more info about creating DOF Config Tool configs and using my DOF Config Creator sheet, see this post:







Those are the essentials you need to get started.

To be CLEAR... I am NOT giving support for this! All the info you need is provided. Do the work!


Again, please do NOT use the name PinEvent when referring to adding DOF to a FP table. The name PinEvent is used only for TerryRed releases.

Thank you.
 
Last edited:
Clear as usual.
 
Forum activity
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: Beers is our newest member. Welcome!
      Back
      Top