Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Defining an element's location in sketchpad, using an equation?

Hey everyone,

I am trying to define the location of an element in sketchpad, using an equation, and I keep getting an error:

x should be int or float, not some_variable+5


The code:

draw image center=1 file="some_pic.jpg" scale=1 show_if=always x="some_variable+5" y=-401 z_index=0

The reason seems to be that OpenSesame adds "" to the code, after my edit (I entered: x=4+5, without "").


Does anyone has an idea how to make this work?

Comments

  • Hi,

    There is a way to make it work the way it is supposed to work (similar to your approach), but I don't remember what exactly it was. An alternative to bypass the problem is to precompute the value and only then change the coordinates.


    See the attached example. Does that help?

    Eduard

  • Thank you!

    It works.

    I would prefer to find a solution without an inline script, since some of my lab members are unfamiliar with programing.

  • I see what you mean, but does it really matter? One way or another you would have to code something that other users shouldn't change. No?

  • Usually you are right, but in this case the objective is to incorporate a script in all the experiments in our lab, and have the lab members be able to call its result without having to code.

    It's a calibration script for stereoscopic display of stimuli on VR headsets - the script manipulates some user input, and its results should be added to the location of every visual element in those experiments.

  • Sorry, but I fail to see why this makes the sketchpad solution better than the inline script. If lab members will not need to change anything, they won't do so either way. If they have change things, they also have to do so either way. In fact, I'd personally say the inline syntax is more understandable than whatever the code would be in a sketchpad.

    They only real disadvantage that I see using the inline_script is that you have to use another item, so that you have to be aware of the structure of an experiment and how the items in it interact to make it right.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games