How do I push an array into an array?

Just started using Construct 2? Post your questions here

Post » Thu Mar 06, 2014 3:28 am

I'm trying to make an inventory system. I came up with a system in which an object contains 5 stats, and in order to store them in a 10-slot inventory, I would just push those 5 stats into a 10x5 array. Is this possible?
B
4
S
1
Posts: 18
Reputation: 388

Post » Fri Mar 07, 2014 2:15 pm

That's definitely possible. Just use a 10x5 array, as you said.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Fri Mar 07, 2014 6:39 pm

Thanks for answering! How would I do that exactly? What is the syntax for an array on the y dimension?

I know what doesn't work.

For example, I want to push 5 numbers on x0 from y0 to y4:

push on X [1,2,3,4,5]

or

push on X arrayExample.Y

I've read all the tutorials and instruction manual and they just don't seem very clear.
B
4
S
1
Posts: 18
Reputation: 388

Post » Fri Mar 07, 2014 10:37 pm

You may need to write your own 'push' function. I think C2's push function is only designed for 1D arrays.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Sun Mar 09, 2014 7:39 pm

Thank you. At least I have a clear answer now!
B
4
S
1
Posts: 18
Reputation: 388


Return to Beginner's Questions

Who is online

Users browsing this forum: FartsLolz and 5 guests