Custom Operations
Create custom operations that check conditions and apply effects, and let your game call them directly.
Custom Operations
A custom operation is an action in your design: it checks its conditions and, if they pass, applies its effects in order — claim a daily bonus, buy an upgrade, reset a run. You manage custom operations from the Custom Operations tab of the Element Explorer on the Design tab.
Creating a Custom Operation
In a workspace, click New Custom Operation, name it in the Inspector — e.g. "Claim daily bonus", with the slug claim_daily_bonus — fill in the sections below and click Save. A new custom operation is callable by game clients and has no conditions and no effects yet. The fields every element shares are covered in Navigating Leap Studio.
The slug is the name your game calls. A few slugs are reserved for actions Leap generates itself and can't be used: unlock, advance, and anything starting with on_unlock_, on_enter_, exit_, outcome_ or transition_.
Who Can Run It
Callable by game clients decides who can run the operation:
- Ticked — your game can run it directly. The Inspector shows the call your game makes, e.g.
claim_daily_bonus(), ordaily_rewards.claim_daily_bonus()when the operation is in a group. A call whose conditions don't pass is refused. - Unticked — "Internal — only other operations can run it."
Conditions and Effects
Under Conditions, describe when the operation may run. It runs only while these pass: a call from your game that fails them is refused, and a run from another operation is skipped silently. Leave them empty to let it always run. See Conditions.
Under Effects, list the changes the operation applies when it runs, in order. Try it — this is the effect list of Claim daily bonus:
See Operations and Effects for every kind of effect.
Running a Custom Operation from Your Design
Other parts of your design can run a custom operation too — a system state or exit, an achievement's or entitlement's Unlocks, or another custom operation. Add a Custom op effect and pick it. It "runs after" the other effects of that list have been applied, and it is skipped silently if its own conditions don't pass at that moment.
A custom operation can't run itself directly. If a chain of runs leads back to it, the Inspector warns you — for example "This operation runs itself. It will repeat until a condition stops it." — but still lets you save, so a loop with a stopping condition is allowed.
If you delete a custom operation that effects elsewhere run, Leap tells you how many before you confirm: they're left pointing at nothing, and the next merge fails until you remove them.
Next Steps
Continue to Events to learn how to move systems forward.