Is anyone able to explain what I am doing wrong here, I'm trying to send the player position as messages but the client is positioning the object about 6 seconds late, I don't know what I'm doing wrong.
Host:
`Setup a new game
cls
`Setup new game
net host 8
set camera view 0,0,screen width(),450
gosub player_setup
do
line 0,450,screen width(),450
`Look for players
if net player connected(x)=0
for x =1 to 4
if net player connected(x)=1
text 0,30,"Player connected"
endif
next x
endif
new = net player joined()
`Tank controls
gosub controls
`Send tank coordinates
xpos = object position x(1)
zpos = object position z(1)
net put int xpos
net put int zpos
net send all
sync
loop
Join:
cls
net connect "89.234.101.90"
input "Name: ",playername$
cls
`Setup game
set camera view 0,0,screen width(),450
gosub player_setup
`Setup game
do
line 0,450,screen width(),450
if net connected()=0
text 0,25,"Connection has been lost or wasn't there"
else
text 0,25,"Connection to player esablished"
endif
`Recieve messages
if net get message()
xpos = net get int()
zpos = net get int()
print "Xpos: "+str$(xpos)
print "Zpos: "+str$(zpos)
endif
position object 1,xpos,0,zpos
set camera to follow object position x(1),object position y(1),object position z(1),0,8,4,50,1
sync
loop
Don't look behind you.