Howdy, Stranger!

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

Supported by

Failing to update old OS 2.9.7. scripts to OS 3.1+

edited August 2016 in OpenSesame

Hi!

I just wanted to move on from the older Open Sesame version (2.9.7) to the latest version (3.1.) and I figured a good way to start is to check out old scripts that worked flawless on the older OS version and see how they behave on the newest OS.
However, this process does not run very smoothly since I get errors that make little sense to me. For instance:

exception type: TypeError exception message: line() takes exactly 5 arguments (6 given)

...and it refers to this line:
exp.canvas.line(x+d, y, x, y+d, color)

Similarly:
exception type: TypeError exception message: circle() takes exactly 4 arguments (6 given)

referring to line:
exp.display.circle(x, y, size_circle, fill=False, color=stimulus['color'])

Looking in the OS documentation on either the line or circle function tells me that I am using the function correctly.

It is not quite clear what the mistake here can be other than that something has changed from OS 2.9.X to 3.1. Again, I emphasize, running an identical copy of the script in OS 2.9 does not cause any problems.

I am reluctant to start from scratch programming the same experiments by going thru the old code line by line, since some of my scripts are quite dense.

Does anyone have an idea what the problem could be ?
Is there any general change in the workflow of OS experiments, or maybe an overview about all changes in how to handle basic functions (e.g. canvas or inline functions) from the old 2.X compared to the new 3.X OS versions ?

Any help is appreciated! Thanks!
Michel

EDIT:
I should mention that I tested a super-simple version of the same code (i.e. simply drawing a line or circle) using the same style of coding I used in the old scripts with a separate OS 3.1. script. Then I do not receive these errors. So it seems that the code as such is not incorrect. What is happening??

Comments

  • Hi Michel,

    There have been some changes to the API OpenSesame 3, but it should be pretty straightforward to update your script. I actually forgot to include the issue that you're running into here in the list of important changes for v3.

    Essentially, you have to use keyword arguments for all style keywords that are listed here. To avoid confusion: a keyword argument is an argument with an explicit name.

    So this:

    exp.canvas.line(x+d, y, x, y+d, color)
    

    Becomes:

    exp.canvas.line(x+d, y, x, y+d, color=color)
    

    The second error that you mention is probably the same, although the line that you give does not match the error. So a slight mixup there, probably.

    As a side note, it is not necessary to attach objects to the exp object, or to declare them global:

    Does that clear things up?

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited September 2016

    Sounds like a solution. I will check it out and report back if it does not work -- thanks!

    PS: Is there any way to update older posts? I wanted to update the title of this thread to indicate that the problem has been solved, but for some reason I cant modify my earlier post...

  • You can only edit posts for (I believe) an hour after posting them. This is because spambots tend to first post a harmless message to bypass moderators, and then come back to add spamlinks etc.

    In any case, don't worry: we abandoned the system with marking discussions as [solved] because it was too hard to do this consistently.

    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