Heroes4hire's Forum Posts

  • WackyToaster

    youtu.be/Q4hOhwigPjc

    got it to work using spites! sorry its a video on my phone. for the main game, everything is scaled up, so pathfinding is easier

    yes... digging ming and map done.

    building should be easy now

  • ok, so, i have a digging game. like dungeon keeper.

    imps break 3d blocks. and i want them to then go claim the ground once the block has been destroyed. (they can already dig)

    i used a tile map. with all the different floors and room floors. Right now, there are 3 floor types:

    ground, ground that can be claimed, and claimed floor.

    i have made it so only ground next to a claimed floor can be claimed, once claimed, the surrounding "ground" tiles become "ground that can be claimed" tiles (simple code. just on click change tile at x,y+1 etc)

    as any pattern can be cut from the rock, making the tilemap reactive. i will never specifically know which tile where is "ground ready to be claimed". (or.. maybe i can?..there isnt an option for "for each" tile. only "for each" tilemap)

    i half thought about running a loop to check each tile. but, that wont get me the nearest.

    i suppose... the imp will always be on a certain tile... so i could reference its x,y to the tilemap... claimable tiles will always be reachable... meh, again i cant pinpoint tiles that have a certain tile.... unless... i have a second tilemap that logs imps location, and have a flood function to check area around the imp... but, i would need a tileset per imp so checks dont overlap.... i .. could maybe just set it as the imps child...but at that point i have spawned in 30 tilemaps... maybe i would be better just spawning in a sprite on "ground that can be claimed" and have the imp go to the nearest sprite

    im running with the spawn in a sprite on "claimable tile" atm. then imps go to the sprite, start work and hoping the tile at imps location changes instead of using an on click event.

    hope this elaboration helps lol.. hope you can see my train of thought on ideas, and any input or suggestions you have would be appreciated!

  • newt

    oho! this is very good info! thank you so much!

    im completely new to zelevation! never tried layer to canvas. top man

  • You do not have permission to view this post

  • yeah, so i see. thanks for your thoughts. just had to work around it knowing its not a thing.

    i use a 3d highlight tool pinned to mouse position. just makes it clear which block is selected.

    2d selector that drags out. just hard to pinpoint what you are selecting on a 3d block.

    but, i could totally do a 3d selector tool! thanks for bringing this to my attention lol

  • i have a tile map that will only let you click on an adjacent block. once clicked, the surrounding tiles can then be clicked

    (red yellow green. red is no, yellow can be clicked, green has been clicked)

    i need this to run without clicking, but on a playerbase arriving.

    ill need the playerbase to be able to pick a path to the corresponding nearest tile.

    i could: spawn a sprite at each tile, once it changes tile type. delete it then i could just pathfind to closest sprite.

    but.. it will be a big map, potentially hundreds of these sprites. is there a more efficient way?

    Tagged:

  • BaconSwagg .

    can you help me again. how do i change a tile on the tile map by clicking on it?

    fyi, i post a ton of questions so i have info when i get to what im doing. basic programming done! time for building

  • thank you so much! had no idea

  • ive seen it before. cant see it now. how do i open the tilemaps tool bar please. so i can start tiling the tilemap.

    i read the manual for 30 minutes, cant find anything about opening it

  • C.x= A.x+R((B.x-A.x)/√((B.x-A.x)^2+(B.y-A.y)^2)

    for the X

    wow, it works beautifully and smoothly

  • yea, ok. actually not that bad.

    C is the point on the circle you want to get

    A is the sprite

    B is what will move

    R is the radius

    C.y= A.y+R((B.y-A.y)/√((B.x-A.x)^2+(B.y-A.y)^2)

    thought id update my post with an answer if others search for it

  • C⃗ =A⃗ +r(B⃗ −A⃗ )||B⃗ −A⃗ ||

    Where r

    is the radius of the circle. Works for points both inside and outside the circle. Imagine (B⃗ −A⃗ )

    to be a vector in the direction of B⃗

    and (B⃗ −A⃗ )||B⃗ −A⃗ ||

    thus is the same vector but with a length of 1

    . By multiplying it with r

    , you "walk in that direction" a total distance of r

    , thus reaching the circle.

    With coordinats A⃗ =(Ax,Ay)

    etc. this reads

    Cx=Ax+rBx−Ax(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√

    Cy=Ay+rBy−Ay(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√

    ooh boy... this will be fun

  • im moving to a sprite, but the spite has a 3d object over it. so, when pathfinding, its taking a longer route to what it deems as the best way.

    i would like to have a distance check

    i.e:

    set path to x= tile.x (+or- the radius to a closest point of the circumference)

    hope that makes sense. probably there is a sin function for it... ? or ill have to bust open some math research if no one has a script made

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • saying that. its a new day. and i have new ideas.

    couldnt i pin an invisible 3d block to mouse.

    Tried it. yeah, it highlights blocks well. if i could snap it to a grid....ahh problems for another day.

  • ROJO its been 9 years since i was here under name Aher0

    great to see you are still about. and still solving my problems.

    ill look into 3d ray cast!