VisualPinball / VisualPinball.Engine.Mpf

Mission Pinball Framework support for VPE
MIT License
0 stars 1 forks source link

Could not find mpf.exe #15

Open arthurkehrwald opened 2 months ago

arthurkehrwald commented 2 months ago

After fixing the compile errors described in this issue, I ran into another error when attempting to get the machine description into Unity using the button on the MPF Game Logic engine in the inspector: VisualPinball: VisualPinball.Engine.Mpf.Unity.MpfGamelogicEngine|Unable to get machine description. Check maching config. Could not find mpf.exe!

I am using Windows 11 with the latest version of this repo. I tried MPF version 0.55 with Python 3.7 as suggested in the, MPF version 0.56 with Python 3.9, and the latest MPF version 0.80 with Python 3.11. I was always able to run MPF on its own, but the error in Unity remains the same.

I am not sure where I would even get an MPF .exe file, since official precompiled binaries are only available for Linux and Mac.

arthurkehrwald commented 2 months ago

So I found mpf.exe in AppData\Local\Programs\Python\Python39\Scripts. I also looked at the code that is supposed to find it. It appends '\mpf.exe' to every path found in the PATH environment variable and checks if the file exists. Since my Python39/Scripts directory is in my PATH variable, it should find the executable this way, but for some reason it does not. I am currently trying to figure out how to debug the Spawn function in MpfSpawner.cs to understand why. So far, the debugger does not allow me to step into the MpfApi.GetMachineDescription function. Seems like it's compiled into a .dll, so that is probably why.

arthurkehrwald commented 2 months ago

I figured it out. I had installed Python at user level rather than system level. This caused the mpf.exe to be placed in a directory that is not checked by the current code. I have submitted PR #17 to fix this.