Item collection for rpg?

Get help using Construct 2

Post » Mon Apr 04, 2016 1:20 am

I'm in the progress of making an rpg dungeon crawler. I had it so it would just stack up items in one slot of the 36 slot inventory. The concept was fine, but not for inventory limit, and I don't want to go through the trouble of giving items weight. So instead, I want to have it so each item that is picked up, even if it is a duplicate, can be in a new item slot. Using the same sprite for each slot though is proving difficult. Is there some way I could add a boolean when an item is overlapping the item slot so that it knows not to put a second sprite there? It seems you can't use overlap for 9-patch, which is what I'm using for the slots. And I don't know how to say, spawn another sprite for the duplicate item. A capx can be provided, but beware I have many, many events in a complex directory.

Thanks ahead of time.
B
8
S
2
Posts: 61
Reputation: 674

Post » Mon Apr 04, 2016 3:03 pm

How do you track the items in the inventory? Is it just using the 9-patch or do you actually have a data structure backing it?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Apr 05, 2016 2:35 am

@gumshoe2029 after picking up and item, I just have it to set that item count (global variable), and set the item icon to visible, and pick nearest 9-patch and set to its position. I guess I could pick each 9-patch's UID and then every hundred of item is overlapping, not let every other hundred of item be in its place.... I really am having some issues thinking of a way to do this.
B
8
S
2
Posts: 61
Reputation: 674

Post » Tue Apr 05, 2016 3:11 am

I have a question do you want a champion of norath style of bag or do you wish to do something like 5 large crystal and then start a new stack or just five slot of large crystal ?
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Tue Apr 05, 2016 4:23 am

@gearworkdragon I would prefer stacks, but if I have to do 1 per slot I will.

Being able to change the amount in a stack for different items per slot would help with inventory capacity.
B
8
S
2
Posts: 61
Reputation: 674

Post » Tue Apr 05, 2016 8:24 pm

If were doing stacks like 20 cloth and start a new one. Id would do something like this Make an inventory sprite of the item and slap two variable on to it let call it Current and max. And have an event something like this If "current" variable is equal to 'Max' variable Then make a function of create the sprite into the next slot and +1 to its current variable.

That should be it. But i do not know how to split stack if we are talking about trading a certain ammount. that one is out of my league.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests