mpf icon indicating copy to clipboard operation
mpf copied to clipboard

variable player with conditional entries not working

Open worldpeace-germany opened this issue 2 years ago • 0 comments

Hello,

this is in reference to this dicussion

In summary if you have a variable player like this

variable_player:
  s_pop_bumper_1_active:
    score: 100
  s_target_red_1_active:
    score: 1000
    potato: 1
  s_target_red_1_active{current_player.status_target_light_red_0 == 0}: 
      status_target_light_red_0:
        int: 1       
        action: set     
  s_target_red_1_active{current_player.status_target_light_red_0 == 1}: 
      status_target_light_red_0:
        int: 0
        action: set 

you can see in the log

EventManager: Event: ======'player_status_target_light_red_0'====== Args={'value': 1, 'prev_value': 0, 'change': 1, 'player_num': 1}
EventManager: Event: ======'player_status_target_light_red_0'====== Args={'value': 0, 'prev_value': 1, 'change': -1, 'player_num': 1}

that for each event both variable player entries are being executed. If you swap the order in the config, the order in the log changes. Thus it shows that the last entry in the config wins. The system behaves as if the condition given in {} is completely ignored or always evaluated to true.

The Q&A discussion linked above shows

  • for event player, the above is working fine, only variable player has that issue
  • a fully virtual example is attached to the Q&A

If someone provides some "getting started" where I can find the relevant code I am will to try to debug and help.

worldpeace-germany avatar Feb 21 '23 05:02 worldpeace-germany