[edit]i made a small change to my code
I have started a multiplayer game, and i am trying to set it up to create a shpere for each person in the game and then transmit the location of that sphere to everyone else whos program then updates the location of the sphere, however each time i try to run it, it gets to line 80(the loop command) then says that objects numbers must range from 1 to 65535. Ive attached the code thanks for your help...if you test it, set the ip as your ip so it can create the game...
Rem Setup sync
Sync On
Sync Rate 30
set window on
set window size 640,480
autocam off
perform checklist for net connections
set net connection 3
perform checklist for net sessions
if checklist quantity()<1
create net game "Game","Name",10,1
pl=1
else
join net game 1,"Name"
pl=net player created()
endif
make object sphere pl,50
position object pl,0,0,0
Rem Main loop
Do
aY# = Object angle Y(pl)
perform checklist for net players
for i=1 to checklist quantity()
if object exist(i)=1
ox#=object position x(i)
oz#=object position z(i)
oay#=object angle y(i)
delete object i
make object sphere i,50
position object i,ox#,0,oz#
yrotate object i,oay#
else
make object sphere i,50
position object i,rnd(2000),0,rnd(2000)
endif
next i
Rem Control input for camera
If Upkey()=1 then Move object pl,10
If Leftkey()=1 then Yrotate object pl,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object pl,Wrapvalue(aY#+5)
Rem get player object position and store in X# and Z#
X# = Object position x(pl)
Z# = Object position z(pl)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,100,cZ#
Rem point the camera at the player object
Point camera X#,50,Z#
if memblock exist(1)=1 then delete memblock 1
make memblock 1,8
write memblock float 1,0,X#
write memblock float 1,4,Z#
send net message memblock 0,1
get_message:
get net message
if net message type() = 4
plf = net message player from()
net message memblock 2
plfx# = memblock float(2,0)
plfz# = memblock float(2,4)
endif
position object plf,plfx#,0,plfz#
if net message exists()>0 then goto get_message
Rem Refresh Screen
Sync
Loop