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

rex_ngio_scoreboard

Plugin, ACE table, Discussion thread
Dependence: rex_ngio_authentication

Introduction
Handles loading and posting of high scores and scoreboards.

Prepare
Put rex_ngio_authentication into project, and set App id and AES key.
Usage

Manage boards
Manage score boards in the dashboard of "API Tools" -> "Scoreboards".
Board ID
Board ID will be shown at dashboard. Put this value into property "ID", or set by "Action:Set board ID". This board ID will be used for posting score or get scores of a board. Read current board by "Expression:BoardID".
Each rex_ngio_scoreboard object is responded to a board, designer can put many scoreboard object for each board.

Get boards
Sample capx
Call "
Action:Get boards" to log all boards of this application.
  • "Condition:On get boards" will be triggered while get boards. Dump these boards as JSON format by "Expression:BoardsAsJSON".
  • Otherwise "Condition:On get boards error" will be triggered, get error message by "Expression:ErrorMessage".
Retrieve boards
Retrieve boards by "Condition:For each board", get properties of each board by "Expression:CurBoardName: board name", "Expression:CurBoardID". Index of the for each loop is "Expression:LoopIndex".
Or get properties of a board by index "Expression:Index2BoardName( index )", "Expression:Index2BoardID( index )".

Post score
Sample capx
Follow these steps to post score on a board -
  1. Login and set board ID in property "ID" or set by "Action:Set board ID"
  2. Call "Action:Post score" to post score.
  3. "Condition:On post score" will be triggered while posting success. Get posted board ID by "Expression:BoardID". Otherwise "Condition:On post score error" will be triggered, get error message by "Expression:ErrorMessage".
Tag
Add a tag before posting by property "Tag" or by "Action:Set tag", which can be used to filter while getting scores.
Get current tag configuration by "Expression:Tag"

Get scores
Uses one of these actions to get scores from a board which set by property "ID".
Get scores from start index
Call "Action:Request in a range" to get scores from start index with amount of scores.
"Condition:On get scores" will be triggered while getting score. Get posted board ID by "Expression:BoardID", otherwise "Condition:On get scores error" will be triggered, get error message by "Expression:ErrorMessage".
Get scores page by page
Call one of these actions to get scores page by page
  • Action:Turn to page
  • Action:Update current page
  • Action:Turn to next page
  • Action:Turn to previous page
Amount of scores in each page is set in property "Lines".
Get current page index by "Expression:PageIndex".
Receive scores
"Condition:On get scores" will be triggered while getting score. Get properties by these expressions-
  • Expression:BoardID: Requested board ID
  • Expression:ScoresAsJSON: scores in JSON string
  • Expression:StartIndex: start index of scores
Otherwise "Condition:On get scores error" will be triggered, get error message by "Expression:ErrorMessage".
Retrieve scores
Retrieve scores by "Condition:For each score", get properties of each score by these expressions -
  • Expression:CurUserName: user name of a score
  • Expression:CurUserID: user ID
  • Expression:CurFormattedValue: formatted value of a score
  • Expression:CurValue: integer value of the score
Index of the for each loop is "Expression:LoopIndex".
Or get properties of a score by index
  • Expression:Index2UserName( index )
  • Expression:Index2UserID( index )
  • Expression:Index2FormattedValue( index )
  • Expression:Index2Value( index )
Period
Set time-frame before getting scores by property "Period" or set by "Action:Set period" or "Action:Set period by code".
Code of periods are -
  • "D"=current day,
  • "W"=current week ,
  • "M"=current month,
  • "Y"=current year,
  • "A"=all-time.
Get current period configuration by "Expression:Period".
Tag
Filter tag is set in property "Tag" or "Action:Set tag". See previous section "Tag" under "Post score".

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