Introduction

The board editor is where you can define the look and feel of your board.

Basic Operations

  • Click on “My Boards” to see boards you own
  • Click on “Create New” to make a new board

Board Settings

Boards use CSS Grids for layout. Grid Template Cols and Grid Template Rows refer to its grid-template-columns and grid-template-rows CSS values, respectively.

Creating Board Areas

Once the grid has been set up using board settings, you can create a selection by click on two diagonnaly opposing corner cells of the board area.

For example, say you have a 3x3 grid, and you want to create an area spanning 1-2 both horizontally and vertically (so a 2x2 area). You could click on (1, 1) and (2, 2), or you could click on (1, 2) and (2, 1).

Any two clicks on the preview grid creates a selection. To cancel a selection, just click on any cell (which starts the next selection).

Once a selection has been made, the “Create Board Area” button will be enabled.

Editing Board Areas

You can select a board area either by clicking on its preview or by going to the “Board Areas” tab and finding it in the list.

Once a board area has been selected, you can configure it using the board area editor.

Scripting

  1. Most text values are scriptable. Scripting allows the value to be dynamically evaluated according to the game state.
  2. To create a dynamically evaluated value, start with the special character $. The continuous block of characters from $ until the next space will be evaluated as a script.
  3. The script is broken up into “words” using the period (.) delimiter.
  4. The first word determines the type of statement, and subsequent words are operations or parameters that modify that statement.
  5. The following types of statements are available for scripting

OPPONENT keyword

Expects: 2 subsequent words, followed by operations.

Example: $OPPONENT.0._draw

Evaluation: returns the player name of a given opponent. $OPPONENT.0. finds the next opponent after the user in play order, $OPPONENT.1. finds the opponent after $OPPONENT.0, and so on.

For example, in a three player game, the player_order as defined by the game spec is ['player_0', 'player_1', 'player_2']. The user has sat down as player_1. Then $OPPONENT.0. evaluates to the string player_2 and $OPPONENT.1. evaluates to player_0.

The next word is concatenated. So $OPPONENT.0._draw would evaluate to the string player_2_draw (which might be the name of a container you want to access).

MY keyword

Expects: 2 subsequent words, followed by operations.

Example: $MY._draw

Evaluation: returns the user’s player position.

For example, in a three player game, the player_order as defined by the game spec is ['player_0', 'player_1', 'player_2']. The user has sat down as player_1. Then $MY. evaluates to the string player_1

The next word is concatenated. So $MY._draw would evaluate to the string player_1_draw (which might be the name of a container you want to access).

Operations

eval_prop: evaluates the current statement up until this operation, if the resulting string is a PROP in the game state, return the value of that prop.

map_to_user: evaluates the current statement up until this operation, if the resulting string is a player name in play_order in the initial state JSON, return the user name for that player.

SWITCH keyword

Syntax:

$SWITCH.(switch_expression).WHEN.(expression).THEN.(expression).WHEN.(expression).THEN.(expression).ELSE.(expression).END

Evaluation: evaluate switch_expression and compare it to all expressions after WHEN. If a match is found, the statement evaluates to the corresponding THEN expression. If no match is found amongst the WHEN``s, the statement evaluates to the ``ELSE expression.

Example:

$SWITCH.MY..WHEN.white.THEN.f8.WHEN.black.THEN.f1.ELSE..END

Note

SELECTED is a special keyword that evaluates to true if 1. On Click is select-or-message and 2. the current board are has been clicked (“selected”). See the next section on how this mechanism works

Note

Quotes (") are used to notify the system that the enclosed string is to be unescaped. Underscores (_) are used to escape spaces (which would otherwise end the statemtn). So the last example above, when the current board area is selected, would evaluate to 2px solid #FFFEAA.

selected_board_area keyword

Evaluates to the selected board are when On Click is select-or-message

CONTENT keyword

Evaluates the current board area’s Content value.

Non-keyword

If a word does not match any of the above keywords, it is treated as a string literal and returned as is

Example:

$game_over.eval_prop

Evaluates the game_over prop in the game state.

On Click

This field specifies what happens when a user clicks on the board area. The following modes are possible:

Message (message)

On click, the evaluated string is sent to the backend as a message.

Select/Message (select-or-message)

The first click makes a selection, and the second click triggers a message.

Example: for chess, you need to specify two positions for a move, one for the starting position and one for the target.