(Topic ID: 227260)

My Homebrew- Quidditch!

By ryan1234

5 years ago


Topic Heartbeat

Topic Stats

  • 123 posts
  • 38 Pinsiders participating
  • Latest reply 1 year ago by ryan1234
  • Topic is favorited by 22 Pinsiders

You

Linked Games

Topic Gallery

View topic image gallery

FB4BFE6B-2CEF-4D54-869D-279D7ECD8104 (resized).jpeg
7ff2c16097e50d3321ac7cb3a82296e46151adc7_hq (resized).jpg
76EF7C32-BD01-422F-BEFF-2185AEBDD3A4 (resized).jpeg
903DE163-7EDC-4572-AB55-98663130446A (resized).jpeg
6EB3152C-102F-4140-AC6D-C34BAC11C707 (resized).jpeg
C20349C5-1A98-41E0-AD0D-7C1D2052F06E (resized).jpeg
893AEF13-F963-471A-AC3C-5BEBE34F2628 (resized).jpeg
EFAEA78D-89D0-4448-AD85-8BF60D648F72 (resized).jpeg
F954B61A-85B2-4CD8-9E7D-59BD0D4E61F3 (resized).jpeg
C538F539-47E1-419A-9DC0-0183239FBD14 (resized).jpeg
B6ED94BC-055B-45FE-BE8A-D2C933ADDF77 (resized).jpeg
7D033BFF-C5A8-4AAA-B067-ABFAB455A10A (resized).jpeg
5722DC90-9470-4570-8D79-185083583BA3 (resized).jpeg
3D1E99EA-7319-4AFB-B8F8-A6D091544E1C (resized).jpeg
65178438-4A35-4DC3-A9B5-D9C58A4AF4AD (resized).jpeg
3B4563DA-52C6-4BDC-A850-CFF63AF913F8 (resized).jpeg

You're currently viewing posts by Pinsider bingopodcast.
Click here to go back to viewing the entire thread.

#105 2 years ago

I haven't used MPF, but I'm assuming you can drop to straight python to pulse the coils directly?

If so, writing a simple routine to increment the scores and fire the appropriate chimes simultaneously wouldn't be hard, at least it's not in pyprocgame.

Write a separate method for each scoring increment (10/100/1000) and have that control the chime. It would then work exactly as the scoring relays do in an EM.

Another question is if you've wired up the score reel switches to indicate which position the reels are on. That would simplify coding (as it did for EMs).

Something like (and this is off-the-cuff, so I haven't really thought it through, but without score reel indicator switches):

def score_10():
....if current_score % 100 == 0:
........game.coils.tens_reel.pulse()
........score_100()
....else:
........game.coils.tens_reel.pulse()
........game.coils.tens_chime.pulse()
........current_score += 10

def score_100():
....if current_score % 1000 == 0:
........game.coils.hundreds_reel.pulse()
........score_1000()
....else:
........game.coils.hundreds_reel.pulse()
........game.coils.hundreds_chime.pulse()
........current_score += 100

def score_1000():
....game.coils.thousands_reel.pulse()
....game.coils.thousands_chime.pulse()
....current_score += 1000

then you could have a main method that handles scoring, that uses an argument passed by the switch or function return for scoring you already have set up.

def add_score(amount):
....if amount == 10:
........score_10()
....elif amount == 100:
........score_100()
....elif amount == 1000:
........score_1000()

then to actually use it...

#This switch scores 100 points
def sw_rollover_switch_active(self, sw):
....if self.game.tilted == False:
........add_score(100)

This is absolutely not the only way to do it and may not even be possible with the way MPF abstractions function. I'd suggest rewriting these anyway since they don't take into account current player (you'd need to handle that however that abstraction works in MPF).

The big takeaway is that relatively simple methods can give you almost immediate coil access.

You would need to add multipliers for methods that add 500 at a clip, for example, but that is pretty trivial, and can reference these existing methods 5x (with a suitable delay between calls to allow for the physical plungers to finish moving). That's the way the score motor functions.

#106 2 years ago

I see you mentioned above how you would handle multiple scoring situations - one way (again, not optimized or likely compatible with MPF, and I don't remember offhand how to write the delay method calls in pyprocgame, but this pseudocode should give you an idea):

def score_multiple(amount, multiplier, event_name):
....cancel_delayed("multiplier" + multiplier + event_name)
....if multiplier > 0:
........add_score(amount)
........multiplier -= 1
........this.delay("multiplier" + multiplier + event_name, 0.2f, score_multiple(amount, multiplier, event_name))

This creates problems when you have multiple multipliers for the same event going on simultaneously. In a regular EM, this wouldn't happen often, and if your scoring is similar-ish to what an EM could process, it won't happen (frequently) to you, either. However, if you have several switches that score 500 without holding the ball, it could easily happen through random action.

You're currently viewing posts by Pinsider bingopodcast.
Click here to go back to viewing the entire thread.

Reply

Wanna join the discussion? Please sign in to reply to this topic.

Hey there! Welcome to Pinside!

Donate to Pinside

Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


This page was printed from https://pinside.com/pinball/forum/topic/my-homebrew-lots-of-questions?tu=bingopodcast and we tried optimising it for printing. Some page elements may have been deliberately hidden.

Scan the QR code on the left to jump to the URL this document was printed from.