URL of experiment:
https://pavlovia.org/kito323/circle
Description of the problem:
Hello!
My problem is similar to the many before mine. When I run my experiment locally on PsychoPy it works fine. But when I upload it to the Pavlovia I get errors. Previously I’ve seen that this error occurs due to positioning problems. Usually the answer was that when reading locations in from excel/CSV file the x and y coordinates should be separately. In my case I use custom code component to create those positions. Idea is to have 10 circles flying and bouncing around the screen for about 10 seconds. I define initial positions and velocity vectors for the dots in the code component. Right now for the simplicity the paths are predetermined because I can’t use external libraries like numpy to generate randomness due to auto->JS option that is needed to run it online (it was previous error that the ‘np’ was undefined). When I look browser console when this error occurs I see this:
browser_console|690x359
On my main js file (circle.js) on the line 443 there is “correct_dot.setSize([dot_size, dot_size]);” what seems pretty okay to me as the variable ‘dot_size’ is defined previously (then again I looked at JS first time during this project). I tried moving around the defining of that variable in my code component and tried setting the size variable constant/non-constant in the builder but it didn’t do anything (only threw warning when tried to set it constant that I might want to set it to update but actually, de facto, I don’t).
I tried messing around with the positioning of the dots in builder as well but it didn’t seem to work either. Everything always gave me the same error message.
I guess the experiment should be accessible so the code component and dots’ settings in builder can be seen there.
I guess if none of it works I can pre generate and choose the random paths with python and numpy and save them in a csv file and then read it in with the loop and get rid of the code component entirely and then it should definitely be able to run online, right? Because it feels like that the problem is due to my code component and the variables defined in there. Though it seems to me a bit dumb way to do it.
(A bit off-topic but should I somehow use framerate variable too to be sure that everyone get the same dot speeds? How should it be done then with the pre generated paths?)
Thanks in advance!