Labels and control flow
This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.
Learning goals
- Define stable labels for scenes and chapters.
- Choose between jump and call/return intentionally.
- Understand lifecycle labels and control flow risks.
Core syntax
labeljumpcallreturnpauseafter_load
Runnable example
text
label start:
"故事从这里开始。"
jump chapter1
label chapter1:
"第一章。"
returnStudy outline
- Start with the smallest example for labels and control flow.
- Test the key terms in a clean Ren'Py project: label, jump, call, return.
- Move the pattern back into your real project only after the example runs.
- Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.
Common pitfalls
- Unresolved label names and case mismatches are common in larger projects.
- Use call/return only when you really need to come back to the caller.
- Test the smallest working script before layering on visual or UI complexity.
- Run Ren'Py Lint before release builds, even when the script appears to run locally.
- Keep examples in standard .rpy files so they remain editable outside GenPy.
Official references
- Ren'Py official reference: https://www.renpy.org/doc/html/label.html
How this fits in GenPy
- Use Story Graph and Branch View to inspect labels, jumps, calls, and dead ends.
- Use Validation before export to catch unresolved branch targets.
Recommended GenPy docs:
