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.

Author
Message
Wu dynasty
13
Years of Service
User Offline
Joined: 7th Feb 2013
Location: In a democracy
Posted: 21st Feb 2013 17:15
Hey guys, I am looking to integrate this into my next game. I am looking for a way to keep all of the previously sent messages on the screen. Also can you do this online and not just locally.
THIS IS NOT ORIGINAL OR MINE. I AM JUST MODIFYING IT AND NOT CLAIMING CREDIT FOR IT.


Rem THIS IS NOT ORIGINAL OR MINE. I HAVE JUST MODIFIED IT.
set window on;set display mode 640,480,32;sync on : sync rate 60;PlayerNumber=default net game("gamename","playername",2,1)
if net game exists()=1
if PlayerNumber=1 then set window title "HOST Player "+str$(PlayerNumber);if PlayerNumber=2 then set window title "CLIENT Player "+str$(PlayerNumber)
dim TXT_DATA$(2) as string
do
get net message
if net message type()=3 then TXT_DATA$(2) = net message string$();get net message;cls 0
text 10,40,"[player2]: " + (TXT_DATA$(2))
text 10,20,"Me: " + (TXT_DATA$(1))
if returnkey() > 0 then inc tog,1; wait 200
if tog > 2 then tog = 0
if tog = 1 then text 20,0,"you say > ";input " "; TXT_DATA$(1): cls 0
if tog = 2then send net message string 0,(TXT_DATA$(1));inc tog,1
sync : if escapekey()=1 then exit
loop
free net game
else
do : cls 0 : center text 160,113,"COULD NOT CREATED NET GAME" : sync : loop
endif

You are entering the Wu Dynasty. Boomshakalaka
-Nathan
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 21st Feb 2013 18:36
Where are the previously sent messages? They are in the TXT_DATA$(1) array.

If you are familiar with the documentation, you will find queue commands useful here.

On a basic level, replacing text commands with print commands and literal indexes with variable indexes supplied by a loop would suffice.

You should know how to loop from the first to last array item, each of these get printed individually in sequence.

Gameboy Xx_xX
13
Years of Service
User Offline
Joined: 16th Mar 2013
Location: My ***
Posted: 18th Mar 2013 23:56
someone plz tell me what id darkbasic thingy???[quote]remember u dont kno anything
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Mar 2013 01:15
You can post code snippets like this:

[code[/b]]Put your code here[/code[b]]

That puts them in a nice box like this and makes the code much easier to read:


Login to post a reply

Server time is: 2026-07-07 02:38:54
Your offset time is: 2026-07-07 02:38:54