Heroes4hire's Forum Posts

  • while

    width(local variable) <= tilemap.width+96

    width>0

    - value at (array value check local variable) =1

    arrayset value((array value check),0) to 4

    set (array value check) to (array value check)+1

    width(local variable) to width-1

    is my loop. it just freezes

    width=Tilemap.Width/96 at the start of the loop. (96 is a tile size so im getting how many tiles wide the tile map is)

    array value check, is the x coordinate in the array.

    im thinking it should, when a new tile is made; expanding the tileset(that works)

    to set the tiles in the tile map: run the while loop to check for each tile, compare what value the array holds at that position. if 1, then set the tile in the tile map. if 0. reset the tile.

    anyone see what i am doing wrong?

    i want to use an array like this, so if i add a tile to a left place, i can push all Y array values. moving the tile map. and maintaining the room layout.

    hope that explination doesnt make things worse..

  • i want each tile to be mapped from an array.

    the tile map grows when a new square is added. then i want the tiles to be drawn into the tile map from the array.

    i tried to make a function, where the tilemap width is set a local variable then i could just while loop it as long as the local variable is above 0. and -1 on each loop.

    but... construct literally came up with a box telling me "blow me" ...cant set a variable to anything but a number.

    ill get it, but everything i do makes me go back to the drawing board

    *edit* what i want, is a loop to check array for value =1. then set the corresponding tile

  • citron2010

    that used to be rojohounds job. ...7 years ago..

    absolote boss with math and anything cosign

  • glad you got ıt sorted bud

  • first, huge thanks to everyones advice! i went from no knowledge, to being able to recreate this effect.

    m00npunk, ill have a look at the extentions! it does seem reasonably straight forward (cant believe im saying that..)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • this is what im going for:

    so far. i have click 1 complete. click a tile. change the floor tile to a room tile, and spawn in a new tilemap overlapping the room tile.

    now im on click2. check for neighboring rooms. no problem, just x-1 to get the tile im checking. now i know there is a tile next to it. i can expand the tile map width... selecting the specific tile map is a concern. any ideas? even if its on spawn set a variable to the 1st click tiles x,y

    click 3 will get a new tilemap as a new room

    then

    click 4 will see there are 2 joining rooms. and will be tasked with deleting the tile maps, and expanding one to include all the room tiles.

    ah man... ill take a break and do some physical activity. im new at this and there are too many layers of planning.

    even if you know what this process is called, so i can look for guides, it would help. thanks

  • i want to be able to tell how big a room is, which can be built on a tile map.

    i thought flood fill would be an easy copy paste job... it may be.. but im looking at it without a clue what the terms are.

    loopindex("X")

    tiletopositionX(loopindex)

    for sure ill have a day on reading about it tomorrow. but if anyone can give me a brief introduction. not only would it be a huge step in the right direction, i could probably use it in multiple situations if it does what i think it does (how, i have no idea)

    howtoconstructdemos.com/flooding-a-dungeon-tilemap-capx-construct2-construct3

    is the flood fill example i am looking at

  • tested it. nope. as i thought. it just loops the gold adding to total.

    and.. that was just for one gold pile.. total just steadily climbs.

    hmm.. maybe i need a trigger, like gold added, or gold spent to set off the loop from 0 everytime.

    was hoping there was a simpler method is all. mostly as im about to flood fill tileset to get room sizes, so anything i do now may need to be redone

  • it checks a position on a circle around the block.

    in effect they pick the closest place they can go to from any angle. its for finding the path.

    distance(imp.x,imp.y,block.x,block.y) < radius is good to activate the digging when they are close enough. but, i just assume they are close enough on arrived, and rotrate them to the block on uid check to start digging.

    im getting them to walk to a block that is a solid. so its x,y coords are impossible to get to and i had to use radius

  • scale rate, perfect thanks.

    hope my simple questions arent annoying. its just things i make notes on and ask before i sleep

  • i was explaining loads about midpoints to work out where the box should be.. but..

    just make a box follow a group..

    can the box stretch? does the box have to interact with anything?

    you could just have each soldier in the hoard have a line between them.

    it would be a square.. not a solid one

    if it needs to be solid, there are ways to edit a tilemap using a brush that gives it a solid shape. that i know very little about, but did notice it as a new feature to c3

    let me know if we were on the right tracks with the square being at a midpoint. for can do it with hierarchy, as you can work out how many are in the hoard as you can count children

  • i have gold, it gets put in the treasure room. it tells me how much gold is in a pile i can pick up the gold, and drop it, it maintains its value. and gold stacks when overlapping.

    but, i want a total owned gold figure.

    i need to check each goldpile.goldinside that is overlapping a treasureroom; and add it up.

    any ideas on how i can check for total gold owned?

    i thought about for each goldpile. set GOLDinDungeon to goldpile.goldinside+GoldinDungeon

    but, will that only work once? do i need to make a function? and call it every time gold is added to a treasure room?

    any thoughts, or easier ideas are welcomed. thank you all

  • never tried it, love it. perfect thanks so much

  • i thought that was the whole point in the hoard box? to check the number of zombies inside!

    test it by having it static, and add zombies to it. to see if you can get it to count.

    then all you gotta do is set its location to the mid point using the math.

    thats the aim right? have a hoard box so zombies behave as a whole, then when 1 leaves the hoard they can act indipendantly.

    but whatever. was just trying to help

  • "i could use dictionary and insert a name line by line. then random(1,30) on the x axis."

    is what i said. but you cant insert name line by line in a dictionary; i used the dictionary to store up to 8 values on picking up creatures to memorise their name and hp. so on dropping them i just spawn a new one with the same stats and name.

    i meant array.

    *i could use *array* and insert a name line by line. then random(1,30) on the x axis.

    * sorry if i confused the matter!

    i havent stored anything yet. wanted to know the best way TO store names.

    using an array, ill have to individually put in the names.. and.. its 30 names for imps.. each creature will have 30 names. so ill have to add hundreds of individual names into an array. possible.. but oof, that will take a day just to do that.

    is there a better method to add 30 names, per creature type? like clipboard, where i can just type out all names, and pick a random line of text.

    not a hard task, just wondering the most efficient way to do it.

    ty as always lionz

    the effect is. each creature will have its own name