Characters

Overview

Recruit any of four characters (knight, mage, archer, healer) for free, then train them to gain experience and levels. Every recruit uses one slot of your roster and appears as its own row under Train a character. Each character keeps its own experience and level, with a level cap of 10.

How to try it

  1. Under Recruit a character, press Recruit next to Recruit knight (or another character) to get one of that character.
  2. Slots under Your characters goes up, for example to 1 of 20 used. Recruiting the same character again adds a separate copy.
  3. A row for the new character appears under Train a character, with its name in Id and its level and cap in Level, such as 1/10.
  4. Press Train on a row to give that character alone 40 experience; the gauge fills, and the level goes up each time a threshold is passed.
  5. Keep training and the level stops at the cap of 10.

GS2 services used

  • GS2-Inventory: GS2-Inventory’s Character inventory defines the roster (20 slots to start, 100 at most) and an item model per character, and holds the characters the player owns. Each stack holds one character and multiple stacks are allowed, so two knights are two rows.
  • GS2-Experience: GS2-Experience’s experience model defines each character’s experience, level, level cap (10 by default, 30 at most) and the experience thresholds. Experience is tracked per character item set.
  • GS2-Exchange: GS2-Exchange rate models define the buttons: Recruit acquires a character (Gs2Inventory:AcquireItemSetByUserId) and Train adds experience to the pressed character (Gs2Experience:AddExperienceByUserId), each run server-side as a free transaction.

Use it in GS2 Studio

In GS2 Studio’s Simple mode, open Add features and press Add on Characters to bring this feature into your own project. To point at the package directly, choose Add from GitHub and enter the package below.

https://github.com/gs2io/gs2-studio-package/tree/main/foundation-economy-character/packages/foundation-economy-character
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: foundation-economy-character/packages/foundation-economy-character

Source code