mekonbekon's Recent Forum Activity

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

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

  • Try Construct 3

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

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

  • Not sure if this helps, but you can start oscillating at the new angle using timers:

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

    Timers also make it much easier to interrupt a behaviour than using Wait X seconds, by using the Stop Timer action.

  • It's the "Update Sine initial state" action that is stopping the behaviour restarting - not sure why though.

  • I think the difference is that move to XY moves to a specific co-ordinate whereas delta XY moves relative to the starting position.

  • Ah yes, of course, thanks

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    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
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies