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




Threaded View
Threaded View
peter - 4 Years Ago
Dave - 4 Years Ago
peter - 4 Years Ago
Dave - 4 Years Ago
peter - 4 Years Ago
                         > basically I need the to branch to three different trials based on...
Dave - 4 Years Ago
                             sorry yes i see my error. But end or start, trial.choice only does one...
peter - 4 Years Ago
                                 Why does that require a large matrix? Seems to me you can simply...
Dave - 4 Years Ago
                                     good point, i will look at your code and get my head around it big...
peter - 4 Years Ago
                                         yes that looks like all the eliments are there . thanks again
peter - 4 Years Ago
                                             FYI, I've cleaned up the example code some. Updated code is in edited...
Dave - 4 Years Ago
                                             hi, i am almost getting this to work now, your script contained much...
peter - 4 Years Ago
                                                 Once again: Please provide code that can actually be run and examined....
Dave - 4 Years Ago
                                                     ok apologies <port Trial_start_signal> / port = LPT3 / subport...
peter - 4 Years Ago
                                                         Please don't paste entire scripts into a post's body and if a script...
Dave - 4 Years Ago
                                                             no worries
peter - 4 Years Ago
                                                                 <expressions> ... / distance = sqrt((trial. choice .responsex -...
Dave - 4 Years Ago
                                                                     Arrrr i see i was assuming it was the in trial coding that was wrong...
peter - 4 Years Ago
                                                                         > i was assuming it was the in trial coding that was wrong That is...
Dave - 4 Years Ago
peter - 4 Years Ago
peter - 4 Years Ago
Dave - 4 Years Ago
peter - 4 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search