You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On startup, MPFGameLogicEngine logs a warning like this for each switch: VisualPinball: VisualPinball.Engine.Mpf.Unity.MpfGamelogicEngine|Unknown intial switch name "s_flipper".
Whenever a switch is pressed, an error like this follows: VisualPinball: VisualPinball.Engine.Mpf.Unity.MpfGamelogicEngine|Unmapped MPF switch s_flipper
This is because the _switchIds dictionary in MpfGameLogicEngine is never populated. This bug was introduced by pull request #11, that deleted the line in the MpfGameLogicEngine.OnInit function that added the switches to the _switchIds dictionary without any replacement. Later, when a switch changes state, and the MpfGamelogicEngine.Switch is called, the ID of the switch in question cannot be found in the _switchIds dictionary, because it is empty.
Moreover, MPF needs the ID to identify the switch, but it was deleted in pull request #408 in the main VPE repository. If the name of the switch is passed to the function MpfApi.Switch, the switch does no light up green in MPF when pressed. It only works with the ID. Same probably goes for coils and lamps, but I have not tested those. The MPF documentation says a number is required for each switch:
The following sections are required in the switches: section of your config:
number:
Single value, type: string. Defaults to empty.
This is the number of the switch which specifies which switch input the switch is physically connected to. The exact format used here will depend on which control system you're using and how the switch is connected.
The text was updated successfully, but these errors were encountered:
On startup,
MPFGameLogicEngine
logs a warning like this for each switch:VisualPinball: VisualPinball.Engine.Mpf.Unity.MpfGamelogicEngine|Unknown intial switch name "s_flipper".
Whenever a switch is pressed, an error like this follows:
VisualPinball: VisualPinball.Engine.Mpf.Unity.MpfGamelogicEngine|Unmapped MPF switch s_flipper
This is because the
_switchIds
dictionary inMpfGameLogicEngine
is never populated. This bug was introduced by pull request #11, that deleted the line in theMpfGameLogicEngine.OnInit
function that added the switches to the_switchIds
dictionary without any replacement. Later, when a switch changes state, and theMpfGamelogicEngine.Switch
is called, the ID of the switch in question cannot be found in the_switchIds
dictionary, because it is empty.Moreover, MPF needs the ID to identify the switch, but it was deleted in pull request #408 in the main VPE repository. If the name of the switch is passed to the function
MpfApi.Switch
, the switch does no light up green in MPF when pressed. It only works with the ID. Same probably goes for coils and lamps, but I have not tested those. The MPF documentation says a number is required for each switch:The text was updated successfully, but these errors were encountered: