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.

Newcomers DBPro Corner / Data Problems

Author
Message
The InTIMidator
19
Years of Service
User Offline
Joined: 22nd Jun 2005
Location: Somerset, UK
Posted: 13th Oct 2006 13:15
Hi, I'm trying to make a text based game and I'm trying to contain my text in data, then call it to whenever it must be. But I've got some problems and questions:
1. When I try to call these up I get a few cut off or that shouldn't appear... and at the y/n command it doesn't go on to the tutorial? Why?


2. For the parser bit i need an array inside an array (spacepos(spaceno(t)). Is this possible?

Thanks

The InTIMidator

"Press any key ... where's the any key"
AMD Athlon 64 3400, 1 Gb RAM, Radeon 9800 pro, 80GB HDD
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Oct 2006 15:13 Edited at: 13th Oct 2006 15:14
you can have multidimensional arrays

Dim MyArray(9,9) as String

that would give you a 10x10 array (0-9 by 0-9 indexes)



as for the data cut-off, not sure but it prolly has a character/value limit of some sort

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 13th Oct 2006 15:17
You have a few ways of sorting this out.

a. make sure that all data lines are the same length.[have a look at what happen when you change font type].

b. learn how to break up a data string and then put each part on the screen.

1. This should work, made need to look for away to clear key press before you call it.


2. belive its possiable.

Dark Physics makes any hot drink go cold.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Oct 2006 03:20
For text adventure games it's better to put everything in text files rather than data statements. The data statements in the code will overwhelm you pretty quickly. Each room description in the text file needs to be separated by a blank line for ease of loading and editing.

CattleRustler has it right (of course ). A 2D array is best to keep the data.



Quote: "DATA "'direction','go direction' will go in the desired direction's space gate eg 'west' will go to the west gate.""


The only problem I see right now is the fact that compass directions are a terrestrial means of navigation (on planets). In open space there is no north, south, east, west, and so on. Space games like Trade Wars use sector numbers as a means of navigation which can still be put into a 2D array.

A true space game would be a 3D universe... a big box with x, y, and z coordinates.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Oct 2006 12:32
Quote: "A 2D array is best to keep the data"


Simplest, maybe, but not necessarily best.

I've seen other text adventure systems where each location is given a room number, and then a list of rooms that it connects to - it uses far less storage that way as you only need a 1D array for the room descriptions, and you can store the links in another 1D array. You can also attach descriptions to the links, such as the normal N/E/S/W, or even 'along the valley' or 'up the mountain'.

Login to post a reply

Server time is: 2024-11-27 05:33:04
Your offset time is: 2024-11-27 05:33:04