[Plugin] slg_movement

Post your completed addons to share with the community

Post » Thu May 08, 2014 11:02 am

@istavang

The design of"check name" in layout is a protocol to check if the object is a kind of layout for board object, ideally.
If you want to create your own layout (for board object), just copy and modified from rex_board_squareTx plugin. And call "(board) action: Setup layout" to assign your custom layout.

But, no one had tried to make a custom layout yet.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Thu May 08, 2014 12:55 pm

rexrainbow wrote:@Vati-nyan

Each tile/chess is an instance (sprite, usually) which has UID for registering (put into) board object. So that this slg_movement plugin could go thorough tiles to get cost by condition.


Does that mean I have to manually set the cost of each tile after they have been placed on the board at start of layout? Since at first they are all the same. I'm not sure how to do this in practice.
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Thu May 08, 2014 4:23 pm

@Vati-nyan

You might place a private variable "cost" (or something else) for each tile/chess.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Thu May 08, 2014 7:17 pm

rexrainbow wrote:@Vati-nyan

You might place a private variable "cost" (or something else) for each tile/chess.


Instead of having the code set up the tiles automatically at the start, I tried drawing it manually and then include all tile objects in a family. Then use it like this instead of the tile sprite:

Image

Would that work then? As a way to have different terrain types.
My own attempt didn't do much, but that is possibly because I tried doing it with the Tilemap object. Would I have to put in each square of the map as sprites? Or am I completely off the mark? :P

Sorry for all the questions! I like this plugin a lot, and would love to understand it better.
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Fri May 09, 2014 3:26 am

@Vati-nyan

I thought Tilemap is a single object for all (virtual) tiles, you only could get 1 uid from tilemap, and I don't think that tilemap could assign private varialbes for each tile.

To place tiles manually, you might try
- layout2board plugin , it could create orthogonal or isometric, or hexagonal board.
or
- txm importer v2 plugin for tiled map editor
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri May 09, 2014 9:11 am

rexrainbow wrote:@Vati-nyan

I thought Tilemap is a single object for all (virtual) tiles, you only could get 1 uid from tilemap, and I don't think that tilemap could assign private varialbes for each tile.

To place tiles manually, you might try
- layout2board plugin , it could create orthogonal or isometric, or hexagonal board.
or
- txm importer v2 plugin for tiled map editor


I used Layout2board, and it works nicely for making the board! I don't know why I missed that before, I must have mixed up the names.

I have one last question for now though! I've made the board with that plugin, and moving around it while including all tiles in a family works just fine. I still haven't managed to get move costs to work properly though - for now the move cost function still looks like this:

Image

I guess it's not properly picking up what tiles it should?

Thanks so far for being patient and helping out :)
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Fri May 09, 2014 10:38 am

@Vati-nyan

This slg_movement plugin will try to move to neighbors, it will ask the cost of target tile by "cond:on cost function" and pass exp:TileX, exp:TileY, or exp:TileUID to let user return cost by these info.
You could dump the (exp:TileX, exp:TileY) under "cond:on cost function" by action:log in browser object, to see the trace of moving.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri May 09, 2014 10:41 am

@Vati-nyan

BTW, be careful that the overlaping of tiles instances in layout editor, the overlaping tiles will be kicked out of board object, since there is only 1 tile/chess could be placed in a logical xyz position.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri May 09, 2014 2:55 pm

Alright, I will see if I can figure out how to get the target tile that way. And I will keep the point about the tiles in mind!
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Fri May 09, 2014 3:48 pm

@vati-nyan
The simplest way is Condition Pick by uid
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Axiomaltd and 2 guests