0 Favourites

How do I Switch Values Inside My Array Inventory CapX?

  • https://db.tt/JwFUtlq8

    Hi everyone,

    Ive been testing my inventory and i finaly was able to get it working how i wanted it to.

    I just cant figure out how to make my slots switch places with one another when pressed and not of equal value.Could someone give me a hand and show me how to do that within my inventory? This is my only roadblock i have in the road from being able to finish my project.

    Thank you guys for everything thus far.

    I have been on here before asking for a similar issue to be solved.I wanted to implement drag and drop but a few veterens told me it was unable to happen since how my code was structured.

    To try and bypass the drag and drop im just looking for a way that the player can move an item from one slot to another.

    I actually had a go at it but im not getting the code right,thats why im asking for help.Everything is perfect besides that fact that i cant move an item.

    I just wanted to make it more clear for everybody,i tend to be confusing when i speak.Thanks in advance to anyone that glances at this.

    I did have this posted in the General tab,I accumulated over one hundred and fifty views with no feedback,so im trying my luck here in the How do i section.I maybe should have posted here to begin with.

  • I assume you want a condition that says "not the same" and then transfer the data of the first slot into a seperate variable that you can use later.

    And also put the data of the second slot into a seperate variable. And then after you "dropped" it (assuming drag and drop) you will be transferring the data back but in the switched positions. Hopefully this makes a little bit of sense and will help you in the general direction you're trying to go.

  • Not sure that's what you want, but here it is...

    [attachment=0:2voftodt][/attachment:2voftodt]

  • Added a correction so, when the player drops an item, it ignores the dropped item's slot as previously selected, since it's now empty.

    [attachment=0:36j3jcud][/attachment:36j3jcud]

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Thank you brunopalermo you have saved my project from being lame! i sent you a PM

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)