Heroes4hire's Forum Posts

  • WackyToaster

    yes! that was my original angle, rojo advised me against arrays as a tile map is basically an array

    to his defense, i got it done with his advice. i could easily add an array for the floor map.

    so, im thinking: array checks main floor tilemap for a room tile.

    for each room tilemap add a z axis to the array.

    set its starting point in the array check to tilemap x,y /96(tilesize)

    then for each xy, compare to z in the array to find overlapping points...

    then i could set them to the same family.

    something along those lines.

    thanks for the advice, see how it goes ive been writing this for an hour and im already lost, but i have a guess now.

  • on created, i need a tilemap overlapping another one to make it a child,

    i need to know where this collection of blocks is. if there is another way, i welcome it.

    buuut, id done with rooms after this! ..well... the location and size.. ill need to make them work next ,:D

  • its working... its placing things perfectly, and its a tile map. ill need to merge them, or set a variable to show what room it is

    but its working!

  • mate, gimmi a shout and ill try it when im sober/ the morning

  • if you think i can flood fill an overlapping tilemap: then create a room from it. i am 100% down to try!

    i wanted to spawn a tilemap that had tiles set in the room. so i could pathfind to the room. and it would be eisier to choose a tile

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ok.

    exactly what i need:

    i want a room to be made that involves all connecting tiles.

    so when i pathfind: i can pick nearest room. then pick a tile.

    i.e on monster created: pick nearest room. pick tile that is free, make a bed.

    i.e: room is 3x3 food room. create chicken every 20 seconds

    i.e prison is 3x3: i0.wp.com/www.gggames.se/wp-content/uploads/2015/12/dungeon_keeper_4.jpg

    (amazed more people havent played dungeon keeper, i was a speed runner)

    You build a square. it is 1 room. you connect 2 squares. that becomes a room.

    sny squares connected are 1 room. if not connected, thay are a seperate room.

    on a map, you can see where each room is. so ill need a map that can read room locations.

    dungeonkeeper.fandom.com/wiki/Secret_1

    i couldnt rip the gif. its the first and only image.

    i could and will flood fill. to get an outline of the room. and i can set a variable to which player it belongs to (huge ambitions) ...mmm multiplayer, but enemies will need that.

    ok. where i am at now>

    just need to figure out spawn points. and merge existing sprites (that are the same room...)

  • well... its a mess. but working ish

  • i think ive got it.

    its not logical to me. but, its ending after 1 loop. so, i just need the ending of spawning the sprite to calculate the total accumulated values for up down left right.

  • re reading it as turns. not a point based move attack system.

    but still. that will give you "turns" 4 turns.

    just a solution to a posted problem. if you want them all to pathfind, thats a bit more in depth

  • what id do. give each player instant variables. set to the tile they are on at the start of the turn (tilex*(tile width))

    then, when move turn is over. and its battle turn:

    so work out how many tiles they moved by their current positional tile to the saved original tile variables.

    this will count as a direct route.. might not consider obstacles..

    then count this movement score from their action points.

  • on colision. set a variable "hit" to 1.

    then, pick by evaluate. robot.value+robot.hit=1

    pick nearest to robot: robot.x robot.y

    set value to 1.

    that way it will choose the specific robot that is in collision that has a value of 0

    not sure about turning off the "hit" maybe just every tick, robor is not overlapping robot, set hit to 0.

    the text box is set to specifically one robot. it stays 0 until the specific robot collides. it is its value that is shown.

  • ok. best way to describe it.

    just check up

    now with check right active also

    both are enabled

    but it will just do the first loop. it wont do multiple. THIS is what i mean by how do i do multiple loops,

  • i made it not transparent.. maybe that helps visualise it

  • loop ending isnt the problem. i can just slap on a repeat count like you say.

    this works. it goes through all x. on all lines. (left to right) and expands a sprite over tiles next to each other.

    but thats not the issue. in this image, the tiles are connected. it should all be the same "room"

    im getting close. but, i always hit a dead end. i hate that its so hard to explain.. im more hoping someone has done this before and can save me from this tourture.

    how many tiles right, how many tiles down. make sprite to cover it. this is the "room"

    i have some more ideas. if i get it to work, ill offer it up as an example to the forum..in hopes to save others from this pain

  • is the loop im working with. It freezes, so the loops arent closing.

    just to summarize it. its going through each tile y1-x1-,,,,x30 finding a value thats 4.

    then its checking each tile past that adding 1 to plusrightvalue to work out how many tiles are next to each other.

    then, its adding 1 to axisY to check on the next Y layer the same origional loop at y2-x1,,,,,,,x30

    honestly.. im winging this hard. im not competent in loops, hence my multiple poor descriptions.

    ANY help on multiple loops is deeply appreciated.

    im 4 days in on this. but when its done i can work on pathfinding. battles, and non imp digging jobs