missionpinball / mpf-gmc

Godot-based Media Controller for the MPF pinball framework
MIT License
12 stars 4 forks source link

Carousel, highlights and start game not working. #17

Open Pucksnok opened 4 days ago

Pucksnok commented 4 days ago

Hello. I have an issue when using carousel mode with attract. When I use carousel in attract mode I can't start a game, usually it gives some error but here it's nothing. I do see that the switch is active and correctly named. If I exclude the carousel parts it can start game and starts the base mode without any issues.

I have tried replacing the addons folder. I have tried do a completely new attract.yaml and attract.tscn I have tried an attract scene with only a background but still using the carousel active in attract.yaml. I have tried to use files for carousel provided by Atummons on the Trident Pinball discord, see files in zip. attract.zip

What I also see is that the old carousel highlights isn't working.

event_player: carousel_MPFSlide_highlighted: test_event carousel_MPFSlide2_highlighted: test_event2 carousel_MPFSlide3_highlighted: test_event3

None of the events are posted when doing highlight like in 0.54.

My switch works, I see it in both the graphical interface of mpf and the logs/text prompt.

switches: s_start_button: number: 3-0-21 tags: start s_start_button shows up as active in both mpf logs and the gmc output. I also see it being pressed if I use the graphical ui of mpf.

Is this some bug or am I just stupid? I have done what I can to do everything as basic as possible in my code replacing everything in my attract and base mode, makes no difference, all I can do is to skip the carousel.

Sorry for that the code looks wrong, it looks correct in my windows but not when posted.

Cheers.

Pucksnok commented 4 days ago

Godot v4.3.stable.official [77dcf97d8] Mission Pinball Framework v0.80.0.dev5

I downloaded new addons folder today to test, no difference.

avanwinkle commented 4 days ago

Hello Gill!

Attract mode has some special functionality related to starting games, so your mode must inherit from the Attract code, not the Carousel code.

MPF provides default configs for the key modes like attract, so the easiest thing to do is just remove the mode: section from your attract.yaml file and let the defaults work. If you prefer to have your own mode: section, then change the code line to use the Attract code:

code: mpf.modes.attract.code.attract.Attract

Note that the Attract mode inherits from Carousel, so all of your carousel setup will still work after you switch. This is a recent change—previously, users had to create one main attract mode for the attract functionality and a concurrent attract carousel for the carousel functionality. But you're on 0.80.dev5 which has the change, hurray!

avanwinkle commented 4 days ago

As for the carousel item highlights, those are changed in 0.80 to use a single standard event _itemhighlighted and arguments to identify the carousel (mode name) and the item. So if your mode name is "attract" and your highlighted item is "MPFSlide2", you should see an event in your logs like this:

item_highlighted{carousel: 'attract', direction: 'forward', item: 'MPFSlide2'}
Pucksnok commented 3 days ago

Thank you! I removed "code: mpf.modes.carousel.code.carousel.Carousel" and it now works again. highlight also works. Much appreciated.