Tsardall's Recent Forum Activity

  • So using an array would be the best way. Does this method also works with multiple colour expending? So the same situation but instead of only one red patch there would also be a blue and a yellow one.

    Also how do I do I define "valid locations" since the map will evolve the valiud locations will also change.

  • Exemple:

    So in this case, I need to pick a random tile (every few seconds) around the red tiles and change them to red. and this until there is no more place for red tiles to spread.

    Thank you

    Tagged:

  • How do I check adjacent tiles when one is clicked? Can I do mouse(x,y)+10 (and after) -10 and after convert it into tile position?

    But I dont need all the adjacent to be of the right tiles

  • But I can't compare the position of the tiles since it could be any tiles, no specific values.

    So I can't replace "A" and "B" with numbers in:

    distance(Tilemap.TileToPositionX(Ax), Tilemap.TileToPositionY(Ay), Mouse.X, Mouse.y)<(32*1.5).

  • So I already made something similar but with sprites but couldn't figure out how to do it with tiles.

    In the image below when the button is active, the player can only paint the "tiles" that are directly adjacent to the blue "tiles".

    Is it possible to do the same with only a tilemap or will I also need other objects like an array?

    Thank you,

    Tagged:

  • I got this to work:

    It just change the tiles colour if the value of the array=0 at same tile position in the array using positiontotileX(mouse.x)&positiontotiley(mouse.y) And its bugged when condition on "every tick" it just colours a big square in the tilemap.

    But now I would need to do the contrary, set an array value when tile=0 (colour)

    And do I have to always rely on a specific position in this case (mouse.x,y) to change an array value? I would like to do like:at (tile.x,y) which i can’t figure out how.

    Also any tutorials online on how to use tilemaps with arrays? please

  • I can<t do all tiles manually, I would need to do something like this: Everywhere where there's a white tile, set the value of the array to 1. (at the same coodinate in the array for each)

    Is there a way to simply do: whatever the position if tile white set value of the array to 1 at the same position in the array?

    I tried to loop each tile to check if they are white but this just takes too much power, so I have to use specific coordinate like (mouse.x;mous.y) and convert it to tileposition which I won't be able to rely on later in my project.

  • Thanks a lot for the help, I understand It better now. 🙏

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried doing something that would pick up the position of each tiles at start of the layout.(doing it manually would be way too long) but it doesnt work, only the "set size of the array" event works. I think there's something wrong with my loops too.

    I have never worked with arrays before and tilemaps so I am completly lost.

  • My tilemap is iregular its not a 100x100 (like the picture above), Also are there tutorial about using arrays with tilemaps, i haven<t found any and it owuld really help.

    Ok thank you a lot, I will try something again.

  • There are several ways to do this.

    How many values do you need to store for each tile? Will the set of values be the same for all tiles, or different? For example, water tiles will have "depth" value, ground tiles will have "walk_speed" and "solid" values etc.

    Will there be many tiles without any values? You can think of a Tilemap as a 2D array, which stores tile type (ground, sand, water, rock). So you don't have to store this info in the array.

    Do you need to store the array with all these values in the project, or will it be randomly generated in runtime?

    1. I would need to store about 4 variables For each tiles that would change independently during the game on certain condition

    2.The values won’t be random

    I want to do something line this for the tiles variable:

    (Ownership: unowned or country1 or country2)

    (State: Incorporated or non-incorporated)

    (And finally a variable that update if for exemple a blue tile is near an other tile mark as Unowned)

    🙏

    Also if I set an array the same size if the tilemap and sub-divide it by each tiles will it store these values as if they where « in »the tiles?

  • I've had trouble using arrays before and found a lot of information on how to use it with a Tilemap and what it can do.

    I think it can store information relating to a position? But that's about it.

    Could a array make each tile act as a unique object when it comes to information? For example, can each tiles store separate variables?

    If yes, how can I set an array with my tilemap if the tiles are not place uniformly:

    Thank you,

Tsardall's avatar

Tsardall

Member since 13 Jun, 2021

None one is following Tsardall yet!

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies