Trouble with custom inventory

Get help using Construct 2

Post » Sat Oct 05, 2013 5:19 am

Capx link

I'm working on an inventory system, and after a traditional slot based system, my friend suggested to try a simpler circle inventory where items are locked into the circle but can be dragged around freely.

It took me a while to debug this, but I'm running into one last problem here. The test item would either be stuck in the top-left tip, is draggable, but would lock back to original position, or the item would be entirely invisible after pickup and I would find out it was an an odd co-ords, like 70 and -262.

I've got this down to a static pos but draggable item. Anybody want to help me fix this?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 05, 2013 8:07 am

Okay, I've gotten a little further. I managed to be able to set a default x/y when picked up, but I can't get the test item to lock to the inventory circle if it goes outside of it.

Reupload my capx, the one with a semi-working inventory.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 05, 2013 7:32 pm

Anybody got a solution?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 05, 2013 10:07 pm

I'm confused. I can't see a circle inventory or draggable items. Please explain what the problem is more clearly as I can't work it out from playing this game. I walk around and he picks up items and they go in the inventory.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sat Oct 05, 2013 11:04 pm

My bad, I forgot to fix something in the capx.

Re-download it.
Pickup the item (the one that looks like a chunk of wood). Click the icon that is a set of graph bars, and click the green arrow icon until you reach the inventory. Items can be dragged around, but I need them to be reset to the center of the circle if they go outside the edge.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 05, 2013 11:09 pm

Just use the logic you are using for assigning to slots and say that when item is dropped, if not occupying a slot, set position to inside circle.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Oct 06, 2013 9:58 pm

I need this this to function on the gui screen, and not when the player drops an item.

They can be dragged around freely on the gui. But, I need the items locked to the circle, where they will be reset back to the center of the circle if they leave/overlap the outside edges.

I figured one way of doing this is setting a ton of image points on the circle's edge, and checking if 'item x' overlaps with image point n's x/y, but that would be extremely cumbersome to do.

I've also tried "is overlapping/is not overlapping" checks, but they don't work as the item is always overlapping the main gui sprite. The circle is a separate sprite overlaid on the gui, and it's a layer above the main gui's layer.

I've also tried setting the inventory overlay to the same layer as the inventory gui, and lowering the item layer (topmost) to what used to be the inventory overlay's layer. Still nothing.

I've also tried setting an animation if it goes outside of the circle, this works fine but when I try a condition check if "outsideframe" animation is playing, nothing happens. Sure, I've it "works", but it doesn't reset as I expect it to, even when I strip the event down to it's bare minimums to work.LaDestitute2013-10-06 21:58:47
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 19, 2013 3:48 am

Any help on this?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 529
Reputation: 19,610

Post » Sat Oct 19, 2013 8:36 am

I really don't understand how your game works, but maybe you could use the clamp expression to prevent things going out of the circle edges.

Or you could just use the distance expression to compare the distance of the sprite to the center of the circle.


I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: evillair, gamecorpstudio, jorgmaquoi, Yahoo [Bot] and 22 guests