Conditional start of components

OS (e.g. Win10): MacOS
PsychoPy version (e.g. 1.84.x): v2021.2.3
Standard Standalone? (y/n) If not then what?:y
What are you trying to achieve?:

a visual-tactile experiment: Block design, 2 blocks: UP and DOWN.
In each block, stimulus can be: visLeft, visRight, tacLeft, tacRight, vistacLeft, vistacRight, visLeftTacRight, visRightTacLeft

visual stimulus is RDK
tactile stimulus is from a device - which has been coded and directions are coded as dir = “LEFT” or dir =“RIGHT”
Also it is important for the two stimuli to start and end at the same time.
participants need to press left or right according to what they see.

What did you try to make it work?:

I have a loop for blocks.
I have a loop for trials. The routine vis_tac_Trials have a fixation cross which should be there on the screen regardless of the stimulus type.
Component tac which is the code snippet for tactile stimulus moving left.
Component rdk which presents the rdk in left direction.
and a key response, to check the key press and reaction time

I want to add conditional starting of each component. it can be either only the rdk component, only the tac component or both. to achieve this, I tried adding the conditions in the loop (screenshots attached). but it stops after the first three stimuli.

As a next step, I also want to add conditions for it to even choose the directions. I can do this for rdk component. How can I add this in the code component?

Can somebody pls guide me how to choose which component to present?

I would be really grateful for the help.

What specifically went wrong when you tried that?:
Trials loop turns in to a never ending loop AFTER THE FIRST VIS = 0. stimulus presentation freezes after this condition in the loop. So I press escape to quit the experiment and receive the error (which is attached)

Include pasted full error message if possible. “That didn’t work” is not enough information.






![Screenshot 2022-01-31 at 00.33.58|690x394](upload://a

02On5EM0ylMTe1thUOn26WFodC.png)

Those errors seem to be related to the height of a button component. It says height should be <= 30 and has been set to 32.

I’ve not tried RDKs online but I see that there is now a Prototype.
https://psychopy.org/online/status.html

Thank you! Can you be more specific? What button component? I am new to psychopy and python

@wakecarter UPDATE : the loop enters a never-ending condition after the first vis=0. I checked this by rearranging the 0s and 1s in the excel sheet.
Can you please tell about it in more detail?