Howdy, Stranger!

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

Supported by

Newbie questions: Variables, Positions, Scripts, Forum

Hi all, I am completely new to Open Sesame and in my first 30 min of it, I ran into several dead ends. Maybe someone could help me.


1

I would like to use variable in my scripts. Just easy stuff like setting the width of several objects to the same variable. So I don't think this is what you'd call an experimental variable that potentially changes with every loop or trial, I just want to make my scripts more efficient and easy to adapt by using in-script variables.

According to [1] this should work kinda like this:

exp.set('wi', 300)

draw rect color="#e6e6e6" fill=1 h=200 penwidth=0 show_if=always w=self.get("wi") x=-330 y=-267 z_index=0

But I am told that the width self.get(wi) is unknown or variably defined. Why does this not work?


2

When I change the script and then change anything in the GUI, my entire script is overwritten. How can I prevent that from happening?


3

Is there a way to define the positions of objects by their center instead of their upper left corner?


4

Why can't I more easily search for posts in a specific forum on this site? Do I really have to type

site: https://forum.cogsci.nl/index.php?p=/categories/opensesame

into a google search window in order to search the forum? I'm sure there is a better way :)


Thanks and all the best,

Jens


[1]

https://osdoc.cogsci.nl/2.9.3/usage/variables-and-conditional-statements/#getting-and-setting-variables-in-inline_script-items

Comments

  • Additional comment on 1:

    Also exp.set('wi', '300') does not work.


    5

    Is it intended behavior that whitespace and brackets are not parsed the way they would be in Python?

    x=-260 -100 does not work

    x=-260-100 works

    x= -260-100 does not work

    x=-(260-100) does not work


    6

    Do others also have the problem that not all actions are revertible with the Undo option? Sometimes, steps are missing for me.

  • Hi Jens,

    I would recommend you take a step back and familiarize yourself with the software (for example via the tutorial: https://osdoc.cogsci.nl/3.2/tutorials/beginner/)

    Most of your problems are related to the fact that you are mixing Openseame internal syntax (draw rect color="#e6e6e6" fill=1...) with python code (exp.set()). They don't work together. You either do one or the other in a single window (depending on which you activate).

    From what I understand, I think you want to use Python code. To do so, I recommend you put your code into inline_scripts which are items in which you can use regular Python scripting. If you get a feel for that, your others problems will solve accordingly. For example, defining objects based on their center can be done in python (depending on what object you want: https://osdoc.cogsci.nl/3.2/manual/python/canvas/).

    You can search on the forum. On the top left, there is a search window.

    More generally, what do you want to accomplish, I am a bit confused by the commands you used.


    Eduard

    Buy Me A Coffee

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