i am working through totter333’s networked game tutorial on youtube (https://www.youtube.com/watch?v=A-OY1h_iPl4), and i am running the following code in his example file
import bge
cont = bge.logic.getCurrentController()
owner = cont.owner
if cont.sensors['run'].positive:
connection, ping, players = bge.network.run()
owner['ping'] = ping
owner['players'] = players
owner['connection'] = connection
i get the following error:
File "run network.py", line 5, in <module>
connection, ping,players = bge.network.run()
ValueError: too many values to unpack (expected 3)
i googled this error and found nothing specific to blender, but lots of stuff about python generally where people needed to “split” something, usually by adding .split(",") to the end of an input string. so i gave that try, changing line 5 of the code to:
connection, ping, players = bge.network.run().split(",")
but then i got this error:
File "run network.py", line 5, in <module>
connection, ping,players = bge.network.run()
AttributeError: 'tuple' object has no attribute 'split'
any help here? if it matters, i’m running mac os x with python 3.4, but totter333 assumes you have python 3.2.
(sorry i didn’t contact totter333 directly but i couldn’t find an e-mail address)