Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Memblocks again ... :)

Author
Message
Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 16:50
I try to sent memblocks but is doesn't work...
my code:

>>>>>>>>>>>>>>>>>>>
X=0:Y=0:Z=0:speed=0


DO

cls
set cursor 0 ,0
print "sending..."
X = X + 1.0
Y = Y + 50.0
Z = Z + 150.0
speed = speed + 21.454

rem // CONTROL

print X
print Y
print Z
print speed

rem // end CONTROL



GuarenteePacket=1
MemblockIndex=1
position=0
make memblock MemblockIndex, 1024

WRITE MEMBLOCK FLOAT MemblockIndex, position, X
print MEMBLOCK FLOAT(MemblockIndex, position): inc position,4

WRITE MEMBLOCK FLOAT MemblockIndex, position, X
print MEMBLOCK FLOAT(MemblockIndex, position): inc position,4

WRITE MEMBLOCK FLOAT MemblockIndex, position, X
print MEMBLOCK FLOAT(MemblockIndex, position): inc position,4

WRITE MEMBLOCK FLOAT MemblockIndex, position, X
print MEMBLOCK FLOAT(MemblockIndex, position): inc position,4


send net message memblock 0, MemblockIndex, GuarenteePacket
if memblock exist(MemblockIndex) then delete memblock MemblockIndex
wait 2000

loop
GCEclipse
17
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 17:13
What happens? Does it crash out? Or is it just not recieved at the other end?

If its crashing out - it's probably best to wait for patch 2. I noticed that a few of the memblock commands are a little unstable.

If its just not recieved at the other end then post the code from the "reciever" program as I think that might be where the problem lies.

Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 17:30
ok here we go:

>>>>>>>>>>>>>
do

get net message
while net message exists()
set cursor 0,0
cls
print "receiving..."
print "to: ",net message player to()
print "from: ",net message player from()
if net message type()=4
memblockindex=1
net message memblock memblockindex
print "memblock size:",get memblock size(memblockindex)
print "data x: ",memblock float(memblockindex, 4)
print "data y: ",memblock float(memblockindex, 8)
print "data z: ",memblock float(memblockindex, 12)
print "data speed: ",memblock float(memblockindex, 16)
sync
delete memblock memblockindex
endif
endwhile

loop
<<<<<<<<<<<<<<<<<<<<

help

Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 17:30
I don't receive anything...

Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 19:15
anoyne have a working example? I'm really confused right now ....

doooooooooooh

GCEclipse
17
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 19:20
A thought - shouldn't that be:

While net message exists()=1

Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 22:42
While net message exists()=1
is the same as
While net message exists()
because 1 is the boolean value for true
and 0 for false
==> while true
do this do that
somewhere in the syntax manual but I still need help dooooooh

waffle
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 24th Sep 2002 22:54
have you tested this with message strings to verify that you have a good network connection ?
the test for a memblock should occur at the same time you test for strings on the recieving end.
Wanja
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Sep 2002 22:58
I tested it with net messages Integer and I also checked for client server availebility my network works fine I think

Login to post a reply

Server time is: 2019-11-12 19:02:05
Your offset time is: 2019-11-12 19:02:05