[Solved]How do I transfer information from another array

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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 !!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)