[Solved]How do I transfer information from another array

Get help using Construct 2

Post » Sat Apr 23, 2016 9:14 pm

Good day everybody,
I have been working on a small game and came to a halt due to a small problem.
I have a map seen from above, on load it saves the instance UID of my first array (10x10).
When you reach the border it creates a new array with new tiles (again this instance UID is saved)

Let's say I move South, what I want is that all the values from my first array at (0,9) to (9,9) to be transferred to my new array at (0,0) to (9,0)
I am trying to get through that using the UID I saved from the first array, but without success.

It seems that the Pick instance with UID function doesn't always work. Here is the code:


When I disable the portion with "Pick instance with UID ChunkID_North", the code runs great as I can see the results of the single value being stored in the variable Value. I end out with the same texture along that border.

I hope I am clear enough...

Thank you in advance for the help :)
Last edited by Wicstar on Sun Apr 24, 2016 9:09 am, edited 1 time in total.
Posts: 22
Reputation: 1,109

Post » Sun Apr 24, 2016 6:42 am

I'm going to venture a guess that this has to do with not being able to pick a newly generated object until the next top level event.

Mistakes were made.
Posts: 1,802
Reputation: 68,504

Post » Sun Apr 24, 2016 9:09 am

OMG ! I love you !!!
I was unaware of this limitation.
I created a new global variable that goes 0 or 1 depending if the array already exist.

Then, I moved the whole process of finding the adjacent borders on the same level as the Create object arr_Map.... and TADA, it worked !

I can now move forward with a more natural generation of the landscape !
Thank you so much !!
Posts: 22
Reputation: 1,109

Return to How do I....?

Who is online

Users browsing this forum: IGDev, Tibolli, Zav and 13 guests