|
Post by zariarose on Oct 8, 2020 17:52:10 GMT
Hello!
I have a problem, and a few questions.
I want to include a simple inventory system into my text-based game, but I don't know exactly how to... implement it? I have a few ideas about what I want to do, but not enough knowledge to... do so, I suppose I've been trying to deal with functions and subroutines but I guess I just don't know... how to write them, I guess?
So, any tips on at least outlining a text inventory system using JustBASIC? Should I include what I have so far, for reference?
Also, is this considered a newbie question, or a coding question?
EDIT: I FIGURED IT OUT!
|
|
|
Post by carlgundel on Oct 8, 2020 18:42:01 GMT
Hello! I have a problem, and a few questions. I want to include a simple inventory system into my text-based game, but I don't know exactly how to... implement it? I have a few ideas about what I want to do, but not enough knowledge to... do so, I suppose I've been trying to deal with functions and subroutines but I guess I just don't know... how to write them, I guess? So, any tips on at least outlining a text inventory system using JustBASIC? Should I include what I have so far, for reference? Also, is this considered a newbie question, or a coding question? You want to keep values by name without having a variable for each? Try the Dictionary Lookup code here: basicprogramming.blogspot.com/2016/If you scroll down you will see the earlier articles that explain how the code works are further down starting July 8. Or you could do a very simple implementation of a string array with two columns. One with a name and one with a value. -Carl
|
|
|
Post by B+ on Oct 9, 2020 0:44:46 GMT
Hello! I have a problem, and a few questions. I want to include a simple inventory system into my text-based game, but I don't know exactly how to... implement it? I have a few ideas about what I want to do, but not enough knowledge to... do so, I suppose I've been trying to deal with functions and subroutines but I guess I just don't know... how to write them, I guess? So, any tips on at least outlining a text inventory system using JustBASIC? Should I include what I have so far, for reference? Also, is this considered a newbie question, or a coding question? Hi zariarose, Carl's dictionary might be a little advanced for someone trying to deal with functions and subroutines. Yeah so maybe a glimpse at what you have so far and a little more detail on what you expect from inventory system. I am thinking that each player or character has an inventory from games I've seen, is that the case for you? It could be something simple like player1$ = "player name, item1, item2, item3, item4" or player2$ = "player name, item1 = 10, item2 = 5, item3 = 0, item4$ = 1" Use word$() to read player's name and stuff he has or stuff and amounts of that stuff. Actually this is like dictionary sorta
|
|
|
Post by tsh73 on Oct 9, 2020 6:48:38 GMT
You will really get more advice after posting code. So far we have no idea what you do. How many heroes you have which will need a inventory? Do you use arrays? May be files? post a code and it will sure be coding question
|
|