Qbasicnews.com

Full Version: string variable question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Quote:But I cant do this. instead I have to use a seperate array just for the NPCtalk$ string. Annoying. Dont you think?

Not at all. Infact, I use this to my advantage. I keep 'language' files so in the game itself it uses string IDs to know what string to display, but a different language file can be used so the game can be played in English, Portuguese, Spanish, French, Dutch, etc.

Plus, using just a 'Dialogue ID' makes it easier to handle scripting of character dialogue.
Quote:Not at all. Infact, I use this to my advantage. I keep 'language' files so in the game itself it uses string IDs to know what string to display, but a different language file can be used so the game can be played in English, Portuguese, Spanish, French, Dutch, etc.

Plus, using just a 'Dialogue ID' makes it easier to handle scripting of character dialogue.

I totally agree, it's like a relational database Smile. Using an id makes it easy to get any character to say anything, rather than limiting them to a few predefined strings. Besides, say you try to get around this by adding to your type:

[syntax="qbasic"]TYPE foo
X as integer
Y as integer
...
talkstring as string * 1000
...
END TYPE[/syntax]

Then you DIM some array for it - whoops, out of mem Smile. Or at least, hogging mem you could use elsewhere...

And the language thing could be very powerful. I'm sure there's plenty of people on this forum who would be happy to translate someone's game into another language if all it meant was going through an english file and changing it (for a place in the credits, of course Wink).
Quote:I totally agree, it's like a relational database Smile. Using an id makes it easy to get any character to say anything, rather than limiting them to a few predefined strings.

Indeed. Relational databases are very powerful and extremely flexable. There are times when it's just more efficient/easier to use a fixed datablock/string, however.

The game my friend and I are working on (SpaceGameX, http://zbest.dyndns.org/SpaceGameX/) uses a relational for most everything. It keeps the data smaller and puts the work load on the SQL database which is optimized and designed for it.
Your game looks like an interesting concept Smile. I see you only just started it. If it takes off, you better hope you've got a fast enough server Wink
Yeah, that game looks cool!!!!

VB?
Quote:Your game looks like an interesting concept Smile. I see you only just started it. If it takes off, you better hope you've got a fast enough server Wink

Well, right now the server is running on a P100 (80MB RAM) under NT4 with a DSL connection (1.5M down, 384K up). It seems to run fine with as many as 4 users at once! ;P

Quote:Yeah, that game looks cool!!!!

VB?

Yeah - VB6, DX8, SQL 3 (server side).

I'm thinking, however, of switching to using Delphi 7 since it's not annoying like VB, it's annoying like Delphi. Plus, I don't like C ;P
Cool!!!!
Quote:In QB4.5...you can't get around it. I'm not sure about later QB versions though...I've never even attempted to use variable length strings in a TYPE because that defeats TYPE's purpose.

AFAIK, variable length strings are allowed in UDTs at least in VB 4 and above and maybe VB 3... I'd have to check my manuals for that one.
Pages: 1 2