Missions

Overview

This demo shows how GS2-Mission keeps counters and missions apart. Four missions watch one counter, so a single press moves all four, and they complete separately because their targets differ. The counter keeps four windows at once (today, this week, this month and all time), and the two mission groups differ in when their rewards come back: never (career) or every day (daily).

How to try it

  1. Press Advance under One counter, four windows; the counter goes up by 1, and Today value, Weekly value, Monthly value and Total value all rise together.
  2. The first press completes career1 (Wants 1 on the counter. Pays 10 coins.) under Career missions: receive once, and a Receive button appears. Press it; Free balance under Where the coins land goes up by 10 and the mission reads Received 10 coins.
  3. Press Advance once more to reach 2; daily2 under Daily mission: receive again tomorrow completes, and Receive pays 20 coins.
  4. The third press completes career3 (30 coins) and the fifth completes career5 (50 coins), each claimed with Receive. A mission below its target shows no button.
  5. The daily group resets every day at 00:00 UTC, so daily2 can be claimed again tomorrow. The career group never resets, so once claimed it stays claimed.

There is no press that puts the counter back or un-claims a career mission. The account is shared by every showroom demo in the same browser, so to start fresh, open the demo in a private window or another browser to get a new anonymous account.

GS2 services used

  • GS2-Mission: GS2-Mission defines the counter counter with daily, weekly, monthly and never-reset scopes, and the missions that watch it (career1, career3, career5, daily2) in two groups, and tracks completion and reward claims.
  • GS2-Exchange: A free GS2-Exchange rate defines raising the counter by 1 (IncreaseCounterByUserId), run by Advance.
  • GS2-Money2: Mission rewards are deposited as free currency into a GS2-Money2 wallet (slot 0), shown as Free balance.

Use it in GS2 Studio

In GS2 Studio’s Simple mode, open Add features and press Add on Missions 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/micro-economy-mission/packages/micro-economy-mission
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: micro-economy-mission/packages/micro-economy-mission

Source code