New Python-Ogre project + OIS question

bharling

08-04-2007 12:38:15

Hi all,

I just converted my old pyOgre project to Python-Ogre which was a pleasant enough experience, and one I managed to complete in only a few hours. The main bottleneck was upgrading to OIS from ogre's input system.

It is loosely based on this classic shareware game, and my intention is to do a vaguely similar remake in 3d, but with some new features.

Ye ScreenShots:





So what I have so far is:
Large-scale landscapes created with L3DT, sadly not optimized yet (anyone know how to use PLSM?)

Player character who can run about, shoot and jump. Jump skill can improve with practice, gaining new flip moves and much higher jumps.

Some enemies, consisting of soldiers, b52's, robots (standard ogre ones) and some blackhawk choppers. All have a very basic AI at the moment. Animation system is working nicely though, and easy to expand.

Scenery, plants and simple buildings.

My own custom collision detection (Not Very Great), using octrees.

So, on to my question:
How do you detect a Key-UP is OIS? I've got the keydowns working fine, but my jump system is now broken because it relies on keyUp to play the right animation.

any help or T&C's welcomed :)

Note: This is really a very part-time project. I hadn't worked on it for ages until i decided to update it to Python-Ogre yesterday. A nice framerate improvement and much prettier shadows have helped my enthusiasm though

andy

08-04-2007 14:19:39

First off -- very cool to see this being done with Python-Ogre... Thanks for showing it to us..
How do you detect a Key-UP is OIS? I've got the keydowns working fine, but my jump system is now broken because it relies on keyUp to play the right animation.
You can register a keyboard listener and track the keyreleased event..
self.Keyboard.setEventCallback(KeyListenerClass)
....
def keyPressed( self, arg ):
...
def keyReleased( self, arg ):
...

Check the CEGUI_Framework in the OgreNewt demos for an idea on how this is done..

Cheers
Andy

bharling

08-04-2007 18:42:04

Aha, thanks I will try that out. Having looked through my old source (which I can only just remember writing now) it seems like I had a similar setup before.

And thanks to you again for doing the python-ogre thing for us! All in all I was pleasantly surprised how easy it was to change over to the new system.
In fact the only real trouble I had was with the new version of Stani's Python Editor (i was doing a complete python overhaul on my system). Dont know if anyone else has this problem (probably wrong forum for this) but SPE just will not run any scripts for me since updating to the SVN version. The only way I can get it to execute anything is in the terminal window, which is a real shame because when it works its a cracking IDE.