Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 109K
|
+x+x+x+x+x+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate euclidean distance from screen center and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%, true) / txcolor = white / txbgcolor = black </defaults>
<values> / x = 0px / y = 0px / centerx = (display.canvaswidth)/2 / centery = (display.canvasheight)/2 / mirrorx = false // mirror horizontally / mirrory = false// mirror vertically </values>
<expressions> / x = 1px*abs(values.x-(values.mirrorx*display.canvaswidth)) / y = 1px*abs(values.y-(values.mirrory*display.canvasheight)) / distance = sqrt((trial.move.responsex - values.centerx) * (trial.move.responsex - values.centerx) + (trial.move.responsey - values.centery) * (trial.move.responsey - values.centery)) </expressions>
<expt> / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey] / branch = [trial.move] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialend = [values.x=trial.move.responsex; values.y=trial.move.responsey; if (expressions.distance <= shape.33pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; } else if (expressions.distance >= shape.66pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 33% / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 66% / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 99% / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<shape dot> / shape = circle / width = 4% / color = (blue) / erase = false / hposition = expressions.x / vposition = expressions.y </shape>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
good point, i will look at your code and get my head around it big thanks for all your help yes that looks like all the eliments are there . thanks again hi, i am almost getting this to work now, your script contained much of what I needed but was not quite what I needed in of itsself. in essence. I am trying to get the bellow branching to work constantly. I need it to branch based on values of expressions.distance that are higher than some values yet lower than others. So within a range of expressions.distance relative to the shape items (100pct, 75pct, 50pct, 25pct) Can you see what i am doin wrong please? Many thanks Peter <trial choice> / stimulusframes = [1=clearscreen, 100pct, 75pct, 50pct, 25pct] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance <= shape.50pct.heightpx/2) {trial.TL_high} else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance <= shape.75pct.heightpx/2) {trial.NS} else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high} else {trial.choice}] / timeout = 1 / recorddata = false / ontrialend =[values.x =0; values.y= 0] </trial> Once again: Please provide code that can actually be run and examined.
|
|
|
peter
|
|
Group: Forum Members
Posts: 64,
Visits: 210
|
+x+x+x+x+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate euclidean distance from screen center and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%, true) / txcolor = white / txbgcolor = black </defaults>
<values> / x = 0px / y = 0px / centerx = (display.canvaswidth)/2 / centery = (display.canvasheight)/2 / mirrorx = false // mirror horizontally / mirrory = false// mirror vertically </values>
<expressions> / x = 1px*abs(values.x-(values.mirrorx*display.canvaswidth)) / y = 1px*abs(values.y-(values.mirrory*display.canvasheight)) / distance = sqrt((trial.move.responsex - values.centerx) * (trial.move.responsex - values.centerx) + (trial.move.responsey - values.centery) * (trial.move.responsey - values.centery)) </expressions>
<expt> / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey] / branch = [trial.move] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialend = [values.x=trial.move.responsex; values.y=trial.move.responsey; if (expressions.distance <= shape.33pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; } else if (expressions.distance >= shape.66pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 33% / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 66% / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 99% / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<shape dot> / shape = circle / width = 4% / color = (blue) / erase = false / hposition = expressions.x / vposition = expressions.y </shape>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
good point, i will look at your code and get my head around it big thanks for all your help yes that looks like all the eliments are there . thanks again hi, i am almost getting this to work now, your script contained much of what I needed but was not quite what I needed in of itsself. in essence. I am trying to get the bellow branching to work constantly. I need it to branch based on values of expressions.distance that are higher than some values yet lower than others. So within a range of expressions.distance relative to the shape items (100pct, 75pct, 50pct, 25pct) Can you see what i am doin wrong please? Many thanks Peter <trial choice> / stimulusframes = [1=clearscreen, 100pct, 75pct, 50pct, 25pct] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance <= shape.50pct.heightpx/2) {trial.TL_high} else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance <= shape.75pct.heightpx/2) {trial.NS} else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high} else {trial.choice}] / timeout = 1 / recorddata = false / ontrialend =[values.x =0; values.y= 0] </trial>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 109K
|
+x+x+x+x+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate euclidean distance from screen center and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%, true) / txcolor = white / txbgcolor = black </defaults>
<values> / x = 0px / y = 0px / centerx = (display.canvaswidth)/2 / centery = (display.canvasheight)/2 / mirrorx = false // mirror horizontally / mirrory = false// mirror vertically </values>
<expressions> / x = 1px*abs(values.x-(values.mirrorx*display.canvaswidth)) / y = 1px*abs(values.y-(values.mirrory*display.canvasheight)) / distance = sqrt((trial.move.responsex - values.centerx) * (trial.move.responsex - values.centerx) + (trial.move.responsey - values.centery) * (trial.move.responsey - values.centery)) </expressions>
<expt> / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey] / branch = [trial.move] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialend = [values.x=trial.move.responsex; values.y=trial.move.responsey; if (expressions.distance <= shape.33pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; } else if (expressions.distance >= shape.66pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 33% / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 66% / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 99% / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<shape dot> / shape = circle / width = 4% / color = (blue) / erase = false / hposition = expressions.x / vposition = expressions.y </shape>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
good point, i will look at your code and get my head around it big thanks for all your help yes that looks like all the eliments are there . thanks again FYI, I've cleaned up the example code some. Updated code is in edited post above.
|
|
|
peter
|
|
Group: Forum Members
Posts: 64,
Visits: 210
|
+x+x+x+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate euclidean distance from screen center and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%, true) / txcolor = white / txbgcolor = black </defaults>
<values> / x = 0px / y = 0px / centerx = (display.canvaswidth)/2 / centery = (display.canvasheight)/2 / mirrorx = false // mirror horizontally / mirrory = false// mirror vertically </values>
<expressions> / x = 1px*abs(values.x-(values.mirrorx*display.canvaswidth)) / y = 1px*abs(values.y-(values.mirrory*display.canvasheight)) / distance = sqrt((trial.move.responsex - values.centerx) * (trial.move.responsex - values.centerx) + (trial.move.responsey - values.centery) * (trial.move.responsey - values.centery)) </expressions>
<expt> / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey] / branch = [trial.move] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialend = [values.x=trial.move.responsex; values.y=trial.move.responsey; if (expressions.distance <= shape.33pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; } else if (expressions.distance >= shape.66pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 33% / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 66% / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 99% / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<shape dot> / shape = circle / width = 4% / color = (blue) / erase = false / hposition = expressions.x / vposition = expressions.y </shape>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
good point, i will look at your code and get my head around it big thanks for all your help yes that looks like all the eliments are there . thanks again
|
|
|
peter
|
|
Group: Forum Members
Posts: 64,
Visits: 210
|
+x+x+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate euclidean distance from screen center and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%, true) / txcolor = white / txbgcolor = black </defaults>
<values> / x = 0px / y = 0px / centerx = (display.canvaswidth)/2 / centery = (display.canvasheight)/2 / mirrorx = false // mirror horizontally / mirrory = false// mirror vertically </values>
<expressions> / x = 1px*abs(values.x-(values.mirrorx*display.canvaswidth)) / y = 1px*abs(values.y-(values.mirrory*display.canvasheight)) / distance = sqrt((trial.move.responsex - values.centerx) * (trial.move.responsex - values.centerx) + (trial.move.responsey - values.centery) * (trial.move.responsey - values.centery)) </expressions>
<expt> / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey] / branch = [trial.move] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialend = [values.x=trial.move.responsex; values.y=trial.move.responsey; if (expressions.distance <= shape.33pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; } else if (expressions.distance >= shape.66pct.heightpx/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 33% / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 66% / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 99% / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<shape dot> / shape = circle / width = 4% / color = (blue) / erase = false / hposition = expressions.x / vposition = expressions.y </shape>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
good point, i will look at your code and get my head around it big thanks for all your help
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 109K
|
+xsorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that? Why does that require a large matrix? Seems to me you can simply calculate Euclidean distance from screen center (or whatever else the common center point is, the circles are concentric after all) and do whatever you need to do based on that. <defaults> / inputdevice = mouse / screencolor = black / fontstyle = ("Verdana", 2.50%) / txcolor = white / txbgcolor = black / canvasaspectratio = (4,3) </defaults>
<values> / x = 0px / y = 0px / centerx = 0px / centery = 0px </values>
<expressions> / distance = sqrt((values.x - values.centerx) * (values.x - values.centerx) + (values.y - values.centery) * (values.y- values.centery)) </expressions>
<expt> / onexptbegin = [ values.centerx = display.canvaswidth/2; values.centery = display.canvasheight/2; ] / blocks = [1=example] </expt>
<block example> / trials = [1=start] </block>
<trial start> / stimulusframes = [1=clickhere] / validresponse = (lbuttondown) / ontrialend = [ values.x=trial.start.responsex; values.y=trial.start.responsey; ] / branch = [ return trial.move; ] / recorddata = false </trial>
<shape center> / shape = rectangle / size = (5px, 5px) / position = (50%, 50%) / erase = false / color = magenta </shape>
<trial move> / ontrialbegin = [ if (expressions.distance > shape.66pct.height/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = blue; } else if (expressions.distance > shape.33pct.height/2) { shape.33pct.color = red; shape.66pct.color = green; shape.99pct.color = black; } else { shape.33pct.color = red; shape.66pct.color = black; shape.99pct.color = black; }; ] / stimulusframes = [1=clearscreen, 99pct, 66pct, 33pct, center, coordinates] / validresponse = (mousemove, lbuttondown, rbuttondown) / numframes = 1 / ontrialend = [ values.x=trial.move.responsex; values.y=trial.move.responsey; ] / branch = [if (trial.move.response=="lbuttondown") { return trial.end; } else if (trial.move.response == "rbuttondown") { return trial.pause; } else if (trial.move.response == "mousemove") { return trial.move; }; ] / recorddata = false </trial>
<shape 33pct> / shape = circle / color = black / height = 0.33px * display.canvasheight / erase = false </shape>
<shape 66pct> / shape = circle / color = black / height = 0.66px * display.canvasheight / erase = false </shape>
<shape 99pct> / shape = circle / color = black / height = 0.99px * display.canvasheight / erase = false </shape>
<trial pause> / stimulusframes = [1=coordinates] / validresponse = (mousemove, lbuttondown) / numframes = 1 / ontrialend = [ values.x=trial.pause.responsex; values.y=trial.pause.responsey; ] / branch = [if (trial.pause.response=="lbuttondown") { return trial.move; } else { return trial.pause; }; ] / recorddata = false </trial>
<trial end> / stimulusframes = [1=clearscreen, goodbye] / validresponse = (lbuttondown) / recorddata = true </trial>
<text coordinates> / items = ("x=<%values.x%> | y=<%values.y%> | distance=<%expressions.distance%>") / position = (50%, 5%) / size = (40%, 4%) / vjustify = center / erase = false / txbgcolor = transparent </text>
<text clickhere> / items = ("Click to start.") </text>
<text goodbye> / items = ("Goodbye!") </text>
|
|
|
peter
|
|
Group: Forum Members
Posts: 64,
Visits: 210
|
+x+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position? sorry yes i see my error. But end or start, trial.choice only does one thing. it takes the position of the mouse and activates a circle. I went for this approach because the cursor positions that we intend to use are complicated (many concentric circles, more than in the example I sent) using cursor position (x and y) would require uploading a large matrix file representing the image that we want map onto . Can inquisist do that?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 109K
|
+x+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you. > basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. No, you just -- one post prior -- said that the cursor is on a given shape object at the *start* (not end) of trial choice. So, again, why is trial.choice needed? You know the cursor position at the end of your X iterations of trial.search, so why don't you /branch from trial.search to wherever you need to go based on the cursor position?
|
|
|
peter
|
|
Group: Forum Members
Posts: 64,
Visits: 210
|
+x+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then. basically I need the to branch to three different trials based on where the curser is at the end of trial.choice. Only one was branch (trial.TL_high) was included on the demmo to cut down one script size I sent you.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 109K
|
+x+xFirst, if code you post requires external files to run, provide the files please. Second, you should at least give a short overview what the code is supposed to do in the first place. That isn't obvious, especially not for code that does not work. The only thing I can say without being actually able to run the script and examine things more closely is that <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == start) trial.TL_high] / branch = [if (trial.choice.response == start2) trial.TL_high] / branch = [if (trial.choice.response == start3) trial.TL_high] </trial> is wrong and ought to read <trial choice> / stimulustimes = [1=clearscreen; 10=start3; 10=start2; 10=start] / ontrialbegin = [values.iteration = 0; picture.hoop.width = 100%] / inputdevice = mouseover / validresponse = (start, start2, start3) / recorddata = true / branch = [if (trial.choice.response == "start") trial.TL_high] / branch = [if (trial.choice.response == "start2") trial.TL_high] / branch = [if (trial.choice.response == "start3") trial.TL_high] </trial> Yes of course it should what was I thinking. The script is supposed to work thus: In trial.search i use the mouse to move the board around (under the view hole) until the trial ends after a number of iterations. That works fine. Then trail.choice begins. In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3), this should then trigger the start of a new trial, that works now but only if the mouse/cursor is moving at the start of trial.choice Is it possible to get the mouse/curser to trigger the shape object (start start2 start3) even if the mouse is not moving?    > In trial.choice the curser/mouse starts the trial on a given shape object (start start2 start3) Not clear to me for what trial choice is needed at all then.
|
|
|