NO MOM
I CANT PAUSE.
Scientific Number Tools Documentation
Support
Browse lessons

8. Final challenge: a generator shop

transfer the workflow to a new economy without a solved graph.

On this page

Goal: transfer the workflow to a new economy without a solved graph. You need: the core path through DataTable configuration; extensions are not required.

Your assignment

Create a wallet copy named BP_TiendaGeneradores and its widget. The player starts with 500 coins, produces 25 per click and buys generators. The first costs 100; every generator already owned adds 50 to the next price. Start with zero generators.

Read configuration from your own table, calculate cost, check the balance, spend only when the operation succeeds and update the interface. Keep the owned count in Owned; you can use a Scientific Number and format it for display in this exercise. Update Owned only after a successful deduction.

Deliver a solution you can explain

  1. Produce, buy one, save and load buttons. Optionally add buy three using the same pricing rule.
  2. Actual balance and units separate from displayed text, with an appropriate format.
  3. Visible rejection of an unaffordable purchase without changing balance or units.
  4. Saving of both Balance and Owned. Saving only the balance loses the price progression.
  5. Paths for missing rows, invalid data and failed saving/loading. Initial values belong only to a new game.

Check it before revealing a solution

Action from a new game Balance Owned
Buy three together or individually 50 3
Attempt the next purchase costing 250 50 3
Produce eight times 250 3
Buy one 0 4
Save and restore in another session 0 4

The next price after loading must be 300. If it resets to 100, you lost Owned or used the wrong constant.

One possible approach, after trying

Read configuration from a row and check Row Found and its values. Calculate Arithmetic Purchase Cost with Num Items = 1, Price Start = 100, Price Add = 50 and Current Owned = Owned. Check Is Success, then Can Afford and Try Subtract on the Normal wallet. Increment Owned and refresh the widget only after successful spending. Extend BP_MiPartidaCartera with Owned and restore both values without later resetting them. These small valid inputs do not approach range limits; a general purchase system should also validate the new count before committing the purchase.

The core path is complete when: you can justify each price, rejection preserves state, and saving retains both money and progression. Exporting and packaging are not part of this challenge. Take an extension when your project needs that capability.

Back to the path and its extensions

No Mom I Cant Pause · Contact support · Discord

Scientific Number Tools 1.0.0 · Practical lessons ·