logic works with keyboard but not with joystick

Hi all,

Im facing a very wierd problem here. I have a situation where the very same logic works if I use keyboard sensors but does not work if I use joystick sensors.

What I have is a button that suspends the scene and adds an overlay scene. In this overlay scene I have a button that remove itself (the scene) and resumes the scene that was suspended.

Its for an alert message

It works just fine with keyboards… but with joystick the scene will never wake up again.

The blend files can be found here. Its a very small and simple example: http://pirex.com.br/sceneTest.zip

Is it a bug??

cheers

Leo,

ps - Ive actually tried many work-arounds and couldnt get anything to work! I got really weird results allways actually… So… any workaround is very welcome!

hello, just add a value to the thresh hold think, on the joystick controller. you need at least 500 it can be as high as 3500.

Edit: I was wrong about the cause of the problem in this post. Please read my next post to see the actual problem.
Reason for double post: In case anyone had read my initial (incorrect) conclusion, they would not know that I had edited this post.

Leo,

I did extensive testing and tried every workaround imaginable on your file. It took me quite a while to actually isolate the problem, but now that I have figured out what is going on, I think that as long as you use “Suspend Scene” and “Resume Scene” there is not a possible workaround.

All of my testing has shown that the joystick sensor is not properly resuming itself, which is a rather serious bug. It works fine until the “Resume Scene” actuator is called, at which point all joystick sensors in all scenes and all objects stop handling input. It doesn’t matter what sensor calls the “Resume Scene” actuator, the joystick always stops responding. All other sensors continue to function properly, no matter what method of resuming the scene was used (joystick, keyboard, mouse, etc.).

I will report this on the bug tracker, and I will also notify Ben, since he is doing the bulk of the bug fixing right now. Hopefully this can be fixed before the upcoming Blender 2.46 release.

-blendenzo

BTW, if you absolutely need a Pause or Suspend functionality, you can do it without the “Suspend Scene” actuator. Use a Message Actuator to send a message with the subject “Suspend” to all objects, then give each object that needs to be paused a Message Sensor to receive the message. Use a Boolean property named “paused” on each object, and set it to “True” when the “Suspend” message is received. Instead of sending your joystick sensors and other input through an AND Controller, use an Expression Controller and set it to “paused == False”. Send another message with the subject “Resume” when you want to resume the game, and make the objects change the value of their paused property to “False” when they receive it.

It seems I was a bit wrong on this one. The problem is that the Joystick Sensor stops functioning when an overlay scene is removed. This bug was first identified by Herman Tulleken in Blender 2.42a, but it hasn’t been fixed yet because we did not have many ambitious coders at that time.

Unfortunately, this bug will probably be even harder to work around than the other.

Hi blendezo,

thank you so much for you attention on this.

Actually before I post this I have tried to do it without suspending/resuming the scene, using messages as you said. But I decided to send only the simple example otherwise my post would be rather confusing.

Doesnt matter if you suspend the scene or not. The moment you remove an overlay scene the joystick stops working. (while the overlay scene is on the top it works fine…)

Guess Ill have to change the scene instead of adding an overlay for the moment.

Tks for the bug report… hope its fixed soon!

cheers

Leo,

Ive found a workaround…

not perfect but…

If you Restart the scene after you removed the overlay scene, the joystick works again!

Leo,

I have identified the problem and fixed it.
See bug report for details: http://projects.blender.org/tracker/index.php?func=detail&aid=4839&group_id=9&atid=306

Many "thank you"s, Ben. I, like many others. appreciate all the work you’ve done to get things fixed for Blender 2.46. I’m sure it will be a great help to many to finally have this bug dealt with.