Howdy, Stranger!

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

Supported by

[open] Joystick programming & inline script writing

edited April 2015 in OpenSesame

Hi

I am hoping to use Open Sesame for an upcoming experiment, but I nor anyone else in my team has even the slightest knowledge of coding/script writing.

I want Open Sesame to show a video and record a joystick movement response (the direction, speed and extent of the towards/away movement) simultaneously. There will then be a keyboard yes/no response time task before the next video is shown.
I have used the GUI to present the video and record the keyboard yes/no response times but I believe in order to make the joystick work, it requires an inline script item to be included after the joystick item (this is what I have read on previous forums).

As you can probably tell, I have no experience whatsoever in the area of computer programming so don't even know where to begin with this... I get to the stage of inserting an inline script item using the GUI and then get stuck. Consequently I have no script to show you!

I realise this is a big ask but any help would be fantastic!

Thank you!

Comments

  • edited 4:04PM

    Hey Helen,

    Unfortunately, I have myself not much experience which joysticks. So, I can give you only some very general advice. First of all, in case you haven't seen it yet, here you can find some information how to deal with joysticks in an inline_script.

    A way you could start is inserting the joystick plug-in in the beginning of your experiment, followed by placing an inline_script right after your video. There you can refer to the joystick by calling exp.joystick. The best way to learn using it, is playing around with it. So, have a look on the functions that are described in the documentation and check out what they are doing (you can print their return values to the debug window). For example, I could imagine that based on this function, you can compute direction and speed rather easily.

    I hope this was of any help.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 4:04PM

    Hi Helena,

    This sounds like an approach-avoidance task, am I right?

    I want Open Sesame to show a video and record a joystick movement response (the direction, speed and extent of the towards/away movement) simultaneously.

    You can use the media_player_vlc plug-in for video playback, and use its inline-script field to interact with the joystick. For example, this piece of script, when entered into the media_player_vlc will check whether a joystick button is pressed, and stop playback when this is the case:

    b, t = self.experiment.joystick.get_joybutton(timeout=0)
    if b is not None:
        continue_playback = False
    

    For a full list of joystick functions, see:

    To make this script work, you need to add a joystick plug-in somewhere in your experiment to initialize the joystick. And you need to set 'Call custom code' to 'on every frame' in the media_player_vlc plug-in.

    So, in general, this is how you interact with the joystick. To get a more specific answer, you need to specify in detail what kind of information you want to have. The direction of which movement? Because the joystick can be moved multiple times. Which speed? The average speed, the top speed, the speed of the first movements, etc.? So first you need to be very specific about what information you want to log, and from there you (with some help perhaps) can build a simple script like the one above.

    Cheers and good luck!
    Sebastiaan

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