Nothing works properly...

So I’ve had this problem in the logic editor of blender v2.73a for months, and I’m on the verge of giving up in frustration:

I’ve tried using keyboard sensors, mouse sensors and message sensors to detect player input. but none of them seem to work.
keyboard sensors never detect a key press, unless I manually enter which key into the ‘key’ field, in which case when I run the game engine, it continuously detects the key even though I am not pressing it!

Message sensors have the same problem. I set up two objects; one with a mouse over and mouse click sensor connected to an ‘and’ controller, connected to the message actuator, which references the other object in the ‘to’ field, and the message to send in the subject field. The other object with a message sensor. When the message is received the system console is supposed to print “Received message”. I run the game, get no errors, click the object which has the mouse sensors and…
nothing in the console.

but if I manually enter the message into the message sensor’s subject field, and re-run the game, the system console prints “Received message” instantly, even though I haven’t clicked on the object yet.

Dose anyone know why this is happening?

I had similar problem with buttons, maybe a bit different, but that’s fault of my awful graphics card, I think. Just, in my game 6th gear sometimes sensors work wrong(keyboard), I can’t press ESC to open exit options or F12 to close imediately, steering with A and D doesn’t work too. Maybe someone can confirm so that’s bug of GPU?

No problem about using the game engine should take you more than 1 day of work. Always ask for help right away.
Also, try always to give an example blend or a picture of relevant logic set up.

Blender 2,73a was released just few days ago, lol:D

Blend file:



import bge




cont = bge.logic.getCurrentController()
own = cont.owner


sens = own.sensors['get mess']


if sens.positive:
    mess = sens.subject


    if mess == "clicked":
        #help(sens)
        print ("Received message:" ,sens.bodies )


If you know this much python why don’t you just do it with python?
In python you can just store a message in a global variable/dict/list for all scripts to be able to access.

Sensor.subject is (filter) for incoming messages, not received message.
You can filter ‘clicked’ messages. Empty subject means no filtering, all messages raise positive flag.
from python api: sensor.subjects (The list of message subjects received. (read-only).) if you really need know,
what messages say.
Here is corrected blend too

Attachments

Message_Actuator_Test_corrected.blend (80.4 KB)

Indeed KX_NetworkMessageSensor.subject is configuration (as set up in the GUI).
You need to check KX_NetworkMessageSensor.subjects to get the sensor’s results.