Wiki

effect · modify_timed_idea

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

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

实战 · 配合 · 坑

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

实战用法

modify_timed_idea 常用于事件或决策中动态调整某个限时国策/理念的剩余时间,例如在完成某项国策后延长 buff 的持续时间,或通过负值惩罚加速移除某个临时增益。典型场景包括:玩家触发某个外交事件后,作为奖励给本国正在计时的战时动员令额外续期数天。

country_event = {
    id = my_mod.10
    option = {
        name = my_mod.10.a
        # 玩家选择"接受援助"时,延长战时动员令30天
        modify_timed_idea = {
            idea = war_mobilization_bonus
            days = 30
        }
    }
    option = {
        name = my_mod.10.b
        # 玩家选择"拒绝"时,因内部压力缩短该理念剩余时间
        modify_timed_idea = {
            idea = war_mobilization_bonus
            days = -15
        }
    }
}

配合关系

  • [add_timed_idea](/wiki/effect/add_timed_idea):通常先用此命令为国家添加一个带有时限的理念,之后才有意义调用 modify_timed_idea 对其进行续期或缩短。
  • [has_country_flag](/wiki/trigger/has_country_flag):在执行时限修改前,先通过国家旗帜判断是否已经触发过该逻辑,防止同一理念被重复延长。
  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier):若限时理念附带动态修正器,可先确认动态修正器存在再做时限调整,保证逻辑一致性。
  • [add_days_remove](/wiki/effect/add_days_remove):功能上类似,但作用对象是动态修正器而非理念,两者常在同一效果块中配套使用,分别管理理念和修正器的剩余时间。

常见坑

  1. 忘记该理念必须是限时理念modify_timed_idea 只能作用于通过 add_timed_idea 添加、或在 ideas 定义中指定了时限的理念;对普通永久性理念使用此命令不会报错但也不会产生任何效果,容易导致 bug 难以排查。
  2. days/months/years 至少填写一个:三个参数必须出现至少一个,若全部省略脚本将报错或静默失效;同时注意这些字段接受变量名,但变量必须提前赋值,否则计算结果为 0 而非报错,产生隐蔽的逻辑问题。

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

modify_timed_idea is commonly used in events or decisions to dynamically adjust the remaining duration of a timed national focus or idea. For example, extending a buff's duration after completing a focus, or using negative values to penalize and accelerate removal of a temporary bonus. Typical scenarios include: after a player triggers a diplomatic event, granting the nation an additional extension of several days to an ongoing war mobilization order as a reward.

country_event = {
    id = my_mod.10
    option = {
        name = my_mod.10.a
        # When the player chooses "accept aid", extend war mobilization by 30 days
        modify_timed_idea = {
            idea = war_mobilization_bonus
            days = 30
        }
    }
    option = {
        name = my_mod.10.b
        # When the player chooses "reject", internal pressure shortens the remaining time of the idea
        modify_timed_idea = {
            idea = war_mobilization_bonus
            days = -15
        }
    }
}

Synergy

  • [add_timed_idea](/wiki/effect/add_timed_idea): Typically used first to add a timed idea to a country; only then does it make sense to call modify_timed_idea to extend or shorten it.
  • [has_country_flag](/wiki/trigger/has_country_flag): Before executing a duration modification, first check via country flag whether the logic has already been triggered, preventing the same idea from being extended repeatedly.
  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier): If a timed idea comes with a dynamic modifier, you can first confirm the dynamic modifier exists before adjusting the duration, ensuring logical consistency.
  • [add_days_remove](/wiki/effect/add_days_remove): Similar in function, but applies to dynamic modifiers rather than ideas. Both are often used together in the same effect block to manage the remaining duration of ideas and modifiers respectively.

Common Pitfalls

  1. Forgetting that the idea must be a timed idea: modify_timed_idea only works on ideas added via add_timed_idea or defined with a time limit in the ideas section. Using this command on regular permanent ideas will not cause an error but will have no effect, making bugs difficult to trace.
  2. At least one of days/months/years must be specified: At least one of the three parameters must be present; if all are omitted, the script will either error or fail silently. Also note that these fields accept variable names, but variables must be assigned beforehand. Otherwise the calculated result will be 0 rather than an error, creating subtle logical problems.