May I Have Some Help With My Inventory CapX Please

Get help using Construct 2

Post » Mon Jan 06, 2014 2:44 am

@lennaert Thank you for your help! and Thank @EncryptedCow for the great inventory,He created it for me.One question i have is.Can you make it so when i grab an item from the inventory and i drop it on a different slot it replaces it? Thats really what im aiming to do rather than equiping it.RookieDev2014-01-06 02:44:52
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Jan 06, 2014 2:49 am

[QUOTE=RookieDev] lennaert Thank you for your help! and Thank @EncryptedCow for the great inventory,He created it for me.One question i have is.Can you make it so when i grab an item from the inventory and i drop it on a different slot it replaces it? Thats really what im aiming to do rather than equiping it.[/QUOTE]

It does that already.

grab a red and orange item, and swap them with the top location.

your colored items only fit on certain sqaures.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Mon Jan 06, 2014 3:10 am

@lennaert Im not understanding what you mean by"colored items only fit in certain squares"All the squares are the same as the tile size and Im dragging the red block tile over the orange and they are not swapping positions at all.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Jan 06, 2014 7:39 am

[[email protected]] lennaert Im not understanding what you mean by"colored items only fit in certain squares"All the squares are the same as the tile size and Im dragging the red block tile over the orange and they are not swapping positions at all.[/QUOTE]

It means, the colored items are items with types, like helmets arm and leg plates and body armor.

The row on the right is a figure, probbly depicting a body: in the top square fits helmet, below that arm plates, torso items then and at the bottom leg items or shoes.


The red and orange sqaures are helmets, they fit in the top square.
So you dont have a simply inventory, you have a charatcer item placement shield with small inventory.

the items lined up on the left is actaully your inventory, what selected on the right, is equiped.


Havent you noticed, that when you place items in the right side, that the character actually starts wearing it ? look at the helmets for instance, your character then actually wears a red or orange helmet.lennaert2014-01-06 07:42:06
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Mon Jan 06, 2014 7:47 am

@lennaert Thank you for taking the time to help me out with this issue.
Do you know how to implement this feature to the slots on the left?
What im trying to do is once the item is dragging and over the desired slot i wanted the item to swap places with eachother along with the amount.
Youve created this in the equipment slots and that isnt the slots for my inventory even tho they will be used aswell.RookieDev2014-01-06 07:50:32
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Jan 06, 2014 8:09 am

[[email protected]] Lennaert Thank you for taking the time to help me out with this issue.
Do you know how to implement this feature to the slots on the left?
What im trying to do is once the item is dragging and over the desired slot i wanted the item to swap places with eachother along with the amount.
Youve created this in the equipment slots and that isnt the slots for my inventory even tho they will be used aswell.[/QUOTE]

I dont think that is possible as it would require rewriting almost the entire thing.

The items on the left, is your inventory. they depict what you have. (horizontal lined squares)

The items on your right, is your equiped items list, (vertical stacked row)



Now, if you drag or click your item to the first square in the right row, it means you have THAT item equiped on helmets, while it is still in you left inventory.

You can change the items equiped,but they will remain on the same spot in your inventory.

Your inventory has no system to swap spots within your inventory locations and I am not going to make that as it would require rewriting a large chunk.

Your inventory is actually very advanced, but it looks to me your not understanding it yourself.``lennaert2014-01-06 08:11:04
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Mon Jan 06, 2014 8:19 am

@lennaert thank you for letting me know this,I do understand my inventory as it is right now,Just because i lack the skills to implement a feature i know nothing about does not mean i know nothing about my inventory.I admire your honest remarks but in the end i am still clueless.I want to thank you for your reply to my post because you did teach me a few things.
The only other person i know that can show me or even tell me how to implement this feature is @R0J0hound.
R0J0hound,if you are not busy could you explain to me how i can do this the right way? I dont want to have a faulty system withen my inventory and i know for a fact that you know you stuff when it comes to code.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Jan 06, 2014 8:32 am

The thing is, your inventory system was/is already working correct.

I only added an interface option which allows to drag inventory items to their desired equipment placements. And it works, just like clicking them does. I used the xisting mechanic, I only added 2 events to handle drag start and drag letting go.
And i added an extra condition where you normally clicked on the equipment slots, with over lap option.

This effectively makes the function the exact same as clicking it.

From what it looks like your asking is, after dropping, swap the locations in your inventory ... which imo .. is also kinda useless in the first place as your just reordering your material around in you inventory slots. But the inventory placement, and items system work as it should.

Heres a problem, your equiped item is tied to the item in your location inventory. You will have to rewrite your array contents if you want to swap them ....

whats wrong with having the inventory items remain on their position once equiped ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Mon Jan 06, 2014 8:46 am

@lennaert

the main reason im looking to swap positions of items is because this game will have chests that the player can swap items to and from.
I Have no issues with how this inventory works in general,im just trying to add to it.I guess what your saying is i have to rewrite my whole inventory?
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Jan 06, 2014 8:55 am

[[email protected]] Lennaert

the main reason im looking to swap positions of items is because this game will have chests that the player can swap items to and from.
I Have no issues with how this inventory works in general,im just trying to add to it.I guess what your saying is i have to rewrite my whole inventory?[/QUOTE]

It apparently wasnt build with that intent.

Either it has to be rewritten with that possible function incorperated.
Or some method has to be added allowing for the array with inventory items to be rewritten upon item swap. But my knowledge of the Inventory stops here, I know there is a list of predefined items, stating which item falls in what category, but its also tied to the spot in the regual inventory. So it could very well be, that while rearranging your inventory you will need to update the equipted array too ....

It ofc is possible, but as I didnt build it, for me it would be a lot of trial and error before having it work decent.


There are other inentory systems out there which work more to your liking, but do not have the equiped items thing in it.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: John Cutter, Yahoo [Bot] and 11 guests