PsychoPy version (3.1.5):
Standard Standalone? (y):
What are you trying to achieve?:
I am rather new to psychopy and python in general.
I am trying to adjust the opacity of text stimuli in one routine based on clicked responses that occur in a subsequent routine (in the same loop). I have valid clickable text stimuli, and when one of them is clicked in the second routine, when the loop repeats, I want the clicked stimuli to update the opacity of the corresponding text stimuli in the first routine.
What did you try to make it work?:
I have the opacities of the three text stimuli set to the variables “Step2_Opacity”, “Step3_Opacity”, and “Step4_Opacity”.
In the begin experiment tab, I set each of those variables equal to 0.
Step2_Opacity = 0 Step3_Opacity = 0 Step4_Opacity = 0
In the begin routine tab, I set each of those variables equal to themselves. In the text_stim window under advanced, I have opacity to update every repeat.
Step2_Opacity = Step2_Opacity Step3_Opacity = Step3_Opacity Step4_Opacity = Step4_Opacity
In the subsequent routine, in the each frame tab, I have
if InfoSearchSelection_Click.isPressedIn(Step2Dummy_Text): Step2_Opacity = 1 if InfoSearchSelection_Click.isPressedIn(Step3Dummy_Text): Step3_Opacity = 1 if InfoSearchSelection_Click.isPressedIn(Step4Dummy_Text): Step4_Opacity = 1
What specifically went wrong when you tried that?:
The experiment runs fine, but the opacity of the three text stimuli is still stuck at 0. The updated value of 1 is not carrying over when the loop repeats. I also have the click event set to end the routine on a valid click, and when I run through it, it is appropriately ending the routine when I click one of the text stimuli and staying in the routine when I click elsewhere.