"Inventory" Problem...

Get help using Construct 2

Post » Sat Apr 07, 2012 11:27 am

Hey.

I've made my own inventory, very basic. It's Drag and Drop or Double Click.

The thing is, it works as long as the screen is at the same position all the time, in other words, as long as you don't move the character.

If you move the character so that the screen just goes down a bit, the inventory space that reacts to the dropped item is moved upwards. Can't really explain it but go ahead and try it out:

DOWNLOAD THE .RAR FILE:

Problem.rar

Try it:

Problem

[EDIT]
You move the character with the WASD keys.

The tree in the top right corner can be destroyed by clicking on it, and then a tiny tree is spawned, that tree can be dragged to the bottom right "inventory space" as long as the screen is not moved. But try moving the screen a bit down, for example 50px and then try dragging it in to that same spot.. It only works if you drag it to the position that the inventory space used to be in, if you then move the screen back into the top left corner, the inventory space works again with the drag and drop. But the double click works no matter what.

I have 3 Different Layers:
- 2 GUI ( Sticks to the screen, where the inventory space is )
- 1 Stuffs ( Where all the movable objects is )
- 0 Backtround ( The background... )

Can anyone help with this particular problem?

I'll upload the .capx as soon as I figure out how I do it.Jonsterz2012-04-07 13:57:54
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 2:36 pm

Anyone? :D
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 6:35 pm

Have you set the Behavior of your inventory screen to Anchor? Then you can set it in the window where you need it and it will stay (relatively) stable and usable.
B
8
Posts: 6
Reputation: 839

Post » Sat Apr 07, 2012 8:40 pm

@Nochek Yes, I've tried that and it didn't work. I've played around with all the behaviours and no one fixed the issue. :/
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 8:52 pm

On drop, set the little tree sprite to be on layer GUI, it has to be on the same layer as the UI.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat Apr 07, 2012 9:01 pm

If you open my file, you can see that when on drop, the TreeIcon moves to Layer 2 if it overlaps the InvSlot1.

If I also change the other "on drop" action, it changes so that the TreeIcon is allways on GUI and moves within the screen, which is not what I want..

Am I missing some coding?

Thanks for the help.
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 9:10 pm

I got it to work, it's a bit buggy but I added an action "TreeIcon Is dragging -> Move to Layer 2"

It works, sort of. But if you got another better solution please tell me.

[EDIT]

Now it cant interact with the fire -.- Because it's on the 2'nd layer as soon as its being dragged...Jonsterz2012-04-07 21:17:46
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 9:22 pm

In "Move to Layer 2" replace 2 by "GUI" (caps and the quotes).
Apparently it works.
(with your previous capx version, remove your latest changes)Kyatric2012-04-07 21:24:23
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat Apr 07, 2012 9:28 pm

Seemed like a good idea, but I can't get it to work. As soon as I move my character the Inventory Slot is not "accepting" the treeicon, but when I move back up into the top left corner, I'm able to drag it into the space again. Don't matter if I have it as "GUI" or "2" :/ Did you manage to make it work in the .capx i posted? If so, can you post the one you edited?
B
13
S
5
G
2
Posts: 64
Reputation: 3,012

Post » Sat Apr 07, 2012 9:36 pm

A true capx

Also apparently the version you posted earlier worked as intended by default actualy.

I don't know what happened on your previous export but it seems corrected.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, MChiz, Radulepy and 0 guests