mekonbekon's Recent Forum Activity

  • Hi UlisesFreitas - I've noticed before that iOS devices can sometimes take a few seconds to load in Local Storage data. The way I dealt with this was to load in the data in the previous layout before moving to the new one, or covering the layout with a loading image that is only removed once the data is loaded.

    One thing to be careful of is loading Local Storage data in a loader layout. As I understand it (and if I wrong I hope someone sets me straight ) if a loader layout has run once it may not run again as the game has already downloaded, so the Local Storage "get" may not be called.

  • Cool, glad to be of help

  • Thanks for the solution.

    You're welcome

  • klabundee

    Aha! You're very welcome - glad you managed to find a fix : )

  • Just tried it myself and didn't have a problem creating a new 10x10 array file, editing and saving it. Have you tried replicating with a brand new project and seeing if it still occurs?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh dear...

    If you can replicate the bug I'd report it. As a workaround you can download the array json file, edit it in a text editor and then add it back into the project - that should get around any bugs in the array editor.

  • darkrealos Is this what you're after?:

    https://www.dropbox.com/s/6i6vf8f16wfnp ... .capx?dl=0

    I've added the function setArray for testing purposes.

    Tap the spacebar to trigger setArray, which resets the array, and then ResourceUpdates, which counts up the number of "ForestryHuts" in the array. No need for the ResourceBuildingCheck variable.

  • Cheers, glad you like it

    I've got some plans to improve it some more, once I get a chance. Probably going to stick to desktop for now as it makes the controls a lot easier.

  • Just realised we're in the C3 forum! You can use the built-in array editor to add data to the array:

    In the project bar, scroll down to the files icon, right click, select "New" and then "Array": this will automatically create an array.json.

    If you right click on this file and select "edit", the array editor will open and you can add the data directly.

    I think you will still need to import that data into an actual array object using the AJAX method linked above.

  • klabundee

    Ah, ok. In that case, I'd use the json and AJAX method - it'll be a lot quicker to create the arrays that way than setting up the data using individual actions.

  • Hi Laurent

    Have you set the Tilemap group to active? Right-click on the group bar, select edit and tick the "active on start" box, and it should work fine. You can disable the Speaker object group by unticking its box.

  • You can use a "for" loop to fill an array:

    For name: "i", start: 0, end: array.width-1 | Set array.At(loopindex("i"),0,0) to loopindex("i")

    This will set each (X,0,0) to the current loopindex of the "for" loop i.e. (0,0,0) (1,0,0) (2,0,0)...

    You can modify this for the other dimensions:

    For name: "i", start: 0, end: array.height-1 | Set array.At(0,loopindex("i"),0) to loopindex("i")

    For name: "i", start: 0, end: array.depth-1 | Set array.At(0,0,loopindex("i")) to loopindex("i")

    You can also use nested "for"loops to set multiple rows, e.g.:

    For name: "i", start: 0, end: array.width-1 |

    For name: "j", start: 0, end: array.height-1 | Set array.At(loopindex("i"),loopindex("j"),0) to loopindex("i")+loopindex("j")

    If you are planning on adding a lot of data to an array you can create a array.json text file and import that into your array object using the AJAX object. This tutorial helps explain:

    https://www.scirra.com/tutorials/1303/h ... nal-arrays

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

20/44
How to earn trophies