-
text based game
help me pls
i want to make a text based game where u type in values and stuff happens
BUT
what i want is where can i store the values
because there will be alot of different ones like
networth = 1
money = $100
food = 500 bags
so i want it to be able to be easy to access when i need it
there will be alot like 50 or so
so how would i do this
a file or something
also where is some info on what u come up with
thanks :)
-
you Could make 50 or more text files but i don't think you would want to do that you might wanna try a database
-
Why not use a array and use structure data type or class to hold values, etc
-
Even though an array would be the most effecient way to store all of the fields, it might be hard to remember what element was linked to what field.
A database would work pretty well, but they're not always easy to make connections like they should (That's why I'm surfing through here)
If it is going to be a text-based game, why not use text fields? You should have no trouble from accessing your variables with a low-spec program, plus it will keep everything in order, and easy to remember variable-names will keep everything in order.
~Looseclothes Prophet
-
If it's just 50, I would suggest using a file.
-
An array wouldn't be difficult. You setup constants to represent particular items. They don't take up RAM because constants are managed at compile time and they make the programming easy to read.
-
well it needs to be easy to find
because i will have different pages tryin to access the values
so it cant really be 1 file because it will be hard to find the value
eg. line 33 could be networth
and line 2 could be something else
also where could i get info on arrays?
thanks alot :)
-
You can use arrays, user defined types, or a database. You can search the forums for arrays, but you'll be better off buying a book on basic VB prgraming. Sams has some good books. There are some decent tutorials on the Internet if you do a bit of searching. I'd use an array with a UDT for 50. Holding values for 50 players won't take much memory. 50 isn't a lot. 50 million is a lot.
-
Does this game allow you to add more than one player profile? Or is it set at 1?
-
it sounds like the task you are facing is too complex for your current skill level...if you dont yet know much about arrays you should start out small with a little application or something. they are so much more satisfying than games because they can be made almost 100% bug-free, and are just as fun, especially if they can do something you always wished your OS could do but cant..hehe, if you see what im saying...games are also sad to make because you always feel that they are no good compared with what is for sale... heheh..