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

rex_ngio_medal

Plugin, ACE table, Discussion thread
Dependence: rex_ngio_authentication

Introduction
Handles loading and unlocking of medals.

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

Mange medals
Mange medals under the dashboard of "API Tools" -> "Medals".
Get list
Call "
Action:Get list" to get medals list.
"Condition:On get medals list" will be triggered while get list, read list in JSON string by "Expression:MedalsAsJSON". Otherwise "Condition:On get medals list error" will be triggered, get error message by "Expression:ErrorMessage".
Retrieve medals
Retrieve medals by "Condition:For each medal", get properties of each medal by these expressions -
  • Expression:CurMedalName
  • Expression:CurMedalID
  • Expression:CurMedalIcon
  • Expression:CurMedalDifficulty
  • Expression:CurMedalDescription
  • Expression:CurMedalValue
  • Expression:CurMedalIsSecret - return 1 if this medal is secret
  • Expression:CurMedalIsUnlocked - return 1 if this medal is unlocked
  • Condition:Is secret
  • Condition:Is unlocked
  • Condition:Compare difficulty
Index of the for each loop is "Expression:LoopIndex".
Or get properties of a medal by index
  • Expression:Index2MedalName( index )
  • Expression:Index2MedalID( index )
  • Expression:Index2MedalIcon( index )
  • Expression:Index2MedalDifficulty( index )
  • Expression:Index2MedalDescription( index )
  • Expression:Index2MedalValue( index )
  • Expression:Index2MedalIsSecret( index ) - return 1 if this medal is secret
  • Expression:Index2MedalIsUnlocked( index ) - return 1 if this medal is unlocked
  • Condition:Is secret
  • Condition:Is unlocked
  • Condition:Compare difficulty
Load user icon
Medal icon might not load into sprite directly because "Access-Control-Allow-Origin" in server. Designer might try to load icon to image element by Pode's plugin.

Unlock
Call "Action:Unlock" to unlock a medal by medal ID.
"Condition:On unlock medal" will be triggered while unlock medal success, read this unlocked medal by "Expression:LastUnlockedMedalID".
. Otherwise "Condition:On unlock medal error" will be triggered, get error message by "Expression:ErrorMessage".

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