Putting cubes in a type

Blitz3D Forums/Blitz3D Programming/Putting cubes in a type

AngelOnFira(Posted 2014) [#1]
Basically I have a server and when players join, their ip and username is added to a type. A cube is also created (createcube()) to represent them. That cube is also linked to them. So the code looks like this so far;

;...Player joins
newplayer.playertype=new playertype
newplayer\ip=UDPMsgIp(streamname)
newplayer\ip=UDPMsgPort(streamname)
newplayer\cube=CreateCube()


My problem is that the cube dosent seem to be linked just to that type, and when I go to a specific player in the type, it seems that the cube is not unique to them, and that it will just move one cube no matter whose it is. Are you even able to link meshs/cubes and stuff like that to a type?


Kryzon(Posted 2014) [#2]
Use DebugLog to print the integer handle of the cube being moved so that you know if it's the same cube or not.

It could be any of several problems, and we can't help you without the entire code.
Based on your description, you could be making a mistake and always moving the same cube from the same type, or you could be moving different cubes but visually it may look like they are a single one because they are on the same location etc.


Who was John Galt?(Posted 2014) [#3]
The code you have there looks fine. Are you overwriting newplayer every time someone joins? Is the field 'cube' of the correct data type?