How do I move data from one index in an array to another?

Get help using Construct 2

Post » Tue Dec 15, 2015 6:19 pm

aquadijoib wrote: I'm still not able to make it possible to move from chest to chest or from chest to inventory. I mean from one Z index (Storage) to another.


you probably need to save Z-index of first item...
something like:.......................................................................... ArraySwap3D2.capx

Image
Image
B
63
S
23
G
7
Posts: 1,479
Reputation: 10,794

Post » Tue Dec 15, 2015 9:33 pm

@korbaach,
Thank you again for your amazing example! :D
I implemented the system from your example in my project and tried it out. Something happens, but not exactly what I want ;) .
The only thing that was changed is that I have 2 different types of slot objects. One for the inventory and one for the chest. Because I wanted the inventory slots to be next to the chest slots. So I thought that I simply have to duplicate it for the chest and the inventory.
I put some screenshots of my events below. If that's not enough, please tell me and I'll send you my capx.
Thanks!

Links (in correct order):
https://drive.google.com/open?id=0B7r2W ... HNWVF93QVU
https://drive.google.com/open?id=0B7r2W ... DJGVTNDTW8
https://drive.google.com/open?id=0B7r2W ... U1tc3Yxams
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Tue Dec 15, 2015 11:05 pm

aquadijoib wrote:... please tell me and I'll send you my capx.


please... :D
Image
B
63
S
23
G
7
Posts: 1,479
Reputation: 10,794

Post » Wed Dec 16, 2015 1:15 pm

@korbaach,
I sent you the capx of my whole project as a PM. The game is in space so you have to go to the planet next to the start and the ship will automatically land there :D . Then you leave the ship with F. There is a piece of wood on the planet and everytime you go over it, it adds 1 more wood to the inventory. With Tab you can open the Inventory and when pressing E and standing in front of the chest (the blocky thing on the planet) you can open it. The swap works for the first time I think. But when you try to swap it again, only the amount shows up and everything messes up. In the array it shows NaN (Not a Number?).
Sorry if my project is a little messy.
Thanks! :D
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Previous

Return to How do I....?

Who is online

Users browsing this forum: Apollo14, MaujDeveloper, totoe and 5 guests