PsychoPy version: 3.0.2
Standard Standalone?: Y, I think so
What are you trying to achieve?: To have one of three images appear depending on button press (left, right, down)
Disclaimer: Super amateur level programmer. Only worked with pascal and c++ at an entry level previously so my understanding of python is extremely limited. Talk to me as if I were the village idiot.
What did you try to make it work?: First I read somewhere to set the image objects to load from the start but have their opacity turned to 0, then have them appear using a code like this
(shock0-2 are objects containing one image each)
Shock0.opacity = "0" #start shock0 invisible Shock1.opacity = "0" #start shock1 invisible Shock2.opacity = "0" #start shock2 invisible if event.getKeys('down'): # if down key pushed, Shock0.opacity = "1.0" # make shock0 appear elif event.getKeys('left'): # if left key is pushed Shock1.opacity = "1.0" # make shock1 appear elif event.getKeys('right'): # if right key is pushed Shock2.opacity = "1.0" # make shock2 appear
But that didn’t work. I don’t have the error saved unfortunately, so I’m sure that I did something wrong. Now when I try to run it the stimulus doesn’t start at all. It immediately crashes with no generated output before I get to enter participant ID. So at the moment everything is just commented out for the time being.
Then I was thinking if there is a possibility to connect the start time of each image to which button is being pressed instead. And here I am. Tried looking up online resources but couldn’t find anything.
If possible I want to be able to solve it all in the builder, trying to avoid actual coding as much as possible for the time being.
Thank you in advance