Condition is not triggering correctly


#1

Can anyone explain this anomaly?

This is part of a much larger and more complex game simulation. In trying to isolate this problem (which has so far taken nearly two days!) I have stripped out 95% of the widgets and logic to isolate just this part. Note that the code here is normally part of a much longer automated flow and is not activated step-by-step using buttons.

The logic uses a variable (varClickIndex which is set to 49) to filter a Repeater ‘ShadowIndex’ (a manual value, not the Item.Index), always with one entry as the result. The value of ‘ShadowStatus’ (in this case ‘Player2’) is then used to set the value of variable varStatus. The resulting value of varStatus (‘Player2’) is then used as the condition for the following interaction, which should always be triggered in this test example. The interaction sets the value of variable varCapture to ‘true’.

If this is done in one step using button ‘Filter and Test’ (while monitoring variable values in the Console on the left), the filter works and varStatus is correctly set to ‘Player2’. However, the condition does not get triggered (even though it should) so varCapture is not set to ‘true’.

If (after reloading the page) the exact same logic is followed but in two steps using the ‘Filter Only’ and ‘Test Only’ buttons, it all works fine! Incidentally, it also works in the single-button test if the button is clicked twice!

I have tried adding Wait(500) at the end of the filter interaction but it makes no difference.

20181114 Condition not Triggering.rp (112.1 KB)


Are Repeater Item Indexes persistent?
#2

Hi fastnbulbous!

From what I gather, it sounds like you wanted the OnClick of the “Filter and Test” button to fire both its events - the first “If True” and the second “If value of varStatus equals Player2” - so that the value of varCapture equals “true” and the text on the “Filter and Test” button is set to “DONE!” from a single click. Did I get that right? If so, I was able to get this working when removing the Wait IX of 50ms in the first conditional case. Here’s what I’m seeing on my end:

Could you let me know if that’s different from what you’re seeing on your end, or if I’m misunderstanding the question?


unlisted #3