Conditions file not taking over position of builder component in Pavlovia

URL of experiment: Lucy Mckeown / Spatial_localisation · GitLab

Description of the problem:
The position value I assign to my variable in begin experiment [0,0] remain when the routine begins and the conditions file should take over.

If I run the experiment online without defining the variable position (cue_coin_posx), I had the error: unable to convert undefined to a number. See my previous post: Unable to convert undefined to a number

Previously making the columns for x and y position separate did work, along with defining the positions as 0 for x and y in begin experiment however it is not working now.
I receive the error: unable to convert undefined to a number.

I think it may be because I changed the loop structure- the loop in question is trials_1 (routine is cond1_trial) and I have defined the variable in begin experiment within this routine in a code component call random_select_code1.

I have also tried manually (in begin routine) setting the position of my component cue_coin, with cue_coin.setPos[cue_coin_posx, cue_coin_posy] that is using the two x and y co-ordinates listed in my conditions file but it still produces a position consistent with whatever I set the position value as in begin experiment.

Question to see if I understood you correctly: you’ve got a variable in a conditions file. You’d like to use that variable to update the position parameter of a stimulus. However, using those variables in your routine gives a problem in terms of it either being undefined or being the value you assigned in a code component, begin routine tab?

Hi Thomas, yes that is problem I am having.

My current work around is assigning what I want it to be in the code component- but I think that will be a lot more time consuming moving forward than just using conditions files.

Hi Lucy,

From my crib sheet

Don’t Manipulate to values of variables set by spreadsheets. rvgart
Do Copy the value to a different variable name (e.g. thisFileName=fileName) and use/manipulate the new variable.

Ah I see thank you.

The crib sheet is great thanks just getting to grips with what that means.

Does that mean I have to define my conditions file in the code or does it mean that the variables from my conditions file need defining by assigning them new names (if I am using them in a code component).

Okay I will work through that and post when I have the solution. Thanks.

1 Like