Millisecond Forums

Does the "current" option really work?

https://forums.millisecond.com/Topic2148.aspx

By Blackadder - 10/29/2008

Hi, below you find a simple script using the "current" option to link multiple counters. The script is only a stripped down version of a much more complicated experiment but suffices to illustrate my struggle.

The experimental idea is very simple. I have four stimulus positions in each of the four screen quadrants. Now I want to assign letters to each of these positions. In a distractor trial, an "X" is displayed at each of the four positions whereas in a target trial one of the "X"s is replaced by an "A".

My goal in any experimental script is to keep the number of <trial> elements low in order to be able to have the lowest possible denominator for total repetitions. So I came up with the following idea. I define eight counters, every two of which specify a screen position. Hence, counters 1 and 2 define the first position (1=X, 2=Y), counters 3 and 4 the second (3=X,4=Y) and so forth. Now, when a trial starts, the first counter draws an item at random and each of the other counters links to it and produce the rest of the positions in such a way that each possible order of "X"s and the "A" is realized.

Problem is: it doesn't work. I only see the one letter in each trial, being located in the upper left quadrant, the other three are missing (or probably all displayed at the same location). Why is that?

Bye, Malte


=== SCRIPT STARTS HERE ===

---Settings ---

<defaults>
/ screencolor = (255, 255, 255)
/ inputdevice = keyboard
</defaults>

<data>
/ encrypt = false
/ columns = [date, time, subject, build, blocknum, trialnum, blockcode, trialcode, pretrialpause, posttrialpause, windowcenter, trialduration, trialtimeout, blocktimeout, response, correct, latency]
</data>


--- Positions ---

<counter counter_POS1_X>
/ items = (-25, 25, -25, 25)
/ select = noreplace
</counter>

<counter counter_POS1_Y>
/ items = (-25, 25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS2_X>
/ items = (25, -25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS2_Y>
/ items = (25, -25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS3_X>
/ items = (-25, 25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS3_Y>
/ items = (25, -25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS4_X>
/ items = (25, -25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS4_Y>
/ items = (-25, 25, 25, -25)
/ select = current(counter_POS1_X)
</counter>


--- Stimuli ---

<text text_LETTERTAR>
/ items = ("A")
/ fontstyle = ("Tahoma", 40)
/ hposition = counter_POS1_X
/ vposition = counter_POS1_Y
</text>

<text text_LETTERDIS1>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = counter_POS1_X
/ vposition = counter_POS1_Y
</text>

<text text_LETTERDIS2>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = counter_POS2_X
/ vposition = counter_POS2_Y
</text>

<text text_LETTERDIS3>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = counter_POS3_X
/ vposition = counter_POS3_Y
</text>

<text text_LETTERDIS4>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = counter_POS4_X
/ vposition = counter_POS4_Y
</text>


<shape shape_BLANK>
/ shape = rectangle
/ color = (255, 255, 255)
/ size = (1024, 1024)
/ position = (50, 50)
</shape>


--- Trials ---

<trial trial_DIS>   
/ validresponse = (203,205)
/ correctresponse = (203)
/ responseinterrupt = trial
/ pretrialpause = 500
/ stimulusframes = [1 = sequence(text_LETTERDIS1, text_LETTERDIS2, text_LETTERDIS3, text_LETTERDIS4); 100 = shape_BLANK]
</trial>

<trial trial_TAR>   
/ validresponse = (203,205)
/ correctresponse = (205)
/ responseinterrupt = trial
/ pretrialpause = 500
/ stimulusframes = [1 = sequence(text_LETTERTAR,  text_LETTERDIS2, text_LETTERDIS3, text_LETTERDIS4); 100 = shape_BLANK]
</trial>


--- Blocks ---

<block block_MAIN>
/ screencolor = (255, 255, 255)
/ trials = [1-20 = noreplace(trial_DIS, trial_TAR)]
</block>


--- Experiment ---

<expt>
/ blocks = [1 = block_MAIN]
</expt>

By Dave - 10/29/2008

Malte,

according to my experience, "current" *does* work. However, negative values seem to be a problem for the / position attributes. So, how about this:

=== SCRIPT STARTS HERE ===

---Settings ---

<defaults>
/ screencolor = (255, 255, 255)
/ inputdevice = keyboard
</defaults>

<data>
/ encrypt = false
/ columns = [date, time, subject, build, blocknum, trialnum, blockcode, trialcode, pretrialpause, posttrialpause, windowcenter, trialduration, trialtimeout, blocktimeout, response, correct, latency]
</data>


--- Positions ---

<counter counter_POS1_X>
/ items = (-25, 25, -25, 25)
/ select = noreplace
</counter>

<counter counter_POS1_Y>
/ items = (-25, 25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS2_X>
/ items = (25, -25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS2_Y>
/ items = (25, -25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS3_X>
/ items = (-25, 25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS3_Y>
/ items = (25, -25, -25, 25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS4_X>
/ items = (25, -25, 25, -25)
/ select = current(counter_POS1_X)
</counter>

<counter counter_POS4_Y>
/ items = (-25, 25, 25, -25)
/ select = current(counter_POS1_X)
</counter>


--- Stimuli ---

<text text_LETTERTAR>
/ items = ("A")
/ fontstyle = ("Tahoma", 40)
/ hposition = 50 + counter_POS1_X
/ vposition = 50 + counter_POS1_Y

</text>

<text text_LETTERDIS1>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = 50 + counter_POS1_X
/ vposition = 50 + counter_POS1_Y
</text>

<text text_LETTERDIS2>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = 50 + counter_POS2_X
/ vposition = 50 + counter_POS2_Y
</text>

<text text_LETTERDIS3>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = 50 + counter_POS3_X
/ vposition = 50 + counter_POS3_Y
</text>

<text text_LETTERDIS4>
/ items = ("X")
/ fontstyle = ("Tahoma", 40)
/ hposition = 50 + counter_POS4_X
/ vposition = 50 + counter_POS4_Y
</text>


<shape shape_BLANK>
/ shape = rectangle
/ color = (255, 255, 255)
/ size = (1024, 1024)
/ position = (50, 50)
</shape>


--- Trials ---

<trial trial_DIS>  
/ validresponse = (203,205)
/ correctresponse = (203)
/ responseinterrupt = trial
/ pretrialpause = 500
/ stimulusframes = [1 = sequence(text_LETTERDIS1, text_LETTERDIS2, text_LETTERDIS3, text_LETTERDIS4); 100 = shape_BLANK]
</trial>

<trial trial_TAR>  
/ validresponse = (203,205)
/ correctresponse = (205)
/ responseinterrupt = trial
/ pretrialpause = 500
/ stimulusframes = [1 = sequence(text_LETTERTAR,  text_LETTERDIS2, text_LETTERDIS3, text_LETTERDIS4); 100 = shape_BLANK]
</trial>


--- Blocks ---

<block block_MAIN>
/ screencolor = (255, 255, 255)
/ trials = [1-20 = noreplace(trial_DIS, trial_TAR)]
</block>


--- Experiment ---

<expt>
/ blocks = [1 = block_MAIN]
</expt>


BTW, what keys are denoted by these scancodes (203 & 205). My keyboard doesn't have them...

Best,
~Dave
By Blackadder - 10/29/2008

Man, Dave, I was completely nails up on that. Somehow I assumed that Inquisit's virtual coordinates are -100...100, but they really are 0...100. I'll just draw from (25, 75) in the counters.

THX, Malte.
By Dave - 10/29/2008

I took me some time to notice, too. Any word on the odd scancodes?
~Dave
By Blackadder - 10/29/2008

Yeah, look here:

http://www.millisecond.com/forums/Topic1004.aspx
By Dave - 10/29/2008

Ah, thanks! I had missed that...

~Dave