Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 4 of 4

Thread: Placing an Image in a Random location from a set of possible locations?

  1. #1

    Placing an Image in a Random location from a set of possible locations?

    I want an image to appear in one of several pre-mediated positions. (positions that are an equal distance from a place of focus)

    So I want to place the image in a random place, amongst a selection.

    however, 'loc' requires that x and y coordinates are entered seperately.
    I tried using the rand function for a selection of x,y values, looking like this:


    But that did not work.

    Will I have to make a different stimulus for every different position, and then randomly cycle through the stimuli? considering that multiple combinations of images must appear on each trial, this is looking impractical?

    surely there is a way to place objects in a random position out of a selection? It says that the rand() function can be used to place objects in random places, but there is no other information available on this topic?

  2. #2
    My second Location problem involves placing an object in the same place as another object.

    So, say object 1 appears at x,y (a randomly generated position), and I want object 2 to appear at the same place,

    how do I tell it to use the same position as was used before?

  3. #3
    Join Date
    Mar 2009
    * Note that the features below have been added to DirectRT v2010 (including the beta) and are not active in v2008 and prior versions. For a related solution for use in v2006 and subsequent versions, see http://www.empirisoft.com/support/showthread.php?t=4734


    The functionality of the 'rand()' feature is now extended. As you've noted, the following syntax does not work: rand((x,y),(x2,y2),(x3,y3)),1
    This error arises due to the fact that the software can't quite figure out how to split the values up. The software would parse the above text normally by using the comma as an identifier. If the software were to do so in a scenario for the input you've provided, you would split up the above choices in the following way: '(x' , 'y)' , '(x2' , 'y2)' , '(x3' , 'y3)' - This wouldn't be too helpful.

    To remedy this problem, I've made it so that commas you don't want parsed can be identified by using the following: '' (not ")
    For example, you would be able to present the desired syntax above as: rand((x''y),(x2''y2),(x3''y3)),1 - rather than - rand((x,y),(x2,y2),(x3,y3)),1

    Next, I worked on the second issue. Your second issue noted that you want to be able to use the same rand() values that have previously been generated. This can now be done by using the new 'write' and 'read' syntax. Let's say you have the following: rand(1,2,3,4)
    If you want the result of this operation stored, simply write something such as: rand(write:Capulet|1,2,3,4)

    The value 'Capulet' is a variable that you've created. This variable can have any name. The above function selects a random value out of the four listed above, and then writes that value to both the experiment and the variable 'Capulet'. The variable 'Capulet' can be re-read at any time by using the following syntax: rand(read:Capulet) . Rather than creating a new random value, this will simply make a pointer to our variable 'Capulet' and use the value that is stored within. Both read and write values can be located anywhere within the spreadsheet. You can read a variable even if it's located further down in the experiment.

    Please let me know if you have any additional questions or if I can help in any way.
    Last edited by jarvis24; 03-24-2010 at 06:09 AM.

  4. #4
    Join Date
    Feb 2013
    Please note that these features are not active in any version of DirectRT.
    Jason Reed
    Empirisoft Software Support Specialist

Similar Threads

  1. How do I set an image as a background?
    By scienceisbeauty in forum DirectRT Older Versions: General Questions
    Replies: 1
    Last Post: 06-10-2008, 03:29 PM
  2. Set a time for background image to appear?
    By Erin2007 in forum MediaLab Older Versions: General Questions
    Replies: 1
    Last Post: 09-27-2007, 03:32 PM
  3. Placing one image on top of another
    By jarvis24 in forum DirectRT Older Versions: Troubleshooting
    Replies: 1
    Last Post: 04-30-2007, 05:57 AM
  4. Random location without replacement?
    By jarvis24 in forum DirectRT Older Versions: How Do I...
    Replies: 1
    Last Post: 10-28-2006, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts