Non-slip timing issue with stimuli that have finite duration on Pavlovia

OS: Windows 11 (latest Home build)
PsychoPy version: 2024.2.5 Py 3.10
Standard Standalone Installation? (y/n): y
Do you want it to also run locally? (y/n): It runs with no issues locally.
What are you trying to achieve?: that the routine skips whenever the trial ends (see below for more details).
Experiment code link: Here.
What did you try to make it work?: What’s been suggested in the comment here.

Link to the most relevant existing thread you have found: See link above.

What specifically went wrong when you tried that?:

See videos below to see expected vs. current behaviour.

In the code, I have an if/else statement that runs whenever the cursor gets inside a circle, then sets continueRoutine = false to move forward.

Nothing goes wrong, until I set time limits for the stimuli on screen from unlimited duration to 5 seconds in the Builder.

Here is the behaviour on Pavlovia when stimuli don’t have a set duration in the Builder. This is also the expected behaviour. The video includes the Builder screenshot.

Here is the behaviour on Pavlovia when stimuli have a 5 second set duration in the Builder. The video includes the Builder screenshot.

It appears the non-slip timing issue might still occur when stimuli on screen have a defined duration. I couldn’t find a solution to circumvent it.

I’m in a meeting so I can’t look at your videos.

I use blank duration in the component and add the duration in Experiment Settings. Is that one of your two versions?

I think not, the version with blank duration works well; the version with specified durations has said durations in the Component Properties window (for each component of course).

EDIT: Please take your time, it’s not urgent :slight_smile:

I managed to do it.

in the ‘each frame’ tab of a code component, I first assigned to a variable the current trial time:

currentTime = trialClock.getTime();.

Then, in an if statement in the same tab, I specified the deadline (5 seconds in my case):

if ((currentTime >= 5)) {
        continueRoutine = false;
}

That’s that!

Thanks for the help :slight_smile:

Cool, though you could probably just have

if t >= 5:
        continueRoutine = False

which should auto translate to

if ((t >= 5)) {
        continueRoutine = false;
}
1 Like

I’ll mark your reply as correct solution!

Thanks again :slight_smile: