Wiki

effect · set_project_flag

Definition

  • Supported scope:SPECIAL_PROJECT
  • Supported target:none

Description

set project flag

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

set_project_flag is commonly used for milestone management in Special Projects, such as marking completion at a particular research phase to inform subsequent events or trigger conditions about the current progress state. Typical scenarios include: setting a flag after a nuclear weapons development project completes a prototype phase, allowing subsequent event chains or reward branches to detect this state.

# Mark "phase one complete" when a special project reaches a certain stage
SPECIAL_PROJECT_SCOPE = {
    set_project_flag = phase_one_complete
}

Synergy

  • [has_project_flag](/wiki/trigger/has_project_flag) — Reads flags written by set_project_flag, used in conditional checks to determine whether the project has reached a specific phase; the two form a complete "write-read" feedback loop.
  • [clr_project_flag](/wiki/effect/clr_project_flag) — Clears previously set flags when resetting or switching states, working with set_project_flag to implement state machine-like phase transitions.
  • [modify_project_flag](/wiki/effect/modify_project_flag) — If a flag needs to carry numeric state (rather than simple boolean values), initialize with set_project_flag first, then modify its value using this command.
  • [add_project_progress_ratio](/wiki/effect/add_project_progress_ratio) — Often used alongside flags in the same execution block, advancing project progress while applying phase markers to keep progress and state in sync.

Common Pitfalls

  1. Incorrect Scopeset_project_flag can only execute within SPECIAL_PROJECT scope; using it in country or state scope will cause silent script failure, and log errors are not always intuitive, making it easy for new modders to spend considerable time debugging.
  2. Confusion with Generic set_country_flag — Project flags exist only in the context of that specific project and cannot be read from country scope using has_country_flag; you must use [has_project_flag](/wiki/trigger/has_project_flag) within the corresponding project scope to query it, otherwise the condition will never trigger.