How do I initialise an array and display its contents?

0 favourites
  • 4 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I've been trying and searching for about an hour - I'd like to initialise a one dimensional array (at creation of the scene) to have a value of -1 in each variable. But the actions after 'on start of layout' don't seem to include the capacity to have a for loop to do this?

    So how can I set the value of each array variable? I'm guessing construct is quite capable of doing this (as all programming languages are!), but how it wants me to tell it to do it full on eludes me!

    Also I want to show them on the screen - I'm guessing I'll use something like the shooter tutorials method, but any hints appreciated.

    In the end I'm using the array to represent days, each variable is a day and has the growth (in percentage) of a particular group of plants.

    Thanks for any help you can give!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm amazed that though I've done the top down shooter and the score text works in that for me, in a new project I've just tried to change a text to something else AND the code looks exactly the same and...it doesn't work???

    Every tick, set text to "Changed"

    Run it, just get "Text"!

    What the...!?

  • You can attach your .capx so we can take a look and more easily find the problem instead of guessing the problem

  • IIRC I'd started a new event sheet and at that point was unaware of having to include it in the first event sheet attached to the scene. So the commands on that event sheet did nothing. Thanks for the reply, regardless

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