Array object

This forum is currently in read-only mode.
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hello, one more post from me

    Anyway, now i trying to learn on the array object.

    I'm trying to make a simple nonogram game and well i'm having some problems regarding the number system on the sides. If you are not familiar with the type of game you can see it here : http://en.wikipedia.org/wiki/Picross

    The problem is adding the numbers together.

    For example if the blocks are "0 0 1 1 0 1 0 1 1 1" it should read out "2 1 3" but there is a glitch in my calculations. There are two .caps in the zip and one array that can be loaded.

    In one of the caps i'm only trying to get the number system to work.

    In the other one the cells are made and the textboxes, all marked with rows, colums and x.y in the variables.

    Here are the files:

    http://internet.is/eski/nonogram.zip

    I havent found much info about the array object so i thought i would ask.

    Also, in the debug why does it only show one row for the array object though the list is 10x10x1 or 100x100x5 for that matter.. ?

    Anyway i would appreciate any comments on this matter.

    So far the people here on the forum have been really nice and quick with responses and help.

  • Also, in the debug why does it only show one row for the array object though the list is 10x10x1 or 100x100x5 for that matter.. ?

    I think it's just for practicality, since dumping thousands of items in to the list for all elements might be inconvenient.

  • Yeah i understand.

    At first i thought it was something that i did wrong, but then i saw that the array worked like it should despite that the debug said otherwise...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aaaaanny input.. would love it

  • Sorry to bump this up again but i am going NUTS, i just dont get how to do this...

    If anybody has a clue, doesnt even have to help me with the codeing just point me in the rigth direction.

    Should i use arrays for the boxes to tick in ? Can i connect them somehow with the number system ?

    The problem with the number system is that it doesnt calculate right if the last number is 1.

    Basicly what i have on the number system is this.

    +checked = 1

    - counter + 1

    +checked = 0

    - textbox = textbox.text & counter

    - counter = 0

  • To solve the problem you're having with the last number, you can use regular "For" loops and then check to see if you've reached the last iteration of the loop, adding the current number if you've reached the end. Here's an example(be sure to extract it with the array file):

    Picross Array Thingy

    I hope this helps some.

  • yah, that definitely helped.. i'm understanding this better, of coz use a for loop..

    Its just the whole picture now.. Trying to connect the number system to the boxes(or the array).

    Can i take one line in the array and copy the values to a textbox ?

    Like if i could take the top row and put it in a box then i have a string that i can work with.

    Same with the columns. Anyway i cant find or think of the way to do it.

    Another thing.

    When you have 2 for loops and they both loop 10 times, does the first one finish before the second one starts ? If so, i cant use the loopindex of first loop in the second loop.. ?

    i was trying to do this, dont remember why though (trying alot of methods go get this to work) and the loopindex return -1.

  • Alright, this CAP file should answer any remaining questions you have about this(once again, be sure to extract it):

    Picross Square Number Finder Thingy

    The trick to it is using nested loops to loop through the array; that is, you start a loop inside of another loop through use of a sub-event. This allows you to check column by column or row by row depending on whether you loop through starting with the X or Y axis first.

    Once again, I hope this helps.

  • Alright, this CAP file should answer any remaining questions you have about this(once again, be sure to extract it):

    Picross Square Number Finder Thingy

    The trick to it is using nested loops to loop through the array; that is, you start a loop inside of another loop through use of a sub-event. This allows you to check column by column or row by row depending on whether you loop through starting with the X or Y axis first.

    Once again, I hope this helps.

    I dont believe it, i was really close to the right solution, the for loops were little off..

    But i didnt really get it though i was doing it myself..

    i will have to write this thing up on a big teachers table to get how it works.. the for loops are really messing up my head..

    but on the other hand, you got some skillz.. i mean.. did you have to ponder on this ?

    i have been spending some seriously hours on this thing

    and also.. A BIG THANK YOU for this.. nicely set up .cap with explanation... SUPER

    finally i can continue..

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