try this:
perform checklist for net connections
sleep 50
box 0,0,screen width(),screen height(),rgb(10,100,20),rgb(10,500,20),rgb(10,100,20),rgb(10,500,20)
nettotal=checklist quantity()
for a=1 to nettotal
if checklist string$(a)="Internet TCP/IP Connection For DirectPlay" then netsel=a
next a
print "Your ip address is: ";get ip address$()
input "Input your or ip you are trying to join or your ip if hosting: ";add$
cls
set net connection netsel,add$
perform checklist for net sessions
if checklist quantity()<1 then game$="None" : goto nogame
game$=checklist string$(1)
join:
join net game 1,"Twokala"
goto game
return
game:
sync on
sync rate 60
hide mouse
make object sphere 1,50
make object sphere 2,50
make matrix 1,1000,1000,20,20
`=================================================================
`=================================================================
`=================================================================
`=================================================================
make memblock 1, 8
make memblock 2, 8
do
write memblock float 1, 0, object position x(1)
write memblock float 1, 4, object position z(1)
send net message memblock 0, 1
get net message
if net message exists()
net message memblock 2
posx=read memblock float(2, 0)
posz=read memblock float(2, 4)
endif
`=================================================================
`=================================================================
`=================================================================
`=================================================================
position object 2,posx,0,posz
set camera to follow object position x(1),object position y(1),object position z(1),object angle y(1),200,150,200,0
if upkey()=1 then move object 1,2
if downkey()=1 then move object 1,-2
if leftkey()=1 then move object left 1,2
if rightkey()=1 then move object right 1,2
cy#=wrapvalue(cy#+mousemovex()*0.08)
acy#=curveangle(cy#,acy#,1)
yrotate object 1,acy#
sync
loop
return
nogame:
create net game "Mage","Delko",8,1
goto game
return
sync
Everything I changed is in between the commented area.
I took out the 'perform checklist for net players' if you need it, you shouldn't do it every frame. instead do it about every 15-20frames or more. Also, the way you were sending and receiving messages was VERY slow, you had 3 sleep commands EVERY frame, and on top of that you were sending and receiving 3 messages every frame. So I changed it to have NO sleep commands, and it sends and recieves only one message every frame.
Hope that helps.
Available for programming position using DBPro.
Also, good at multiplayer coding, contact at:
laptop5002@hotmail.com