OH THANKYOUTHANKYOUTHANKYOU.
*ahem* lets scrape the mud off my dignity and try that again,
thanks. that is just what i needed. I havent tryed it out but i (almost) inderstand all of it now and I will at the first avalible time (tomarow afer school???) will impliment it. also I am happy to see that it would be easy for me to add another variable if I needed to.
what i dont understand is why you have the variables set to take up two bits of the memblock. my guess is so that I can have a number over 255 but why TWO bits and what is my number cap now? (still alittle froggy on that point.)
EDIT: nope I get memblock index out of range when after I join and
2ND EDIT: the problem is the negitive numbers. I now add 32767 befor i send it and then take it away before I write it to the variable. HOWEVER!! somthing is wrong and the xangle1 is -21000 to -18000 jumping around like crazy.
host code:
REM Project: net game host
REM Created: 12/5/2007 6:48:31 PM
REM
REM ***** Main Source File *****
REM
if check display mode(1024,768,32)=1
set display mode 1024,768,32
endif
sync on : sync rate 60
set point light 0,0,200,-400
set light range 0,5000
set ambient light 50
load object "turret.x",1
load object "turret barrel.x",2
load object "main ship.x",6
position object 6,0,0,0
clone object 3,1
clone object 4,2
position object 1,3.791,6.9,.029
position object 2,4.047,6.992,.029
position object 3,-3.385,6.979,.029
position object 4,-3.64,6.94,.029
autocam off
position camera 0,6,9,2
rem rotate camera 0,58.280,0,34.906
point camera 0,0,0,0
gamestate = 0
set window on : set window title "HOST"
create net game "fun","mike O'brian",2,1
rem PlayerNumber= default net game("space sim",name$,2,1)
xangle1 = 0
yangle1 = 0
zangle1 = 0
xangle2 = 0
yangle2 = 0
zangle2 = 0
remstart
send net message integer 0,mousex()+(mousey()*640)
ink rgb(255,0,0),0 : circle mousex(),mousey(),15 : ink rgb(0,255,0),0
rem Receive integer and extract mouse position
repeat
position=net message integer() : pn=net message player from()
tmousey(pn)=position/640 : tmousex(pn)=position-(tmousey(pn)*640)
get net message
until net message exists()=0
for pn=1 to 4 : circle tmousex(pn),tmousey(pn),15 : next pn
sync : cls 0
remend
gamestate = 1
remstart
0 = join/host menu
1 = dont know yet
remend
do
remstart
if upkey() = 1 then xangle1 = xangle1 +1
if downkey() = 1 then xangle1 = xangle1 -1
if leftkey() = 1 then zangle1 = zangle1 +1
if rightkey() = 1 then zangle1 = zangle1 -1
remend
if gamestate = 1
get net message
if net message exists() = 1
if net message type() = 4
net message memblock 1
xangle2 = memblock word(1,0) - 32767
endif
endif
endif
set cursor 10,10
print xangle2
rotate object 1,90,zangle2,110
rotate object 2,xangle2,zangle2,110
rotate object 3,90,zangle2,-110
rotate object 4,xangle2,zangle2,-110
sync
loop
and joiner code:
REM Project: net game join
REM Created: 12/7/2007 9:43:42 PM
REM
REM ***** Main Source File *****
REM
if check display mode(1024,768,32)=1
set display mode 1024,768,32
endif
sync on : sync rate 60
set point light 0,0,200,-400
set light range 0,5000
set ambient light 50
load object "turret.x",1
load object "turret barrel.x",2
load object "main ship.x",6
position object 6,0,0,0
clone object 3,1
clone object 4,2
position object 1,3.791,6.9,.029
position object 2,4.047,6.992,.029
position object 3,-3.385,6.979,.029
position object 4,-3.64,6.94,.029
autocam off
position camera 0,6,9,2
rem rotate camera 0,58.280,0,34.906
point camera 0,0,0,0
gamestate = 0
set window on : set window title "JOINER"
rem Join First, Else Host (for best results run as EXECUTABLES)
center text 160,100,"...ATTEMPTING TO JOIN..."
center text 160,120,"[IN DB...HIT ESCAPE TO BYPASS WARNING]" : sync : sync
join net game 1,"fun"
gamestate = 1
remstart
0 = join/host menu
1 = dont know yet
remend
xangle1 = 0
yangle1 = 0
zangle1 = 0
xangle2 = 0
yangle2 = 0
zangle2 = 0
x1 = 0
y1 = 0
z1 = 0
remstart
send net message integer 0,mousex()+(mousey()*640)
ink rgb(255,0,0),0 : circle mousex(),mousey(),15 : ink rgb(0,255,0),0
rem Receive integer and extract mouse position
repeat
position=net message integer() : pn=net message player from()
tmousey(pn)=position/640 : tmousex(pn)=position-(tmousey(pn)*640)
get net message
until net message exists()=0
for pn=1 to 4 : circle tmousex(pn),tmousey(pn),15 : next pn
sync : cls 0
remend
do
if upkey() = 1 then xangle1 = xangle1 +1
if downkey() = 1 then xangle1 = xangle1 -1
if leftkey() = 1 then zangle1 = zangle1 +1
if rightkey() = 1 then zangle1 = zangle1 -1
if memblock exist(1) = 1 then : delete memblock 1
make memblock 1,10
write memblock word 1,0,xangle1 + 32767
write memblock word 1,2,zangle1 + 32767
send net message memblock 2, 1, 1
rotate object 1,90,zangle1,110
rotate object 2,xangle1,zangle1,110
rotate object 3,90,zangle2,-110
rotate object 4,xangle2,zangle2,-110
sync
loop
just replace the file loading to be "make object cube" with a size of like 5 to 20
thanks for the reply
Wild_Doogy