Array problem

Get help using Construct 2

Post » Sun Oct 19, 2014 6:16 pm

I have a system where you can pick up items, and their number representing them shows up in the first available empty cell in the inventory 2d array, which is 10 width and 5 height. I have a tilemap that represents the 2d array.

I'm doing the item going into the first empty (with the number 0) slot by finding the index number of the first 0. So then, I tried to make a system where the game finds out where the index number is on the array, in X and Y coordinates, and then put that number on the array. That's where I have a problem. I made 2 variables, "YIndex" and "XIndex", and the "Index" variables (I just made it to make the equations in YIndex and XIndex look less cluttered, I could as well have done ArrayName.IndexOf(0) without the variable "Index").

How do I make these variable do the right thing? Here's a capx, the weapons don't destroy on getting picked up on purpose.
You do not have the required permissions to view the files attached to this post.
Last edited by fassFlash on Tue Oct 21, 2014 10:54 am, edited 2 times in total.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Mon Oct 20, 2014 9:43 am

Bumperman
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Mon Oct 20, 2014 9:24 pm

Bump ball. Skyward Sword added Bump ball.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Tue Oct 21, 2014 10:55 am

How to bump threads:

http://www.youtube.com/watch?v=v3gn6-QaA8E

I'm sorry you had to see this
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Tue Oct 21, 2014 5:41 pm

Array.IndexOf only works in X. You can't use it for a two dimensional array.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests