Skip to Content
Stoatly Docs
Formulas

Global formulas

A global formula isn't attached to any object type, so it can't read a record. It works only from the parameters you give it. That makes it the right place for general rules, like an experience curve or a damage falloff. Admins and schema designers manage them.

Find them

In the sidebar, open Globals and choose Formulas. The page lists every global formula with its slug, its description and how many parameters it has. Formulas you have drafted but not sent show a Draft badge.

Create one

Choose New Formula. The editor is the same as for any formula, with these differences:

  • There's no record to run on, so the editor asks you to add a parameter to test it. The hint reads "Add a parameter to test this formula with different inputs".
  • Fields aren't available, because a global formula has no record.
  • A global formula can call other global formulas.

In your game

Global formulas become static methods on a single generated Globals class. Unlike a runtime formula, the method takes no record. Call it from anywhere in your code.

Charts

A global formula can be plotted as a curve across one of its parameters, which helps when tuning it.

On this page