Millisecond Forums

Combining shapes into one object

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

By piotr_styrkowiec - 12/26/2014

How to combine many shapes in one object without listing them all in the trial stimulustimes attribute?This is I have 6 lines (thin rectangles; 3 vertical, 3 horizontal) and these lines create a grid when put together.So in every trial when I want this grid to be presented on the screen I need to write something like this:
/ stimulustimes = [1=line_1, line_2, line_3, line_4 line_5, line_6; 500=......]
Is there a possibility to combine these lines into one object 'grid' so I can put in every trial just this one element?
like this:
/ stimulustimes = [1= grid; 500=.....]

And something perhaps related: how to create list of shapes?
Will be very grateful for help.
Piotr
By Dave - 12/28/2014

No, you cannot combine <shape>s (or other stimuli) into a single object. <list> elements wouldn't help here either. Every object you want to have displayed by a <trial> must be in its /stimulustimes or -frames.

To make a <list> of shape elements, you do

<list shapelist>
/ items = (shape.a, shape.b, shape.c, ...)
...
</list>

<shape a>
...
</shape>
...
<shape c>
...
</shape>
...

as you would for any other stimulus element
By Dave - 12/28/2014

What you can do is insert the stimuli in question into the trial's frames once at the beginning of the <expt> or <block>:

<block myblock>
/ onblockbegin = [trial.mytrial.setstimulustime(shape.h,0); trial.mytrial.insertstimulustime(shape.v,0)]
/ trials = [1-4=mytrial]
</block>

<trial mytrial>
/ stimulustimes = [500=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("A", "B", "C", "D")
</text>

<shape h>
/ shape = rectangle
/ size = (50%, 2px)
</shape>

<shape v>
/ shape = rectangle
/ size = (2px, 50%)
</shape>

They will persist as long as you don't call resetstimulusframes().
By piotr_styrkowiec - 12/29/2014

Thank you for your help.
Will try to do what you suggest.
Piotr