-
Notifications
You must be signed in to change notification settings - Fork 158
Description
I used lane shots hit to add 1 to a player variable. I wanted to use shot group state complete as a way to increase the add value from 1 to 3 for the the lane hits.
The behavior I saw was:
- lane 1 hit, add 1 to player variable
- lane 2 hit, add 1 to player variable
- lane 3 hit, stack the event to add 1 to player variable, but don't execute yet
- group shots state complete, modify the add value variable from 1 to 3
- finish lane 3 hit by adding 3 to the player variable
I expected the lane 3 hit to add 1 to the player variable first.
Bosh's observation:
I've tracked down the root cause and it would be tricky, if not technically also behavior-breaking, to change. The shot sets its internal state on hit before issuing shot_hit events, and the shot_group listens to player variable changes, not shot hit events, and then it reads from each shot's internal state. So the internal state MUST be updated before completion is checked
However, it's probably better to process things in the order you expected/suggested, so you could write up an issue on the MPF repo and Anthony might find this compelling enough to dig in on. I'd include a player_var: definition, plus a shot, shot_group, the event_players, variable_players (skip the indirection of the points/score stuff, it's irrelevant here) and event sequence with current scoring behaviors at each step, vs desired scoring behavior
Per his request, I am submitting this issue.
His workaround solution was to add 1ms to the execution of the modifying of the add value variable under the group shots complete via |1ms. This works, but may have unforeseen outcomes in different scenarios.