Message Receiver with if statements based on message bodies

message sender, using logic, and receiver using python


MessageCounterWithBodies.blend (441 KB)

And with multiple messages in 1 frame

W-send 2 messages

Sender=Keypress w - sends message “Test1” and “Test2”

Reciever-> does for items in message.bodies:
if item=“Test1”: own[‘Counter’]=own[‘Counter’]+1
if item=“Test2”: own[‘Counter’]=own[‘counter’]+10

So w adds 11 to counter, sending test 1, and test 2 in a frame

S adds 10 sends onlt “test2”


MessageCounterMultiMessages.blend (455 KB)

A description what is is supposed to do would be nice