[Plugin]Board, Layout2Board [Behavior] Grid Move

1 favourites
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • Is there anyway to set a value at points (0,0) like at arrays. I tried it with board instance or with hex tx instance.

    For x 0 to 9

    y 0 to 9

    add 1 to value

    then on button click It gives only sum (100)

    ------------------------------------

    With hex tx, I created a chess object. Then I tried to move it with grid move(hexagon) Up arrow is down, right arrow pressed It moves two squares right one square up, if two squares are available.

    dl.dropbox.com/u/56268958/hextx-test.capx

    It would be really great if somene could share hex tx example.

    Thank you

  • Spider_hip

    It looks like that you want to move twice since "Up arrow is down, right arrow pressed" will trigger both of

    "+ right arrow pressed" and ""+Up arrow is down, right arrow pressed". So that it move "Up-right" and "Right" at the same tick.

    To pick chess at logic (0,0) , you might use "condition: pick chess at logic XYZ". Then do something after picking.

  • My bad about movement. Thank you. I added inverted up-down arrows to solve that, and works like a charm now.

    Well actually I wanted to ask to set value to points, like "set value at" (arrays)

    Beceause I made something like this with arrays.

    dl.dropbox.com/u/56268958/neigbor-algorithm.capx

    And I pretty liked the result.

    First I randomly set values to all array points. Then for each xy, I look for neighbor values. %50 chanse to convert current point to neighbors sum.

    <img src="https://dl.dropbox.com/u/56268958/randomkomsu.jpg" border="0" />

    There are 4 green, 2 blue and 2 red neighbors. So mid square has a %50 chanse to convert to green. So it becomes like , continents at the end(with a 2-3 repeats).

    It's like this logic

    emanueleferonato.com/2011/05/13/flash-procedural-map-generation-example-land-and-water

    It divides squares. And gives chanse for child squares to look like mother square. But mine looks for neighbors. And looks like to them.

    I wanted to do smth like this with your beatiful board plugin.

    Sorry for my bad english.

  • Spider_hip

    The "array" is stored at each chess (cell) on the board. In this case, you might save the value at private value of each chess (cell).

    Just pick chess (cell) by condition/action: pick chess at LXYZ, then read the private value. (or you could present the value at frame index)

  • Update:

    • Change all download links
    • Now grid move behavior could move tile (z=0) since some users might ask me why grid move could not work. It might be easy to use in a small case which only have tiles on the board.
  • Hi All,

    I have a few questions regarding the awesome plugins created here.

    I'm working on extending the moving options demo. This is the one where you click a black chess piece then it shows you where you can move it etc.

    Is it possible to make the layer bigger, when using the board object plug in I can't get a 13x20 board to fit on the layer :-(

    I'm wondering is if I'm approaching this correctly.

    I want to have say 4 pieces for each player, so player one puts down 4 pieces (clicks on four empty squares) and then player two does the same.

    Should I set instance variables on the chess piece to mark it as being P1 or P2 etc. Then then anotehr Instance Variable for setting the piece type?

    Thanks for all your help the first problem is the one I'm struggling with the most.

    Thanks

    Chris

  • Finished reading the whole thread and it looks like some amazing stuff going on.

    2 questions.

    What is the easiest way to switch between movable chess tiles?

    At the moment I've saving the x,y to global variables then when moving I'm using the board to pick them and then moving

    Second questions is I've used the movement object to define the movable path then I move the piece but when I use inst->clean it doesn't remove my path tiles?

    Thanks

    Chris

  • stobbsc

    Uh, I'm not sure what's you mean "make the layer bigger".

    If you want to make a bigger board, just set the width and height at properties table of board object, or use "action:Set board width", "action:Set board height".

    About question 2, it depends on your design, these plugins did not handle the owner of chess.

  • Thanks Rex,

    I've managed to just add instance variables so I know what type of piece I'm working with and what player they belong to :-)

  • stobbsc

    To swap two chess, you could save one UID of chess, pick the other one, then use "action:Swap" in grid move behavior and put the first UID of chess in parameter. It will swap the logic index and physical position.

    If you want to move the chess by your self, you could use "action:Swap chess by UID" in board object, it only swap the logic index.

    About question 2, I'm not sure what's you means the "inst->clean". Uh... I did not remember I had made this action.

    The moving path is stored by UID of tiles. User just pick tile by these UID and do what they want.

  • Amazing thanks.

    Yeah I ended up using the move to grid option and storing the x,y position of the logical chess

    Is it possible to move diagnostically with the movement object (moveable path)

    Lastly is it possible to only highly the target destination of the moveable area, instead of the full path?

    for example if I you have 4 squares to move it only highlights the 4th square not the squares in the path?

    Thanks

    Chris

  • Try Construct 3

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

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

    Humm... one work-arond solution is --

    1. pick the move-able are with moving points = 4, stored the tiles UID in instance group named "rang4", for example

    2. pick the move-able are with moving points = 3, stored the tiles UID in instance group named "rang3", for example

    3. instance group object has "Action:A - B" -> "rang4" - "rang3", to pick tiles which in set "range4" but not in set "rang3"

  • <img src="http://dl.dropbox.com/u/34375299/Construct%202/bugs%20and%20fixes/SLGBoard%20error.JPG" border="0" />

    What this error means? It just start showing up without a reason when I want to use an action: Sprite: GridMove move to Tiles_prite

  • shinkan

    Uh, I'm not sure, please download the slg movement again... and give me the capx file which has problem.

  • It was working fine until I've changed position of my board tiles on the layout. Then this error starts to pop up. I tried to undo my changes and play a lot with different settings for width and high in LayoutToBoard and SquareTX but it didn't help.

    In the file below I've removed everything. All unnecessary layouts, layers, object and events.

    Here's the .capx

    It only works - but without moving sprite to target tile, when you disable

    Human_Detector: GridMove move to Tile in event 10.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)