2019-08-24 23:40:14 (edited by Parker2681 2019-08-24 23:41:07)

So I am struggling to make a propper inventory class with bgt. When I enter the inventory, I get a bgt run time error. Another problem is that I don't know how to make items go in the inventory. I was thinking about using code from other games, but that won't work. So if you could help, that's cool.

2019-08-25 07:09:31

all you should do, is use an array for your inventory class, and then just append all the items to the inventory menu like that. and then just check the usage after each enter key pressed to select an option.

best regards
never give up on what ever you are doing.

2019-08-25 07:12:15 (edited by amerikranian 2019-08-25 20:11:17)

I would use a dictionary because it will allow for multiple items of the same quantity, unless you wish the inventory array to contain multiple item arrays.

2019-08-25 09:10:46

oh yeah, that is also true.

best regards
never give up on what ever you are doing.

2019-08-25 18:14:32

amerikranian wrote:

I would use a dictionary because it will allow for multiple items of the same quantity, unless you wish the inventory array to contain multiple item arraise.

This is true, but if you only want one of each item, then just use a string[] inventory array, and append items to the array as @2 said.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-08-25 19:56:49

hate to say this because most of you will say read the manual, but can someone give me a working example of how to append items to the inventory and how to have more than one of multiple items if you get them?

2019-08-25 20:11:03

@5, I am aware of this, that's why my post is worded as such.

2019-08-26 01:13:37

@7, He's not as advanced as us and I was just explaining it in further detail.
@6, I don't remember the exact function, but go to the manual/references/one of the sections/arrays, something like that, and there's a array.add_last type function, something like that, don't remember off the top of my head.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)