psychopy.org | Reference | Downloads | Github

Change Number of Dots every repeat


#1

Hi all,

in my experiment I want to manipulate, among other things, the number of dots of a RDK across trials.

How can I do this in the builder? It seems that if I set up a condition file, this can’t be read to change the number of dots…If I follow what is written here

https://groups.google.com/forum/#!topic/psychopy-users/73MLZ7_jqqU

so that for example I have a code component that in the ‘begin routine’ has

dots = visual.DotStim(win=win, name='dots',
    nDots=target_num, dotSize=2,
    speed=0.1, dir=0.0, coherence=1.0,
    fieldPos=[-0.5, 0.0], fieldSize=1.0,fieldShape=u'circle',
    signalDots=u'same', noiseDots=u'direction',dotLife=3,
    color=[1.0,1.0,1.0], colorSpace=u'rgb', opacity=1,    depth=0.0)

how can I then draw this for only 300 ms?

Thanks!


#2

What don’t you just try using a graphical dots component in Builder rather than defining it in code? Just put your target_num variable in the “Number of dots” field, set it to update every repeat, and give it a duration of 0.3 s.


#3

Hi Michael thanks, the fact is that the Random Dot Component does not update the number dots from trial to trial…I would like to find a way to solve this.

Thanks


#4

[insert holiday delay]

OK, put something like this in the Every frame tab:

if t <= 0.300: # for the first 300 ms of a trial
    dots.draw()