| Reference | Downloads | Github

Can´t make changes in the dots component


for an experiment a want to implement a dots component for 30s.
I changed the dots parameters to reduce number (10) and to highten the lifetime of the dots (e.g. 50 frames), however nothing changes when I run PsychoPy. I always see the equal number of dots, appearing at the same rate. I have the newest version of PsychoPy (updated yesterday).

Has anybody an advice?
Thank you very much!

Do you change the number of dots and lifetime within a trial, between trials or does it simply not respond to some constant numbers that you enter in the dots component which are the same throughout the experiment?

Number of dots and dot lifetime cannot be changed in the GUI at the moment. That’s why you don’t see the drop-down box on when it should be updated for these attributes:

This was discussed on StackOverflow and I found a hack to change the number of dots. So you can insert a code component in your routine and change the number of dots this way.

Hi lindeloev

Thank you very much for your reply!
I see! Where should I put the code component.
I copied your code (see below) into a code component (beginn routine) before the dot component but
it does not work.

dots.nDots = 5
dots._dotsDir = [0]*dots.nDots
dots. _verticesBase = dots._newDotsXY(dots.nDots)

You should name it after your dots component. If you called it mydots the first line in the code would be mydots.nDots = 5 and so on for the other lines. It should not matter where you put it in your routine, but I’d put it below the dots component to indicate that you’re altering it in addition to what the component does.

Again, it is a hack, so it may cause something in the dots to be not displayed correctly, but try it out :slight_smile:

Great! Thank you very much!