-
Decide which task is most like yours, because we have five to choose from, and copy it.
-
Articulate the differences and read the configuration documentation to figure out which fields you have to change. See if you need to alter any of the common functionality or make your own, or if you just need a different config.
(Helpful in this regard: read The life-changing magic of function handles; look over phase scripts, draw scripts, and action scripts in the town library; and look over the FAQ to see if the change that you wish to make has been described.)
-
Create a
config
for your task, plus oneconfig
for each of your conditions.
The general approach is as follows:
- decide what feature(s) you need to add,
- look for a usable function in the standard library (
lib/
), - decide at which point in the task you would like this thing to happen. In every trial? After every block? At the end of each session?
- Write the logic of your little something in a task-specific function.
- If possible, contribute any generally reusable logic back to the framework.
- PsychToolbox knows what screen to draw on through a screen ID. This is stored in
config.device.screenId
. This means that you need to pass theconfig
object, or at least this particular subfield, to most of your features.