Implement Score Motor component#435
Conversation
|
This looks awesome! Thanks for all of the hours you put into this! |
|
After discussions on Discord, @freezy suggested using the existing I've refactored the code accordingly, and it really makes everything a lot more clean. The I've also added selecting the If a |
|
The last remaining issue is to revisit the score reel animation. It can often times get out of sync with the reels internal score. |
There was a problem hiding this comment.
Thanks, this is so cool!
Added a few comments. One thing I still don't understand is why can't you completely replace the add points methods by set point methods? Then you can also unify it with reset. I still don't get why reset is any different from "set points to 0".
Awesome stuff though. Will check out the UVS part tomorrow.
The reason why I'm using add points is because of the blocking. For example, we have 1000 points and we tell the score display to update 500 points:
Since we had the Update Display visual scripting unit, and each display offers a clear method, I thought a Clear Display unit would be a good addition. Reset is doing a little more than just setting the reels to zero. It follows all the same timing rules, and has logic to keep the motor running for an additional turn if needed. Say the score is 2230, one turn is going to advance the digits 5 times: 3340, 4450, 5560, 6670, 7780 We still need to respect that timing (wait, increase, increase, increase, increase, increase). Since we are not at zero, the score motor continues for another revolution 8890, 9900, 0, 0, 0 (wait, increase, increase, increase, increase, increase). |
|
Good point, I didn't think about the concurrency issue. Now it makes sense! I'll go through it again tonight and merge if all is good. Thanks for bearing with me :) |
|
Oh, one more thing. I suppose that currently, in UVS, it's entirely possible for a user to put scores like 1500. How do we deal with that? Error, warning, or fall back to non-score-motor driven scoring for those cases? |
I went through and cleaned up the I also removed |
The score motor figures out the increase doesn't make sense and then logs the error, and the points are thrown away. |
freezy
left a comment
There was a problem hiding this comment.
Okay for me now.
In the future, to do timing-related stuff, coroutines might be an easier approach.
Can be merged once the doc is done.
|
Oh, and don't forget the UVS doc for the new nodes! |
|
Also, PinMAME needs to be updated with the new API (and preferably MPF as well) |
0b62d3e to
eeb736a
Compare

This PR closes #421.
It adds a new
ScoreMotorComponentthat can be configured to correctly one or manyScoreReelDisplayComponent.ScoreReelDisplayComponenthas been updated to look for aScoreMotorComponent. If found, the display will keep track of its score.The Score Motor can be configured in the inspector:
The default settings are suitable for a Gottlieb EM, ie: 6 steps in 120 degrees over 769ms.
The component forces a working configuration, ie, you can not configure less than 5 steps.
The
ScoreMotorComponentalso exposes two switchesMotor Running SwitchandMotor Step Switchthat can be configured in theSwitch Manager:There will be a follow up PR that adds new Visual Scripting Units to tie this all together.
Thanks again to @freezy, @Scottacus64, @bord, and @Cupiii for the several hours of discussion to get this figured out.