Inventory Array

For questions about using Classic.

Post » Tue Feb 15, 2011 10:54 am

Been toiling with this for a couple days now. I found a couple other threads on inventories, but none that helped me with this inventory.

http://www.mediafire.com/?k5zfd48m2t6w1g4

Here's the .cap for both programs. Ama Object Creator saves arrays for objects that I want to load into a player's inventory, the other program, AmaProgram, is the one I'm having trouble with, which actually keeps track of player's inventories.

I have two arrays set up, one's called ItemLoader, which I'm using to load arrays made by Ama Object Creator, the second is ItemList, which is the actual array of the current character's inventory.

I also have InventoryHash, which is something I was trying after looking at an inventory tutorial, but couldn't get that to work either.

Basically, I want my Add button to pull an array from the items folder, load it to ItemLoader, then move the information in ItemLoader into ItemList.

The arrays are 50x wide, and ItemList is 50x wide and really tall, I want ItemLoader to file items into ItemList by y, so the first item takes up 1-50x, 1y; second takes up 1-50x, 2y; etc.

And then I need "InventoryList", a listbox, to show every item in ItemList, and how many times it occurs.

Whew, that's a lot of stuff. Thank you in advance to whomever has the will to cure my noobness :p
B
2
G
2
Posts: 22
Reputation: 694

Post » Thu Feb 17, 2011 12:28 pm

bump
B
2
G
2
Posts: 22
Reputation: 694

Post » Thu Feb 17, 2011 6:14 pm

To load the array data you created you need a array object. Generally if you use a certain object to create a file only that type of object can read that file.
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711

Post » Sat Feb 19, 2011 12:05 am

I'm loading it just fine, like I said, I have an array object named "ItemLoader" for the purpose of loading items.

The problem is that I don't know how to sort things from ItemLoader into another Array, and then get construct to print the names and quantities of everything in that array.
B
2
G
2
Posts: 22
Reputation: 694

Post » Sun Feb 20, 2011 2:37 pm

:<

Is this question too difficult? Am I not being clear enough on what I want? Am I asking too much?

This is an important question, I can't keep working on my project if I can't make an inventory list.
B
2
G
2
Posts: 22
Reputation: 694

Post » Mon Feb 21, 2011 6:17 pm

[quote="mandanceman":2iwdd371]:<

Is this question too difficult? Am I not being clear enough on what I want? Am I asking too much?

This is an important question, I can't keep working on my project if I can't make an inventory list.[/quote:2iwdd371]

I think it's difficult, because there are like 10 cap files to go through with million objects, events, variables. Strip it down to minimum, ged rid of everything we don't need to see before you upload it. I've tried to make what you asked, I hope thats it. At least I've reduced it from 10MB down to 10kB :) link
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Thu Feb 24, 2011 6:36 pm

Thanks a bunch!

It's not really what I wanted, but it taught me what the "for" command does, which is pretty much exactly what I needed. :3

I won't be able to work on this for a few days, but when I get back to it, I'll revive this thread if I need more help on the subject
B
2
G
2
Posts: 22
Reputation: 694


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests