forums

TNT Basic Forums > Programming Q&A
message box
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-10-2001 16:55

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

Is there any way to create a message box? Or some other way for the user to enter text then display it on the screen. I'm trying to make a multiplayer rpg and so far i figured out how to do everything except that. I need to find a way to have the players communicate with each other.Any ideas?

12-10-2001 20:01

Posted by:
ERaZer

Click Here to Email ERaZer   Find more posts by ERaZer

Well...

You could make it so that if the user presses tab(or return) a | comes up on the bottom of the screen and it takes over the keyboard so that if you press "a" an "a" comes up after it and when you press return the whole message is said by the player. It wouldn't be too hard... Did you understand?

BTW, I would like to have a look at that code.

12-11-2001 00:55

Posted by:
Mark Tully

Find more posts by Mark Tully

Our keyboard input support is currently limited to testing if a key is held down. It is possible to enter a string of text by testing all allowed keys to see if they are being pressed and then putting the appropriate letter on screen.

This is quite clearly not the best solution, string input is one of the things we want to improve in TNT Basic, it would make doing high score tables easier too!

It's on our todo list, but I can't say how long it will be until we get around to it, hopefully not too long!

Thanks for your interest!

12-11-2001 10:37

Posted by:

Find more posts by

Thanks for the idea ERaZer but i think i'll just wait for better keyboard input support.

I'd let you have a look at my code if i had something worth showing yet. I said i figured out how to do everything but so far i only completed the scrolling, sprite animation, partial sprite collsion, music, some sound effects, and the menu system(the buttons pulse like in OSX :-)).

I have another question though. Yesterday I started putting in all my network code but "Host Net Game/Join Net Game" aren't working. Hieroglyph says it is an Illegal Procedure Call, but I dont have it as a procedure. I thought my problem might be that i didn't initialise networking but i did that and it stil didn't work.

12-11-2001 10:37

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

Thanks for the idea ERaZer but i think i'll just wait for better keyboard input support.

I'd let you have a look at my code if i had something worth showing yet. I said i figured out how to do everything but so far i only completed the scrolling, sprite animation, partial sprite collsion, music, some sound effects, and the menu system(the buttons pulse like in OSX :-)).

I have another question though. Yesterday I started putting in all my network code but "Host Net Game/Join Net Game" aren't working. Hieroglyph says it is an Illegal Procedure Call, but I dont have it as a procedure. I thought my problem might be that i didn't initialise networking but i did that and it stil didn't work.

12-11-2001 10:38

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

woops

accidently pressed the submit buton twice, sorry about that

12-11-2001 10:39

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

Thanks for the idea ERaZer but i think i'll just wait for better keyboard input support.

I'd let you have a look at my code if i had something worth showing yet. I said i figured out how to do everything but so far i only completed the scrolling, sprite animation, partial sprite collsion, music, some sound effects, and the menu system(the buttons pulse like in OSX :-)).

I have another question though. Yesterday I started putting in all my network code but "Host Net Game/Join Net Game" aren't working. Hieroglyph says it is an Illegal Procedure Call, but I dont have it as a procedure. I thought my problem might be that i didn't initialise networking but i did that and it stil didn't work.

12-11-2001 10:40

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

lol sorry about that too, i hit the back button and it posted it a third time

12-11-2001 10:41

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

lol sorry about that too, i hit the back button and it posted it a third time

12-11-2001 12:49

Posted by:
Mark Tully

Find more posts by Mark Tully

Networking: Illegal procedure call

Are you enclosing the parameters to host network game and join network game in brackets () ? That might be making TNT Basic think you're trying to call a procedure with that name?

Check out our networking tutorial for more info:

http://www.tntbasic.com/learn/help_frms/network.html#Hosting%20and%20Joining

If this doesn't solve your problem, let us know.

12-11-2001 22:42

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

host net game

ok now I put:

initialise networking
host net game 2,"Game Name","Player Name"

and Player Name caused a syntax error. What do i do?

12-11-2001 22:46

Posted by:
Sephiroth

Click Here to Email Sephiroth   Find more posts by Sephiroth

btw...

In the help file the examplefor Host Net Game is:

Host Net Game (maxPlayers,gName,pName)

thats why i had it in parenthesis, you should change that.

12-12-2001 10:20

Posted by:
Mark Tully

Find more posts by Mark Tully

just been refreshing my memory on the host net game command.

the trouble with the code you've got is that host net game returns a boolean result code, saying whether it was oked or cancelled. you have to store this in a variable, you can't ignore the result.

change your code to:

initialise networking
int result=host net game (2,"Game Name","Player Name")

and it should work fine. Note that you need the () for a function that returns a value, so the help system was right after all!

i have noticed however that links are broken in the online networking tutorial. we'll fix those soon.

Thanks for your interest, let us know if your have any further trouble!

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.