Jump to content

Attn: E Config Table Modders


Dazz

Recommended Posts

  • Administrators

Hey Guys,
 
With the release of the VPU Patching System; I would love to see you guys create patches for the tables that you are adding DOF compliance to. I have created a new download section specifically for DOF patches.  

 

 

** Hold off on below for now ** Need to get some clarification on code from Koadic.
 
When adding DOF compliance to a B2S table, I would also suggest that the code for launching the B2S be changed to Automatic B2S Name detection. This way the users do not have to change the name of the B2S .exe file. The script automatically picks up the B2S name based on the table file name no matter how the user names their patched table.

Code for Automatic B2S Name Detection by Koadic

'Automatic B2S Name detection
'by Koadic

 ExecuteGlobal GetTextFile("b2s.vbs")
 
 ResetB2SData 0,49,0    'Initialise the b2s data area
 Dim Filename 'dynamic b2s launching based on file name
 If CheckB2S(filename) Then
'********************************************************************************************
'You can replace the constant 'True/False' below with menu selectable option if using something like my menu system
  LaunchBackGlass filename, False    'True=Launch bg ,  False=Don't launch bg.
'********************************************************************************************
 End If

 Function CheckB2S(name)
	CheckB2S=false
	Dim WshShell,filecheck,directory
	Set WshShell = CreateObject("WScript.Shell")
	name = WshShell.RegRead ("HKCU\Software\Visual Pinball\RecentDir\TableFileName0")
	directory = Left(name,InStrRev(name,"\"))
	name = Replace(Mid(name,InStrRev(name,"\")+1),".vpt","")
	Set filecheck = CreateObject("Scripting.FileSystemObject")
	If filecheck.FileExists(directory & name & ".exe") Then CheckB2S = True
End Function

For the people that's creating the DOF configurations for these; please shoot me a private message.

Link to comment
Share on other sites

The 'CheckB2S(filename)' call checks if there is an exe with the same name as the table in the same directory and returns either a true or false value while setting 'filename' to the name of the table (minus the .vpt extension)

You just need to copy/paste the function above into the table script somewhere, then add an If/Then check calling the function.

 

Dim filename 'you can use anything you want here, it doesn't have to be 'filename', just make sure it is the same when you run the following...
If CheckB2S(filename) Then LaunchBackGlass filename, False 'True=Launch bg , False=Don't launch bg.
Link to comment
Share on other sites

  • Content Provider

Thank you for the tip, but for the purpose of the patch i don't know how i can use it.

 

The problem with the patch, the modded table has a different name than the original table, so it's not aligned anymore with the exe.

 

I guess the goal is not change the exe name, and only mod the vpt right?

 

I can follow a naming convention with _DOF_B2S instead of _B2S, so we can change the name of the table to be compared of in your script.

 

But there is another problem, with hyperpin, we use launchbackglass = false and hp is searching for an exe with the same name than the vpt, so don't know how you can deal with that.

 

So if we force people to rename their exe, it can be used, it will not be very useful for hp users but for pinballx yes

 

Another problem, that i highlighted to Herweh, to allow DOF for B2S tables, we need to do a call of the B2S.server, which is trying to launch a db2s with a name close to the vpt, if it can't find one directly.

 

That caused Haunted House db2s to be displayed on top of Haunted Mansion, or Supersonic db2s on top of SuperStar B2s, or even Terminator2 on top of Terminator3.

 

I had to rename the vpt and the exe of haunted mansion to hmansion to avoid the problem.

 

I don't think anybody else than Herweh can fix this

Link to comment
Share on other sites

  • Dazz unpinned this topic

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...