SOLVED:How do I turn this mouse inventory system into touch?

Get help using Construct 2

Post » Tue Mar 25, 2014 4:32 pm

It is made with mouse in mind, but I've worked on this for 24 hours now and can't figure it out. It isn't mine, I found it in at some point a week ago while shuffling through tutorials and forum postings.

Please, someone take a look at this and help a poor sap! Yes, I know there are some things I cannot do with touch, but basic moving things around and equipping things is all I need. The stats display I'll handle my own way. :)

Thanks again in advance!

https://dl.dropboxusercontent.com/u/11127546/inventory.capx

EDIT: This is the raw version of the Inventory system I found somewhere on the forums or tutorials. I've already, in a copy of this file, added the Touch object and translated everything, but it doesn't work as one imagines it should. That part of translating took about 10 minutes, but I've spend the last 23 hours and 50 minutes trying to get it working but to no avail.
Last edited by roracle on Wed Mar 26, 2014 5:04 am, edited 2 times in total.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Tue Mar 25, 2014 5:35 pm

Double click like were u go to to add a sprite but scroll down to touch its like mouse but it says touch
[img]imageshack.com/a/img19/5018/sqio.png[/img]
Banned User
B
5
S
1
G
1
Posts: 88
Reputation: 718

Post » Tue Mar 25, 2014 5:39 pm

No, I understand that part, I just uploaded the raw version of the CAPX without the Touch object. I've worked _with_ the Touch object trying to get everything working properly and it isn't translating correctly and I can't figure out why for the life of me.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Tue Mar 25, 2014 6:34 pm

Try makig a new project and just re do everything in a new one probly just a bug
[img]imageshack.com/a/img19/5018/sqio.png[/img]
Banned User
B
5
S
1
G
1
Posts: 88
Reputation: 718

Post » Wed Mar 26, 2014 1:03 am

I think it has to do with clicking the object, dragging it, and it's supposed to store the UID of the slot, but it doesn't or something like that. I wish I had more info, but my main post is really all I can say about it.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Wed Mar 26, 2014 5:04 am

SOLUTION 100% working so far as I can tell:

Add a 1x1 sprite, name it CursorLoc, Visibility at start: Invisible.

Add two lines of code beneath the globals, before anything else (in this order, too, since it is picky):
Touch is in touch: set position to (Touch.X, Touch.Y)
Touch on any touch start: set position to (Touch.X, Touch.Y)

Replace
"Cursor is over invSlot" with "CursorLoc is overlapping invSlot" (etc, equipSlot as well)
"Mouse Left Button is NOT down" with "Touch is NOT in touch"
"Click on Item" replace with "Touch on touch object Item"
Replace all actions where "Mouse.X" or "Mouse.Y" are with "Touch.X" and "Touch.Y". (These are mixed in with algorithms, just change the Mouse to Touch)

EDIT: In order for the stats to work (see "STATS" group of events), just change it to "Touch Is in touch" instead of "Mouse Left button is NOT down". This works almost as needed: it displays the stats while dragging the item about. If you drag an item and hover over an equipped item it will display the stats of the lesser item if it's equipped (as expected). Moving a lesser item over a more powerful item only displays the lesser item's stats. The desired goal is to have the stats of a more powerful item over it instead. This isn't necessary for me as stats will all be displayed elsewhere, but if you need it, know that this bug is there.

CAPX: https://dl.dropboxusercontent.com/u/11127546/inventoryTOUCH.capx
B
25
S
6
G
6
Posts: 265
Reputation: 3,696


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, senecaa and 17 guests