SuperV's Recent Forum Activity

  • Have an event that says...

    When Tile('Type') = 1 Then set Colour Filter to GREEN

    Then, in-game, for example, click on the tile to change his type. The colour filter doesn't change.

    Can we have an hotfix? I need this badly for my project.

  • Alright, I pulled together an example showing how it all works. It includes a sample level and a fairly extensive read-me. I hope this can solve your problems.

    Array Example

    Thank you man! You solved lots of problems!

  • The A and P would only be recognized if you wanted them to be. As you have it now, it will only create pieces if the current cell is equal to that pieces identifier. You don't have it looking for -1, so it will skip over them. Likewise with the P and A, they will only be recognized if you want it to recognize them, otherwise they are merely there to store the information you want.

    Then how can I exclude P and A from "For...each cell" loop?

    Anyway I'm going to sleep, if you can, could you kindly make me a example? Not based on the editor, even from scratch.

    See ya tomorrow.

  • What I'm suggesting means you can still have a 16x16 grid to store additionaly information -- such as the author and player starting coordinates -- Basically, the -1 values wouldn't be recognized as a piece, so the spaces with -1 as the value wouldn't have any tiles. There would still be plenty of space for author name and starting coordinates. Example array to illustrate the point:

    2222222222222BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2111111111112BBB

    2222222222222BBB

    BBBBBBBBBBBBBBBB

    BBBBBBBBBBBBBBBB

    BBBBBBBBBBBBBBAP

    2 = Wall

    1 = Grass

    B = Blank space, represented by -1

    A = Represents author name

    P = Starting player Coordinates

    I hope that better illustrates the idea behind it.

    So the "B"s won't be recognized in the For each elements...

    But the A and P will always be counted, and those aren't part of the gameplay

  • I can't really make an example since I don't have access to your level editor code, and I couldn't seem to modify my own to work with it. But all you really have to do is this:

    In the level editor, at the start of the layout, have the array clear all of it's values to -1(or some other number that doesn't interfere with anything). This means that the base value of the the map will be - 1, so anything you don't fill with another tile will be left blank. Then, just fill the 13x13 grid that contains the level, and all should work fine. Hope this helps.

    But I need 2 other array values for the author of the puzzle and the player starting coordinates... I don't really want to have 2 arrays for each level

  • In that case, you can make the default cell value -1. This will make it to where all cells where you don't specify a value will be left blank.

    Can you show me an example?

    Is there any way I can do a "controlled" for each between x;y and x;y?

  • I can't do that, because I use 13x13 as the Author field and 14x14 and 15x15 as the player X,Y starting location. The array loop loops through them, and creates additional squares.

  • O-oh. Thank you. I will now try as you said

  • I'm not good at array loading.

    http://upload.namelezz.net/downloader.p ... LawnB1.rar

    ^ This is the game

    Basically to see the problem extract "LawnMowerB1" and start it. Then press the "Start" button.

    The loading misses some tiles

    I've included also the editor...

    Please help!

  • What about the depth? 0 or 1? Help

  • As it stands, the array is 0-based, so a 10x10 array would have elements 0-9. I think this should be changed to be 1-based. Do you agree?

    I absolutely disagree. Everyone that ever programmed something, even in Visual Basic, will except a 0-based array. I was just asking

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is a 13x13 array in reality a 14x14 array? Or Construct automatically counts the 0?

    Does the array counting starts from 0?

    Should the depth be 1 or 0 for a 2d array?

SuperV's avatar

SuperV

Member since 16 Jun, 2007

None one is following SuperV yet!

Trophy Case

SuperV has no trophies yet!

How to earn trophies