Wiki

trigger · has_start_date

Definition

  • Supported scope:any
  • Supported target:none

Description

Compare the initial start date of current game.

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

has_start_date 常用于需要根据游戏开局日期区分剧情分支的 mod,例如在多开局支持的 mod 中针对 1936 年开局和 1939 年开局给予不同的初始效果或事件触发条件。它也常见于 focus/event 的 available 块,确保某些国策或事件只在特定历史起点下才能激活。

# 只在 1936 年开局时触发某事件
news_event = {
    id = my_mod.1
    trigger = {
        has_start_date < 1937.1.1
    }
}

配合关系

  • [date](/wiki/trigger/date)date 检查当前游戏内日期,而 has_start_date 检查游戏起始日期,两者常组合使用,以同时限定"从哪个存档开始"和"现在是否到了某个时间节点"。
  • [has_game_rule](/wiki/trigger/has_game_rule):多开局 mod 中,开局日期往往与特定游戏规则绑定,两者配合可以精确筛选"特定规则下的特定开局"。
  • [or](/wiki/trigger/or):当 mod 需要兼容多个合法开局(如同时支持 1936 与 1939)时,用 or 包裹多个 has_start_date 条件来避免逻辑过严。
  • [if](/wiki/effect/if):在 effect 块中,常用 if + has_start_date 对不同开局做差异化处理,避免为每个开局单独写重复逻辑。

常见坑

  1. 混淆 has_start_datedate:新手容易误用 date 来判断"是否是 1936 开局",但 date 检查的是当前游戏内时间,存档进行中日期会不断推进,而 has_start_date 始终反映游戏创建时的起始日期,两者语义完全不同。
  2. 比较运算符方向写反:该 trigger 支持 <>= 等比较写法,新手有时将大小关系写反(例如想筛选"1936 开局"却误写成 > 1936.1.1),导致条件永远不满足或误匹配,需仔细确认逻辑方向。

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

has_start_date is commonly used in mods that need to distinguish between story branches based on the game's start date. For example, in multi-start mods, you might apply different initial effects or event triggers for 1936 versus 1939 start dates. It's also frequently seen in the available block of focuses/events to ensure certain national focuses or events can only be activated under specific historical starting points.

# Only trigger this event when starting in 1936
news_event = {
    id = my_mod.1
    trigger = {
        has_start_date < 1937.1.1
    }
}

Synergy

  • [date](/wiki/trigger/date): date checks the current in-game date, while has_start_date checks the game's starting date. These are often combined to simultaneously restrict both "which save file to begin from" and "whether we've reached a specific time point."
  • [has_game_rule](/wiki/trigger/has_game_rule): In multi-start mods, the start date is often tied to specific game rules. Using both together lets you precisely filter "a specific start date under a specific rule."
  • [or](/wiki/trigger/or): When a mod needs to support multiple valid start dates (such as both 1936 and 1939), wrap multiple has_start_date conditions in or to avoid overly restrictive logic.
  • [if](/wiki/effect/if): Within effect blocks, if combined with has_start_date allows you to apply differentiated handling for different start dates, avoiding duplicate logic for each scenario.

Common Pitfalls

  1. Confusing has_start_date with date: Newcomers often mistakenly use date to determine "is this a 1936 start," but date checks the current in-game time, which advances as the save progresses. Meanwhile, has_start_date always reflects the start date when the game was created. These have completely different semantics.
  2. Reversing comparison operator direction: This trigger supports comparison operators like <, >, =. Beginners sometimes reverse the comparison (for example, trying to filter "1936 starts" but mistakenly writing > 1936.1.1), resulting in conditions that never match or match incorrectly. Always double-check your logical direction.