[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:

Image

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.
B
12
S
1
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.

r102-breaking-change-questions_p615230?#p615230
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

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 !!
B
12
S
1
Posts: 22
Reputation: 1,109


Return to How do I....?

Who is online

Users browsing this forum: Fradno, marcinkowski, tarek2 and 10 guests