forums

TNT Basic Forums > Programming Q&A
how to do multiplayer?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-23-2006 02:46

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

I've got this here: I want the guest to wait until the variables are set before going to the game setting screen. I 've used the while loop. However, when the host tries to update net data while the guest is in a while loop, the game crashes. is there an alternative way to make the guest wait until the variables are sent?

Procedure LinkWIthNetPlayers(int mode)'mode 1=host, mode 2=join
'sync data before setup screen

if mode=1
int i
for i=0 to 14
set net data numberofthings(i),numberofthings(i)
next
set net data scenariodescription,scenariodescription
set net data mapheight,mapheight
set net data mapwidth,mapwidth
set net data numberofplayers,numberofplayers
print "0"
set net data netupdatedforstart,1
print "1"
update net data
print "2"
end if

if mode=2
while netupdatedforstart=0
wend
print scenariodescription
end if
End Proc

12-23-2006 02:53

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

Never mind, i figured it out... you need to put "update net data" in the while loops in the guest too.

12-23-2006 03:02

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

also... can you go "set net data array[],array[]" instead of
for q=0 to ArrayBoundary
set net data array[q],array[q]
next

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.