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 / DBC Database problem.

Author
Message
Random Man
19
Years of Service
User Offline
Joined: 8th May 2005
Location:
Posted: 8th May 2005 21:45
I'm making a gameshow game in DarkBASIC. I've successfully made two so far, but neither one requires questions. The one I'm making now does, and I'm trying to figure out how to make DBC interact with an outside database (.INF or .TXT or whatever, better if the players couldn't open them and read all the answers, but that's for another time). My questions are as follows:

1. How do I get DBC to read from a database, randomly choose a question, display it, know what answer is correct, etc. All my attempts to get this to work via tutorials have failed, probably because I don't know how to set up the database in a way that's readable to DBC.

2. (not as important for now) Is it possible for DBC to recognize multiple question databases (even new ones, released after the game is) and be able to allow the player to choose between them? (I don't need to know how yet, just if it's possible.

Please, I would appreciate any and all help with this, as I've gone as far as I can go without questions, and am thus at a standstill.

My thanks in advance,
Aaron

Only a fool is sure of anything. A wise man keeps on guessing. ~ Macgyver
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th May 2005 01:44
Security issues aside, the easiest way to acheive this would be a plain text file...

Line 1 : question
Lines 2 - 5 : Possible Answers
Line 6 : Answer

Line 7 : Question
...

You can also add extra information into the top of the file, such as number of questions in the file, number of answers per question, etc. If you have a header section to describe the format in this way, it's possible to extend into multiple question databases.

You could also scan the folder for all Question files, so basically have different sets of questions in different files.

BatVink
Random Man
19
Years of Service
User Offline
Joined: 8th May 2005
Location:
Posted: 9th May 2005 22:25
I'm sincerely sorry. I'm still ridiculously new to DBC, and have no idea how to implement what you just said. Could you possibly provide an example of a text file as you mentioned with the header and question lines, and an example of code in DBC to make it read this info? So far, nothing I've tried works. If I can just figure this out, I'll be golden and can start programming like crazy. (I'm good with pictures, and actual simple game code, but this is completely new to me)

I'd vastly appreciate your help on this. Want credit in the game when it's released?

Aaron

Only a fool is sure of anything. A wise man keeps on guessing. ~ Macgyver
Random Man
19
Years of Service
User Offline
Joined: 8th May 2005
Location:
Posted: 17th May 2005 21:56
Anyone, please. I cannot program any further without this one bit of help in databases. Even pointing me to a quality tutorial (one that explains everything and shows examples) would be fine, as long as I learn what I need to. If I can get this, I can do everything else on my own. I've now gone three weeks without programming, so I'm willing to beg if I have to. Please, help me if you can.

Aaron
Poor Lost Programmer...

Only a fool is sure of anything. A wise man keeps on guessing. ~ Macgyver

Login to post a reply

Server time is: 2024-09-23 19:30:36
Your offset time is: 2024-09-23 19:30:36