Jump to content
SpesoftPinballXConvert-It
joyrider3774

FX3 clean hotseat / classic lists without extra emulator / duplicating media / duplicating tables in all tables section

Recommended Posts

Hey,

 

Ignore everything below and check the program i made here https://github.com/joyrider3774/PinballX_Launcher_app/ it doesn't require multiple lists... so text below is outdated ...

Here's a little video of it in action on my cabinet

--------------------------------------------------------------------------

Ignore below

--------------------------------------------------------------------------

I've been working tonight on something so i can choose 2 players, 3 players or 4 players hotseat mode with either classic mode turned on or off. Without having to create an extra emulator for each flag, without duplicating media (as i think that's needed if you create new emulator / system), without the hotseat or classic versions being duplicated in your all tables sections (which also happens i think if you create seperate emulator for it).

The solution is rather simple and i exploit a "feature" from pinballx where when it searches for media it ignores anything between brackets in the game name (not description although i think it does the same there). I can even display in the description "2 players" "3 players" etc without having to add or duplicate media. The only requirement is that all your media is using the gamename as filename for everything and not the description as that will break things if you change your description (for example to add "2 players" "3 players" etc text) it won't probably break things if you do not change the description of the game and then the requirement is not needed and you should be able to still use your same media filenames.

Basically what i did was the following...

I created a launcher ahk script that checks if (C), (c), (2), (3), (4) are passed to it at the end of the game name. where the script will analyze those extra characters between brackets and enable classic mode if (C), (c) exists and enable 2 player hotseat mode if (2) is passed or 3 player hotseat mode if (3) is passed or 4 player hotseat mode if (4) is passed. Let me give some examples

"pinball_fx3_extralaunch.exe Citadel"  -> launches sorcerers lair in fx3 in normal single player mode
"pinball_fx3_extralaunch.exe Citadel(C)"  -> launches sorcerers lair in fx3 in classic single player mode 
"pinball_fx3_extralaunch.exe Citadel(C)(2)" or even "pinball_fx3_extralaunch.exe Citadel(2)(C)" -> launches sorcerers lair in fx3 is classic 2 player hotseat mode
"pinball_fx3_extralaunch.exe Citadel(2)" -> launches sorcerers lair in fx3 in normal 2 player hotseat mode

this is the launch script along with sources: pinball_fx3_extralaunch.zip

I'm not good at ahk it was the first time actually making a script and it still some problems with pinball fx3 loosing focus for some reason sometimes so this still needs fixing but maybe someone can help me with this or improve the script

the Next step is to change your pinball fx 3 emulator setup to launch this script instead of steam and pass only the tablename with extra options between brackets at the end to do this my setup looks like this (do take into account your paths, my pinballx install location is different as you can see) but basically the most important part is the parameter "[TABLEFILE]" and change the executable to use the script

image.thumb.png.560fc17d360ba6d3674966eb50b500c3.png

Next step is to copy your current game database for pinball fx 3 and for example rename it to "Pinball FX 3 - 2 Players" open the xml and at the end of every game name  (not description) just add (2) or if you rather player classic add (2)(C) at the end. You could if you want also make seperate list for both classic and normal modes. that's up to you. But as an example i give my database xml files below so you can see the diffrence between them. The plain Pinball FX3.xml is the normal one usually used, the others are modified ones. Do note i added " - 2 players" " - 3 players" etc text to the descriptions, you can remove those again with a simple replace all text command in some editor like notepad++ or the app you usually use. But using these files implies you named your media based on game name and not on description if it's on description remove those texts

they are located in databases\Pinball FX3 in my case

Pinball FX3 2 Players.xml

Pinball FX3.xml

Pinball FX3 4 Players.xml

Pinball FX3 3 Players.xml

what i did next was create group xml files for every single file above so i can choose from the list "Zen Pinball FX3", "Zen Pinball FX3 - 2 players", "Zen Pinball FX3 - 3 Players" etc 

these are my group files:

Zen Pinball FX3 - 4 Players.xml

Zen Pinball FX3 - 3 Players.xml

Zen Pinball FX3 - 2 Players.xml

Zen Pinball FX3.xml

as you can see they just contain a single file link to another game list. You could if you want create just one group file named zen pinball multiplayer and edit the xml to add all database links inside it to see one list for only zen multiplayer games but with 2 players - 3 players etc (you will need to be able to modify descriptions if you want this and thus implicating your media is named after game name).

I'm still testing it but it seems to work fine for me. 

Do note this only works because pinballx when writing a game name like "Citadel(2)(c)" still uses and looks for media named "Citadel" you do not need to duplicate everything and name it Citadel(2)(c).mp4 for example, also this will only work as long as pinball x does this, unless you base everything of the game descriptions and do not modify them to add the "2 - players" etc texts.

I'll be making a youtube video (without me speaking, i don't have microphone and do not like to talk in video's anyway) but just to show how it looks like now on my pc.

Also i'm not aware of pinball FX2 parameters, but the same trick can probably applied there if they use the same parameters as fx3 for hotseat mode, you just need to edit the ahk script then to launch the fx 2 version or change parameters if needed.


Feel free to test and let me know what you think.

edit: removed the hide paramater in the run "command" still need to fix the losing of focus but you get the idea of what i'm trying to accomplish

edit2: here are more lists and groups where everything is grouped together in a multiplayer group list class and normal as well single player classic database file and multiplayer classic database examples basically look at game name

Zen Pinball FX3 - Multiplayer Classic.xml (group)

Zen Pinball FX3 - Multiplayer Normal.xml (group)

Pinball FX3 2 Players - Classic.xml (db file)

Pinball FX3 3 Players - Classic.xml (db file)

Pinball FX3 4 Players - Classic.xml (db file)

Pinball FX3 - Classic.xml (db file)

edit3: here's the video (quality should imp rove it's still processing)

 

Share this post


Link to post
Share on other sites

the script needs improvement, i still sometimes lose focus but not sure how to fix it will check more tommorow. I noticed it while creating the video so using -hide parameter did not help. I'll remove the hide parameter again in a new version. I'm not sure what's causing the losing of the focus will have to test more tommorow or if someone has an idea ? Am uploading the video as we speak to show it all a bit more how it looks

Share this post


Link to post
Share on other sites

Haven't looked too closely at the script, but this seems like way too much housekeeping and setup. Add one table, have to update eight database files. And I guess you have eight different wheels and videos, etc? 

I'd just set up a GUI in the  AutoHotkey script that is displayed as a dialog upon script launch. Choose the number of players (make the dialog box navigable with cab buttons). Select classic mode or not. Code selections within a Run instruction. Can be done conditionally but would be even more streamlined to store the selections in variables. This way you only need one xml  database (no need for sub-groups) and one set of media.

Look up GUI examples and Variables in the AutoHotkey wiki or alternately you can pick just about all the needed code from the PBXRecorder source which heavily makes use of interactive dialogs. 

I'm just happy that hotseat is supported in the command line now. That's great! I have an AutoHotkey launcher script that I would update for this except that my cab has been out of order for months. I don't even have FX3 installed yet.

Delays and timing issues are managed by Sleep instructions. Different machines sometimes require different delays. Add a Sleep instruction or if one exists then perhaps add more time.

Share this post


Link to post
Share on other sites

@Carny_Priest i only have one set of wheels, one set of playfield videos. As said before i did not have to duplicate any media because i'm exploiting the feature where pinballx removes brackets and any text between them from the gamename before searching for the media. So it actually always searches for Citadel.* Named media even if i added as gamename Citadel(2)(c) in the xml. So that's the reason no media needs to be duplicated but i did rename my media so it uses that citadel gamename and not based on description. Without pinballx removing those texts before searching for media i would have had to duplicate media but now not.

You are however right about gamelist management when new dlc / tables get added. But its not like they release 20 extra tables at once, and you basically have to add them once and then copy to all other xmls, with minor modifications that are done quickly. It does not really give me a problem as i'm usually not using gamemanager but work with the xmls directly.

Having a ui would indeed also be an option, i did not think of that before. Given it does not display the windows desktop as i want to see that the least whenever possible.

It sucks to have your cabinet out of working order, but for modifying scripts you can always set up a local pinballx environment on your main pc to test it out, thats what i'm doing as my cabinet has not arrived yet but should be soon. So i'm doing as much as i can on my main pc and simulate everything

Share this post


Link to post
Share on other sites

@Carny_Priest can you remember if in your scripts did you do anything special to prevent focus loss ? I just been testing the script from commandline and no focus is being lost but when i run from pinballx it happens sometimes on my windows 10 pc. All the script basically does is start steam with -applaunch gameid and parameters nothing else it does not need to send keys.

I even tried waiting for the process then  the window using classname, activating it etc but it does not help. The problems only happen from running within pinballx when using it from commandline no focus loss happens. 

I tried playing with the waitfor command, removing Pinball FX3.exe as process to monitor, letting the script run as long as pinball fx3.exe runs  but does not seem to have an effect. 

i'm guessing the same problem might happen if i would try to add a gui of some sort but have not tried yet. Really no clue as to why it's happening.

not sure how the other scripts handle this or if it's something on my pc.

I'm giving up as i have ran out of idea's how to prevent it and goana play some of the new williams tables in pfx3

 

edit:

hmm even without using the script, and just plain pinball fx3 direct launch from within pinballx as before i'm having the same problem so it's probably not the script but something i either messed up inside the settings or on my pc

Share this post


Link to post
Share on other sites

it's not pinballx fault nor my launching script. I just launched pinball fx3 directly from steam and pinball fx3 lost focus as well like in the video. I'm still investigating but now it's clear it's something on my main pc that's causing this. Once i find the culprit i'll update my message and will try to modify the launcher to let it select you the multiplayer stuff without having to create many playlists. I'm not sure i'll do it in ahk script, could be i'll be doing it in delphi as that's what i usually use at work. But will release sources on github if i decide to go that route

Share this post


Link to post
Share on other sites

Have been fiddling around abit in delphi. This time no need to have additional game lists to make it work, went the gui route as @Carny_Priest suggested. Although stepped away from AHK. 

 

  • Like 1

Share this post


Link to post
Share on other sites

Awesome work!

Share this post


Link to post
Share on other sites

Incredible work!!! You are the boss!!! I´ve been searching a solution for multiplayer in pinball FX3 months ago.....and you did it!!!! When you test it better....or not...if you want testers....I´m here jajaja!!!

Can you share the script or the tutorial to get it?

Thanks in advance

Share this post


Link to post
Share on other sites

Thanks guys,

There is no script, it's not created in a ahk script it will be a seperate exe, i'm developping it in delphi XE, in the free community edition (if they still supply that, i had it installed ages ago). I'll release source for sure. But what i did already now is make everything configurable from an ini file. Basically you get 8 buttons you can customize and attach certain parameters to it that will get added along to other variables to specify the game to be launched (for example from steam but it's not necassry can be standalone as well). You'll be able to change any text of the buttons, choosing if they are enabled or not and even changing the title. If the ini file does not exist it will just fill it in with the defaults for pinball fx3 as above shown. But once the ini is made you can change a setting to never overwrite the ini again and use this launcher in combination wirth modified ini (if you make a duplicate of the ini and exe in a seperate folder first) to use it as a launcher for other games that also have the same problem. I don't know the parameters pinball fx2 can take but if they also have a hotseat parameter you can easily change the ini file to make it work with pinball fx2 as well (given it has certain parameters that you need to be able to choose).

It's also designed for full hd 1920x1080 or 1080x1920 resolution but i need to test it on multi monitor environment like in my cab which arrived today at work (did not have time to test much and can't now as i'm home but ran into troubles with the cab not sending video signals anymore) but i did add a scaling option by provide multiplay by and divide by parameters. Let me explain if it's to big you can set m = 1 and d=2 it will then scale by multiplying everything by one and then by 2 so basically it's 1/2 of the initial size. The same can also be done in reverse order in cause you run 4k you switch em around m=2 and d=1 so it will be double the size. You can put any value you like for it like 3/4 or 4/3 or whatever so you can expiriment with it in case you got higher or lower res


The source code of the program will be placed on github so anyone can see how it's done althought it's something completely diffrent than AHK, delphi is basically object pascal and its what i use as a programmer everyday at work.

I'm sure i'll be needing testers currently i have 3 problems with it:

 

  1.  you'll be able to choose left / right / launch key but space will also always be a launch key so if anyone has their arcade set up to use space left or right flipper (go left / right) it will give problems and i'm not sure how to fix this
  2.  if the launcher is on screen, and you don't choose a selection in say like 10 seconds, something weird seems to happen .. my desktop gets shown and my mouse keeps scrolling to the upperright corner. I'm not sure what's causing this it could be pinball x is doing something when it thinks the process should exist but i can't see what it does there. I can say i'm not doing anything related to mouse or focus or activating screens. What i'm thinking on addin is a selection timer like you got 5-10 seconds to make a selection and if not done in time it will just start with whatever is selected at that time. But i need more time to investige. 
  3. there is another problem and i won't be able to fix this or have no clue as of yet how to do this. If you look at your playfield as in portrait mode but in windows your screen is set to landscape (so pinballx is rotating your screen) this app will also be shown in landscape because windows is running in landscape mode. and this might be a big problem as i think most cabinets run in landscape mode in windows so you'll see the app rotated. I'm not sure delphi has options to go around this problem i might have to find a way to fix it myselve. I basically need to find a way to rotate the text in the button by option in ini if nescarry as i think that's the only solution but will know more once i can test it my own cab (it's setup in landscape as well in windows). 

 

if i can't fix it all i'll release as is on github and maybe others can pick it up or try to improve currently it's a pretty basic program


For the rest it's all working fine when it comes to launching the game and supplying the commandos for hotseat and classic mode if you just do it in time. 

Share this post


Link to post
Share on other sites

Hey,

Small update ... I fixed the problems described above during the weekend:

problem 1: this problem solved itselve due to fixing problem 3, initially i was using windows buttons and they acted on space bar key presses which i could not disable, since i'm not using actual controls anymore but just graphics i draw on the form that problem is also fixed.

problem 2: i could not find a real fix, however i do have a workaround, it seems pinballx tries to detect the process supplied in the pinballx settings and if it can't find it within a certain time it looks as if pinballx is going back to the table selection screen, at least that seems to be the behaviour i had observed. So the way i fixed it was by making sure pinballfx3 (or any other executable) that  gets launched using this launcher starts in time by adding an auto select countdown timer which will autoselect the active selection when the timer has reached 0. Usually it won't be a problem as people will choose a selection in time, it's just to prevent a possible problem if they don't. I have hardcoded it to 7 seconds which i think should be enough time to select what you want.

problem 3: i can now rotate in either 0° 90° 180° or 270°. The way i fixed it was to use graphics for the buttons, background and draw everything myselve to a bitmap and then rotate using gdi. This basically means the little program is skinable.

I'll have to do some final testing (on my own cab) and create a readme page on github to describe al settings and then i can release an initial version for all people to test and see how it goes. I'll keep you guys posted

  • Like 1

Share this post


Link to post
Share on other sites

:D It's a fantastic notice to all people with pinball fx3, cabinets and a lot of friends telling you....why can't we play 4 at a time???B) Jejejeje

 

Share this post


Link to post
Share on other sites

Hey,

I decided to release an Initial version... 

https://github.com/joyrider3774/PinballX_Launcher_app/

binary is in the release section, be sure to read the readme on github. App starts by default in 270° rotated mode (ROTATE=3 in ini) but you can change this if you run already in portrait mode (ROTATE=0 in ini is no rotation), needs minimum width of 800x600 but can be scaled up or down using SCALEM & SCALED params. And generates an ini file to be used with pinball FX3 steam version. You need cabinet mode. PinballX settings are in the screenshot in the readme on github but do not forgot to reflect to your paths (i'm running pinballx from diffrent drive that my c drive). This will only work with keyboard encoders not cabinets that show up their controls as a joystick, there simply is no joystick support build in.

I'm also not sure what happens if you use tools like XBOX360 CE i don't know if your keyboard keys still register or not. I have not tested that. Run the app once then press alt + f4 or Q immediatly, it will have created an ini file where you MUST define your keyboard keys in. You can use the showkeys.exe app to show you the numbers by pressing your cabinet buttons. By default it uses LEFT SHIFT, RIGHT SHIFT, ENTER to launch and Q to quit

I could not test much on my own cabinet as i just found out it got delivered with only a gts 710 and a not soo fast cpu pentium G5400 gold which is way too low spec to be running pinball fx 3 but i did test using keyboard on my main pc.

app can be used for other emulators / simulators / games should there be a need for being able to choose parameters with buttons, by copying and renaming original exe then repeating steps above and changing the buttons text, params and enabled states in the new ini file

lets hope it all works :)

Delphi Source is available as well

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, Outhere said:
I would love to try this out but I'm not seeing an executable file

As said check the release section on github, you are probably looking at sources. There is a link there to the compiled version. I was explicitly not directly linking to it because otherwise people would probably skip the help / readme section and don't know how to set it up initially (you need to check path is pointing to steam.exe location if it's empty and did not detect steam automatically and setup your keys. So start manually press Q or alt +f4 -> ini gets generated and then setup at least keys and verify if path is pointing to steam.Exe in the ini file). I've linked to it now but be sure to read the help / usuage section (here https://github.com/joyrider3774/PinballX_Launcher_app )  so you know what todo ...

 

On the bottom of this page the zip file with the compiled version

https://github.com/joyrider3774/PinballX_Launcher_app/releases

Share this post


Link to post
Share on other sites

i just tested it on my cab during lunch break at work. Program seems to work fine on my cab although i did had to change the rotation settings and change my keys to reflect my cabinet keyboard encoder to be albe to launch (my launch button is different). if i get some time i'll make a video after work hours of it running.

Share this post


Link to post
Share on other sites
In my defense I'm not familiar with a github 
But I should not have missed that
I have it working in pinballx and PinUP System

For PinUP System

START "" "[STARTDIR]Launch\VPXSTARTER.exe" 5 1 9 "PinballFX3Launcher"

START "" "[DIREMU]\PinballFX3Launcher.exe" -table_[GAMENAME]

Thank you

Share this post


Link to post
Share on other sites
1 hour ago, Outhere said:
In my defense I'm not familiar with a github 
But I should not have missed that
I have it working in pinballx and PinUP System

Thank you

No problem, i'm glad you got it working.

 

About github, consider its a place where people upload source code of programs they have created to share with other people so they can improve it or modify it to their liking. It might be hard to find everything if you're not used to the layout of the site.

Share this post


Link to post
Share on other sites
Do you think this would work for FX2?
The reason I ask....I have it working for FX2 except
when you select 2 Or more players the game only plays one player

 

Share this post


Link to post
Share on other sites
5 hours ago, Outhere said:
Do you think this would work for FX2?
The reason I ask....I have it working for FX2 except
when you select 2 Or more players the game only plays one player

 

As far as i'm aware pinball fx2 does not have commandline parameters for multiplayer hotseat mode, at least i could not find any information about them existing. If they do not have such command line parameters it will not work. It will just lauch the table and ignore the hotseat parameters as they are not implemented in the game. If they do exist, they might be named differently and ini file buttons section needs to be modified, but i dont think they exist. So the short answer probably no, unless someone knows the parameters and if they even exist

Share this post


Link to post
Share on other sites

After several hours of testing and testing this has been my result. The program is wonderful, the idea is very good and it works perfectly both in Pinup Popper in my cabinet and in Hyperspin in my arcade cabinet.

Faults that I have found and that at the moment I have not managed to fix: the fact of not being able to use joystik buttons....it is a pity but ....i keep searching.

In hyperspin when launching the application both Steam and the Non-steam version does not focus on the program and you have to press ALT + TAB. I have tried different ways to launch it but I can not find the correct one.

But...like i said....it's fantastic job and an amazing script.

If anybody knows the solution for both problems please tell the community.

Share this post


Link to post
Share on other sites

@davsouto i'm working on adding in joypad support, i've got a version at home where i can control the app with my xbox 360 wireless joypad. However if you can not wait you could use joytokey program for the time being.

About hyperspin & focus you mean my app does not get focus or pinball fx3 ? as i added code in my app for it to be always on on top and force it to be the foreground window every X seconds. Could you give me more details about the setup you are using or upload me the bare minimum configuration somewhere (without media etc) so i can simulate the setup on my main pc and perhaps see what's going wrong ?

 

Share this post


Link to post
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

×