So effectively you want this variable to alternate from 0 to 1, which means it can’t be controlled within your conditions file, as that is being presented in random order. So you could use code instead to generate a value on each trial. For example, set
stimType to be
0 on even-numbered trials and
1 on odd-numbered trials. To do this, insert a Code Component from the “custom” component panel. In the “Begin routine” tab, insert something like this:
# set stimType to alternate from 0 to 1
# on even- and odd-numbered trials:
stimType = your_loop_name.thisN % 2
# save the value in the data file:
% or modulo operator returns the remainder of dividing the current trial number by 2, which will be
0 for even-numbered trials (including the first one, which is number 0), and
1 for odd numbered trials.
You can then refer to this variable elsewhere, but arrange this code component to be above any other components which refer to it, so that they get access to the value which has been calculated for the current trial.