Store the logical position of chess, based plugin of my board-series plugins/behaviors.
Categories > Board > rex_boardIntroductionLinksDependenceUsageConfigure boardSetup layoutSizeLogical positionCreate chessAdd tilesRemove/Destroy chessClean boardRetrieve cellsOn the boardMaximum or minimum of logic X, logic Y of all chessMove chessSwap chessKicked chessLogical overlappingEmpty cellGet empty cellSOLPick all chessPick chess according to logical positionPick chess above tilesPick neighbor chessPhysical or logical positionLogical position and chess UIDZ-indexGet physical positionPhysical position to logical positionWrapString symbol chessInfinity boardSave & load
Puts one of board-layout plugin into project. Each board object should have a board-layout object.
Action:Setup layout
to assign board-layout object manuallyProperty Width
and Height
, or Action:Set board width
, Action:Set board height
Expression:BoardWidth
, Expression:BoardHeight
Each chess or tile has a logical position (x,y,z). Each logical position only could have one instance (chess or tile).
x , y : number
board.width
-1board.height
-1z : number or string
Action:Create tile
Action:Create chess
Action:Create chess above tile
, orAction:Fill tiles
, to fill all tiles on boardThe created instance will be put at the right position directly.
X at (0,0)
, Y at (0,0)
in layout plugin (rex_board_squareTx, or rex_board_hexTx), if the created chess does not appear.Action:Add tile
Action:Add chess
, or Action:Add chess by UID
These actions would not change the physical position of instance.
Remove chess automatically, after instance destroyed
Remove chess without destroying instance
Action:Remove chess
Action:Remove chess by UID
Remove chess and destroy instance
Action:Destroy chess
Action:Reset board
Condition:For each cell
Expression:CurLX
, Expression:CurLY
) Condition:For each LZ at LXY
Expression:CurLZ
Condition:On the board
, returns true if the chess instance is on the board.Expression:MaxLX
, Expression:MaxLY
)Expression:MinLX
, Expression:MinLY
)Move logical position of chess
Action:Move chess
Action:Move chess by UID
Action:Move chess to xyz
Action:Move chess to xyz by UID
Action:Move chess to z
Swap logical position of two chess
Action:Swap chess by UID
The chess will be kicked after chess created/added/moved, since each logical position only could have one chess.
Condition:On chess kicked
will be triggered when chess kicking, to pick kicked chess.
Mostly, the kicking should not happened, therefore this condition might be used for debugging during development stage.
To avoid kicking, user could assign z-index of each chess by its uid .
For example,
xxxxxxxxxx
"#"+chess.uid
So that all z-index of chess will be different.
Condition:Is overlapping
, returns true if chess are overlapping with the same logical (x,y) position. The z index of these chess will be different. Condition:On chess kicked
, if the z-index of these chess are the same, see previous section.Condition:Is empty
Condition:Is occupied
If a logical position is not in the board, these two conditions will return false.
Sample capx , Sample capx (on tiles)
Condition:Has any empty cell
, Condition:Has any empty cell on tiles
Expression:EmptyLX
, Expression:EmptyLY
)Condition:Pick an empty cell
, Condition:Pick an empty cell on tiles
Expression:EmptyLX
, Expression:EmptyLY
)There has another way to pick an empty cell, see the section of Examples
in rex_chess.
Pick all chess
Condition:Pick all chess
, Action:Pick all chess
Pick specific type of chess
Condition:Pick chess
, Action:Pick chess
Pick a chess at specific LXYZ
Condition:Pick chess at Logic X,Y,Z
, Action:Pick chess at Logic X,Y,Z
Pick all chess at specific LX, LY, or LZ
Condition:Pick chess at LX
, Action:Pick chess at LX
Condition:Pick chess at LY
, Action:Pick chess at LY
Condition:Pick chess at LZ
, Action:Pick chess at LZ
Pick chess at specific LXY
Condition:Pick chess at Logic X,Y
, Action:Pick chess at Logic X,Y
Condition:Pick chess inside a square
, Action:Pick chess inside a square
Pick chess above based tile.
Condition:Pick chess above tile
, Action:Pick chess above tile
Condition:Pick chess above tile UID
, Action:Pick chess above tile UID
Parameter UID
number, for single chess
JSON string, for multiple chess. For example,
xxxxxxxxxx
"[300,301,302,303]"
from instance group plugin's Expression:GroupToString
Condition:Pick neighbor chess
, Action:Pick neighbor chess
Parameter Direction
Expression:DIR2UID
, get the UID of neighbor chess by origin chess and direction
Condition:Are neighbors (UID)
, returns true if two chess are neighbor.
UID --> LX, LY, LZ
Expression:UID2LX
Expression:UID2LY
Expression:UID2LZ
LXYZ --> UID
Expression:LXYZ2UID
UID, LZ --> UID
Expression:LZ2UID
, get the chess at a z-index above a chess. i.e. the same logical (x,y) but different z-index.LXY/UID --> amount of chess at LXY
Expression:LXY2ZCn
, Expression:UID2ZCnt
LXY/LXYZ/UID --> PX, PY
Expression:LXY2PX
Expression:LXY2PY
Expression:LXYZ2PX
Expression:LXYZ2PY
Expression:UID2PX
Expression:UID2PY
PXY --> Align PX, Align PY
Expression:PXY2NearestPX
Expression:PXY2NearestPY
Condition:Point is in board
, returns true if the physical position is inside board.
PXY --> LX, LY
Expression:PXY2LX
Expression:PXY2LY
Set property Wrap
to Yes
, or Action:Set wrap mode
Sample capx A chess is an instance, or replaced by a unique string symbol to reduce the amount of instances.
Call Action:Add chess by UID
to add a string symbol into this board.
Although string symbol is not a real instance, it still could use these expressions
Expression:UID2LX
, Expression:UID2LY
, Expression:UID2LZ
)Expression:LXYZ2UID
, or Expression:LZ2UID
Expression:UID2PX
, Expression:UID2PY
)Expression:PXY2UID
Sample capx
Set property Infinity
to Yes
Wrap
mode is ignoredAction:Fill tiles
.It supports official saving & loading feature.