Replies: 3 comments
-
What does the crash tell? Run with -t or check logs |
Beta Was this translation helpful? Give feedback.
-
So the log is telling me its is updating the variable but when the update_bar_width event triggers I get: EventManager: Event: ======'update_boss_width'====== Args={'priority': 0} File "/usr/local/lib/python3.9/dist-packages/mpf/core/events.py", line 697, in _run_handlers which seems like a similar error from the other threads that was fixed in a release. |
Beta Was this translation helpful? Give feedback.
-
Ok so I took what I said and passed the value in the event player, and surprise surprise it works... Next issue...how to return the current width parameter of the widget??? |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I posted this in mpf users but i'll do it here as well.
I have read a few threads in here and can get this to work with hard coded variables, but when I try and make it dynamic it crashes mc
So I have a show.yaml with
#show_version=5
slides:
mode_base_started:
widgets:
- type: rectangle
color: red
anchor_x: 0
anchor_y: 0
x: 50%
y: 50%
z: 500
width: (bar_width)
height: 30
animations:
update_boss_width:
- property: width
value: 50
and in my config I have:
show_player:
mode_boss_started:
boss_progress:
show_tokens:
bar_width: 300
...
event_player:
shot_hit:
- update_boss_width
so this works and sets the bar width to 50
when i try and add a dynamic value into the width property from my config is when it is crashing.
show yaml
config
event_player:
shot_hit:
- boss_hit
- update_boss_width
variable_player:
boss_hit:
new_bar_width: 50
this crashes
any help would be great.
Kemen
Beta Was this translation helpful? Give feedback.
All reactions