selection of a shape for branching


Author
Message
peter
peter
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 64, Visits: 210
Dave - 11/25/2021
First, 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?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 107K
First, 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>
   

Edited 4 Years Ago by Dave
peter
peter
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 64, Visits: 210
Hi all, am trying to use mouse position over a shape as a validresponse for branching.
I am trying to use mouse position over three shapes (start, start2, start3) to branch from trial.choice to trial.TL_high.
Can anyone see what I am doing wrong please
 
<values>
/ x = -1
/ y = -1
/ trialcounter = 0
/ reinforcement = 0
/ agency = 0
/ iteration = 0
</values>



<block search>
/ trials = [1-10 = search]
</block>


<trial search>
/ stimulustimes = [1=clearscreen, bord, viewhole, hoop]
/ ontrialbegin = [picture.bord.hposition = 1px * mouse.x;picture.bord.vposition = 1px * mouse.y; picture.hoop.width = picture.hoop.width -.2%; values.iteration = values.iteration +1]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ branch = [if (values.iteration == 430) {
  trial.choice;
    } else {
   trial.search;
  }
]
/timeout =1
/ recorddata = false
</trial>


** NOTE start, start2, start3 are shape objects **

<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>
                        

<trial TL_high>
/ ontrialbegin = [values.x = mouse.x; values.y = mouse.y; values.agency=1]
/ ontrialbegin = [trial.TL_high.insertstimulustime(sound.high, 100)]
/ stimulustimes = [1=clearscreen]
/ timeout= (100)
/ recorddata = true
</trial>
        
<sound high>
/items = high
/playthrough = true
/select = noreplace
</sound>

<item high>
/1 = "wave_high_fr1000.wav"
</item>
                    
                                            
                        
<shape start>
/ shape = circle
/ color = (0, 0, 200)
/ size = (100, 100)
/ position = (50%, 50%)
</shape>

<shape start2>
/ shape = circle
/ color = (0, 200, 0)
/ size = (400, 400)
/ position = (50%, 50%)
</shape>

<shape start3>
/ shape = circle
/ color = (200, 0, 0)
/ size = (800, 800)
/ position = (50%, 50%)
</shape>

<picture hoop>
/ items = ("hoop.png")
/ erase = false
/ width = 100%
/ height = 100%
</picture>

<picture viewhole>
/ items = ("Hole2.png")
/ erase = false
/ size=(3000, 3000)
</picture>

<picture bord>
/ items = ("bord4.jpg")
/ erase = false
/ size=(5000, 5000)
</picture>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search