Wiki

effect · add_timed_idea

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Add a time-limited idea to country in scope
ex:
SOV = {
	add_timed_idea = {
		idea = my_idea_id
		days = 5
	}
	add_timed_idea = {
		idea = my_idea_id
		years = 1
		months = 2
		days = 5
		# NB: at least 1 of year/month/days is mandatory
		# NB: accept positive integer or variables
		# NB: tooltip will use the same year/month/day format as input
	}
}

实战 · 配合 · 坑

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

实战用法

add_timed_idea 常用于为国家添加具有时效性的 buff/debuff,例如战后重建惩罚、特殊事件带来的临时加成、谈判协议产生的短期效果等场景,到期后自动移除无需额外脚本维护。下面示例模拟一场外交危机使某国获得为期半年的战争准备加成:

country_event = {
    id = my_mod.5
    option = {
        name = my_mod.5.a
        # 危机结束,获得临时战争动员加成
        add_timed_idea = {
            idea = war_preparation_bonus
            months = 6
        }
    }
}

配合关系

  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) / [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier):当需要同时附加可变数值修饰器与固定 idea 时配合使用,两者共同构成完整的临时状态叠加方案。
  • [add_ideas](/wiki/effect/add_ideas):用于对比——若 idea 需要永久生效则改用 add_ideas,与 add_timed_idea 搭配可同时发放永久与临时两种 idea。
  • [add_days_remove](/wiki/effect/add_days_remove):当已通过 add_ideas 添加了一个普通 idea 后,可用 add_days_remove 追加倒计时,两者组合实现与 add_timed_idea 相近但更灵活的效果。
  • [has_country_flag](/wiki/trigger/has_country_flag):常与国旗配合,先设旗记录"临时 idea 已激活"状态,再在其他触发器中检测旗帜,避免重复添加同一 idea。

常见坑

  1. 忘记填写至少一个时间字段yearsmonthsdays 三者必须至少给出一个,若全部省略游戏不会报错提示,但 idea 可能永久存留或立即消失,行为不可预期。
  2. 误将变量直接写成浮点数:时间字段只接受正整数或已定义的变量,写成小数(如 days = 1.5)会导致解析异常;若要使用变量,需确保该变量在执行时已被赋值且为正整数。

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

add_timed_idea is commonly used to grant countries temporary buffs or debuffs with expiration dates, such as post-war reconstruction penalties, temporary bonuses from special events, or short-term effects from diplomatic agreements. The idea is automatically removed upon expiration without requiring additional script maintenance. The example below simulates a diplomatic crisis that grants a nation six months of war preparation bonus:

country_event = {
    id = my_mod.5
    option = {
        name = my_mod.5.a
        # Crisis resolved, grant temporary war mobilization bonus
        add_timed_idea = {
            idea = war_preparation_bonus
            months = 6
        }
    }
}

Synergy

  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) / [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier): Use together when you need to apply both variable-value modifiers and fixed ideas simultaneously. Both work in concert to create a complete temporary stacking solution.
  • [add_ideas](/wiki/effect/add_ideas): For comparison—if the idea should have permanent effect, use add_ideas instead. Combining add_timed_idea with add_ideas allows you to grant both permanent and temporary ideas at once.
  • [add_days_remove](/wiki/effect/add_days_remove): After adding a standard idea via add_ideas, you can use add_days_remove to append a countdown timer. This combination achieves similar but more flexible results compared to add_timed_idea.
  • [has_country_flag](/wiki/trigger/has_country_flag): Often paired with country flags—set a flag first to record that a "temporary idea is active," then check the flag in other triggers to avoid adding the same idea multiple times.

Common Pitfalls

  1. Forgetting to specify at least one time field: One of years, months, or days must be provided. If all are omitted, the game will not display an error, but the idea may persist indefinitely or disappear immediately—behavior becomes unpredictable.
  2. Writing decimal numbers instead of integers for time fields: Time fields accept only positive integers or predefined variables. Using decimals (e.g., days = 1.5) causes parsing errors. If using variables, ensure the variable is assigned and holds a positive integer value at execution time.