Hands-On Usage
When creating a mod related to special project systems, you often need to decide whether other decisions or focuses are available based on whether a particular project is being researched—for example, preventing two mutually exclusive special projects from being activated simultaneously, or only enabling a supporting decision while a project is being researched. Below is a typical usage pattern:
# Prevent another project from being selected when a mutually exclusive project is being researched
available = {
NOT = {
is_special_project_being_researched = sp:nuclear_bomb_project
}
}
Synergy
- has_completed_focus: Commonly paired together; first check if the focus unlocking the special project has been completed, then determine if the project is being researched, forming a chain of prerequisites.
- complete_special_project: Used within effect blocks; after the trigger detects that a project is being researched, trigger forced completion, useful for event rewards or debugging scripts.
- has_country_flag: Set a country flag during project research, then use this trigger in combination to judge the current research status, enabling more granular control flow.
- any_active_scientist: Special projects typically require scientist participation; pairing with this trigger allows simultaneous verification of scientist status and project progress status, preventing logical gaps.
Common Pitfalls
- Forgetting the
sp: prefix: Writing the project name directly (such as = my_project) without the sp: prefix causes the script to fail to recognize the target, the trigger always returns false without error reporting, and is extremely difficult to debug; must be written as sp:my_project or use variable form var:my_project_var.
- Calling outside COUNTRY scope: This trigger only supports COUNTRY scope; if used directly within STATE or CHARACTER scope, the game will not evaluate correctly. You must use keywords like
ROOT/FROM to switch back to the correct country scope before calling it.