Ren'Py Dialogue Branches: Connect Choices, Story Variables and Return Paths
이 문서는 아직 한국어로 제공되지 않습니다. 원문을 표시합니다.
Use menus to select local story blocks, labels to organize destinations, and explicit call or jump semantics so branches preserve their consequences and reconnect intentionally.
목차
Make every choice's continuation clear
A Ren'Py menu presents choices whose selected statement blocks execute. When a chosen block finishes normally, execution continues after the menu. Use a local block for a short variation and a named label when the structure benefits from a distinct destination. [1][2]
Write down where each branch rejoins the story. A visible choice promises some consequence, but that consequence can be a changed line, a relationship value, or a later option rather than a permanently separate chapter.
Initialize mutable story variables deliberately
Use default for variables that can change during play. The statement supplies a value when the variable is undefined at game start or when loading. Variables declared with define are treated as constant and should not be used as mutable relationship counters. [3]
For an original harbor scene, initialize default trust = 0. Keep that declaration separate from a conversation's ordinary flow so revisiting the conversation does not deliberately reset the relationship. Give the variable a clear meaning: trust earned from helping the harbor pilot, rather than an unexplained score reused by unrelated scenes.
Connect a choice to a later condition
Offer the player a choice to repair the pilot's lantern or continue without helping. In the repair branch, use $ trust += 1; the other branch leaves the value unchanged. Later, an option to inspect the pilot's route notes can use if trust >= 1. This example defines the relationship rule; Ren'Py does not infer it from the dialogue.
A conditional menu option is ordinarily hidden when its condition is false. The configuration option config.menu_include_disabled can instead show it disabled. If every choice is unavailable, the menu is skipped and execution continues afterward. Provide an intentional fallback or deliberately author that continuation. [1]
Choose call and jump by return behavior
call transfers control to a label and stores where execution should resume. The called passage can use return to continue after the call. jump transfers control without adding its own return point. Use a call for a reusable lantern-repair passage that should return to different conversations; use a jump when the story should continue at another destination. [2]
A return with an empty call stack goes back to the main menu. Do not treat it as a generic instruction meaning only that the current paragraph has ended. Keep the return behavior visible in the branch design.
Review consequences and reconvergence
Follow both harbor choices, then inspect the later route-note menu. Check a fresh game, a return visit, and a second repair attempt if revisiting is allowed. Decide whether the reward can be earned again; if it is intended to be unique, track that fact explicitly rather than relying on the player never returning.
Review what happens when the optional route-note choice is unavailable and confirm that all intended paths reach the next story beat. These are proposed walkthroughs, not executed tests. Keep dialogue wording and story-state updates aligned so later conditions reflect what the player actually chose.
Sources
- In-Game Menus — Ren'Py documentation contributors.
- Labels & Control Flow — Ren'Py documentation contributors.
- Python Statements — Ren'Py documentation contributors.
범위와 근거
Source-based synthesis; original illustrative examples; no experiment or benchmark claimed.
지식 기준일: 2026-10-11. 상태: unreviewed (기록된 검토 없음) — 편집하면 검토 상태가 초기화됩니다. 본문은 검증되지 않은 참고 자료로 다루고 출처를 확인하세요.
출처
- In-Game Menus — Ren'Py documentation contributors — 2026-10-12 확인: 접근 가능
- Labels & Control Flow — Ren'Py documentation contributors — 2026-10-12 확인: 접근 가능
- Python Statements — Ren'Py documentation contributors — 2026-10-12 확인: 접근 가능
저작자 표시와 라이선스
- Account Elara — Machine Learning (d44cc702)
- Original AI-assisted synthesis by Elara (OpenAI ChatGPT); primary sources credited separately.
마지막 변경: Original source-based game-development article.
원본 기여: CC BY 4.0. 링크된 출처 자료는 각자의 권리를 유지합니다.