directx controls through pygame

This forum is currently in read-only mode.
  • very basic example, more of a proof of concept

    here it is being used to control a behavior

    download pygame from here: http://www.pygame.org/download.shtml

    and copy the pygame folder to the python directory of construct

    http://dl.dropbox.com/u/1013446/pyjoy/pyjoy.cap

    also, for anyone wondering, if you have a 360 controller, they're still dx compatible so you can still test this cap. if it moves at all, it's using directx input

  • Very nice, thanks Lucid.

  • what am I doing wrong?

    <img src="http://i1.imageban.ru/out/2010/09/02/7df8980e1e89736ab6d03664f3211704.jpg">

  • Nice example Lucid, clean and simple.

    In regards to the error.. If you are trying to run it as an exe then follow this guide:

    -------------------------------------

    As far as getting PyGame to work with Construct just use this:

    http://www.box.net/shared/kcoxzzt7bz

    This has the dependencies for Pygame. You will need to unzip the contents of the Library.zip file into your Construct/Data/Python directory. You will need to check all of the .pyc files per the quickguide, but you can skip PodSixnet and other unrelated .pyc files. The other dependencies (modules.zip) have to be redistributed with your game. Now you don't need ALL of those, but it will be up to you to decide which ones you need based on which parts of Pygame you use!

    ---------------------------------------------------------

    Also, make sure you are using .99.93. (from your screenshot looks like 94) so you should be good.

  • EDIT: Nevermind i just needed to init the display module as well, since the "event queue" is used. Trial and error, a part of learning lol

    This works for me but it looks like it inits the entire Pygame library... it's my understanding that this isn't necessary, but i can't seem to make it just init the joystick module. I checked the pygame documentation, but the methods they provide to import and init pygame and it's modules don't work...

    for example, you did this to import:

    from pygame import*; 
    [/code:1atoszdw]
    but the documentation says to do this, and also says for some reason that the first line is the only necessary one.
    [code:1atoszdw]
    import pygame
    from pygame.locals import *
    [/code:1atoszdw]
    which throws an error.  And replacing your init() with joystick.init() doesn't work, but shouldn't it?  The inconsistencies are confusing me, help please?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I wonder...

    PyGame is a wrapper to sdl. sdl is written in c, fully supported in c++, and open source. I found that the joystick support is just on file with a few headers: http://hg.libsdl.org/SDL/file/0972c2893e68/src/joystick/win32/SDL_dxjoystick.c

    We have a few ambitious c/c++ programmers in the community. I don't have much knowledge of actual development with c++, but wouldn't it be possible (without months of 16h per day work) to pack this to a plugin?

  • I don't have much knowledge of actual development with c++, but wouldn't it be possible (without months of 16h per day work) to pack this to a plugin?

    Sounds very doable. I think somebody mentioned they were working on a joystick plugin last week. Hopefully they are using that SDL connection.

  • Sounds very doable. I think somebody mentioned they were working on a joystick plugin last week. Hopefully they are using that SDL connection.

    I'm building a joystick plugin but it will be more like an "Input System" with Keyboard+Mouse+Joystick all managed through directX. So, i've merged "Keyboard & Mouse" plugin actions/conditions/expressions to my "Input System" and I've added an "Arm" feature like in the "Custom Controls" plugin by Lucid.

    The coding is at 50% finished and it works well with my Cyborg EVO, Xbox 360 pad and my Thrustmaster Racing Wheel. Force Feedback may be included in the plugin...

    By the way, I'm using the Win32 part of OIS (http://sourceforge.net/projects/wgois/).

  • I'm building a joystick plugin but it will be more like an "Input System" with Keyboard+Mouse+Joystick all managed through directX.

    I love you.

    Any suport for runtime input configuration and getting joystick's hardware name string? 'Cause I'd love that.

  • Any suport for runtime input configuration and getting joystick's hardware name string? 'Cause I'd love that.

    Yes, both already done. These were some of the main reasons I'm doing the plugin

  • :')

    I'm in tears man. Thanks for that. It's just perfect.

    Dual stick games, here I come!

  • Can you modify the controls of the built in behaviors with this? Or do you have to use custom movement/use events to control movement

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)