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

rex_achievements

Plugin, ACE table, Discussion thread
Dependence: None


Introduction
Achievements in csv table.

Usage
Sample capx

Concept
Each row in the csv table is an achievement.
图片
  • 1st cell of each row is level name.  ( green cells )
  • 2nd cell is achievement name. ( red words )
  • Other cells are conditions combined with AND logic. ( gray words )
  • The 1st row is used to define the input variables ( yellow cells ). The first 2 cells of this row must be empty.
This table defines 3 achievements in level "1"
  • "AchA" = ("A" >= 10) AND ("A" < 20)
  • "AchB" = ("A" >= 20) AND ("A" < 50)
  • "AchC" = ("A" > 50)

Load table
Call "
Action:Load table" to load conditions table.
Set level name and input values
Call "
Action:Set level name" to set current level, and set input values by "Action:Set property". These values would be kept until next loading table action.
Get result
All
a
chievements of current level (Action:Set level name) would be tested by current input values (Action:Set property) after call "
Action:Run tests".
Player
obtains achievements if the testing of
achievement return true, and these results would be stored in this plugin.
Retrieves all
achievements of this level by "
Condition:For each achievement". Then get result by "Condition:Is obtained", there are two
modes set by parameter "Latest".
  • Set "Latest" to "" to check this achievement had been obtained or not.
  • Set "Latest" to "in the latest test" to check this achievement had been obtained in the latest test or not. i.e. this achievement had not been obtained in previous test, but obtained in current test.

Special commands
Default "equal to" - if the cell only has a value x, this would became "== x". i.e. "== x" is equal to "x".

Save/load
This plugin supports official save/load feature.
Or get content by
"Expression:AsJSON" to save state and rule of
achievements, then call "Action:Load" for loading manually.
Or get
state of achievements only by "
Expression:StatesAsJSON". Load these states by "Action:Load states". In this case, rule of
achievements would not be exported.

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