Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_chess

Plugin, ACE table, Discussion thread
Dependence: None

Introduction
This plugin provides some helper methods to get logical position of chess, or to pick chess, or to move chess, etc.

Usage
Add and remove
  • "Action:Add chess" could add chess to a board object.
  • "Action:Remove chess" could remove chess from current board.
Move
These actions only could change the logical position, not physical position.
  • "Action:Move chess", or "Action:Move chess by UID" could move this chess to target tile, the logical z index will not be changed.
  • "Action:Move chess to xyz" could move chess to specific logical position.
  • "Action:Swap chess by UID" could swap the logical position with other chess.
Get logical position
"Expression:LX", "Expression:LY", and "Expression:LZ" could be used to get the logical position (x,y,z).
Get board UID by "Expression:BoardUID", return (-1) if chess is not in any board.
Get other chess's UID
"Expression:LZ2UID" could be used to get other chess's UID which stand on the same logical XY position with specific z-index.
"Expression:DIR2UID" could be used to get UID of neighbor chess, return (-1) if no chess picked. The code direction could be get in layout plugin (rex_board_squareTx, or rex_board_hexTx). User could add add 2nd parameter to indicate the z-index.
Test conditions
These test condition would return true if testing pass, these condition will also affect the current SOL.
  • Logical position: "Condition:Compare LX", "Condition:Compare LY", and "Condition:Compare LZ" could test if the logical position is matched the conditions.
  • Is empty above: "Condition:No chess above" will return true if no other chess above this chess. i.e. the count of z-index is 1. "Condition:No chess at LZ" is used to test if these is no other chess at the specific z-index.
  • On the board: "Condition:On the board" could be used to test if this chess is at the specific board. It might be useful if there has more then one board objects in project.
  • Are neighbors: "Condition:Are neighbors (UID)" could be used to test if this chess and other chess are neighbors.
  • Is a tile: "Condition:Are neighbors (UID)" could be used to test if this chess is a tile (z=0).

Examples
Pick an empty cell randomly
Sample capx
Mix "Condition:No chess at LZ" with other test conditions and finally pick a chess instance randomly by "system action: pick random instance".
Drag tile/chess on an isometric board
Sample capx

Swap chess from two different board
Sample capx

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About