Wiki

effect · goto_province

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Goes to stated province.

实战 · 配合 · 坑

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

实战用法

goto_province 常用于事件或决策触发后,将镜头自动跳转到某个重要省份,提升玩家的沉浸感与引导体验——例如某场战役开始时将视角拉到登陆地点,或者国家焦点完成后聚焦于新建设施所在省份。注意它只改变镜头位置,不影响任何游戏状态。

country_event = {
    id = my_mod.1
    title = my_mod.1.t
    desc = my_mod.1.d

    option = {
        name = my_mod.1.a
        # 跳转镜头到指定省份(如诺曼底登陆省份 7038)
        goto_province = 7038
        add_war_support = 0.05
    }
}

配合关系

  • [add_war_support](/wiki/effect/add_war_support):在战役事件的 option 中,先跳转镜头让玩家看到战场位置,再施加战争支持度加成,叙事与机制双管齐下。
  • [damage_building](/wiki/effect/damage_building):触发轰炸或破坏事件时,用 goto_province 将视角引导到受损建筑所在省份,帮助玩家直观感受效果。
  • [controls_province](/wiki/trigger/controls_province):在 trigger 中判断某省是否被占领,条件成立后再用 goto_province 跳转,避免镜头跳到己方看不到的敌占区产生困惑。

常见坑

  1. 省份 ID 与州 ID 混淆:新手常误将 state(州)的数字 ID 填入此处,但该命令需要的是更细粒度的省份(province)ID,两者数值范围和来源文件(map/definition.csv)不同,填错会导致镜头跳转失败或报错。
  2. 在非 COUNTRY scope 下调用goto_province 仅在 COUNTRY scope 内有效,若写在 every_owned_state 等 STATE scope 的子块中调用,脚本会静默失效,排查时不易发现。

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

goto_province is commonly used in events or decisions to automatically pan the camera to an important province after trigger, enhancing player immersion and narrative guidance—for example, shifting the viewport to a landing zone when a campaign begins, or focusing on the province containing newly constructed facilities after a national focus completes. Note that it only changes camera position and does not affect any game state.

country_event = {
    id = my_mod.1
    title = my_mod.1.t
    desc = my_mod.1.d

    option = {
        name = my_mod.1.a
        # Pan camera to designated province (e.g., Normandy landing province 7038)
        goto_province = 7038
        add_war_support = 0.05
    }
}

Synergy

  • [add_war_support](/wiki/effect/add_war_support): In a campaign event's option, first pan the camera to let players see the battlefield location, then apply war support bonuses—combining narrative and mechanics seamlessly.
  • [damage_building](/wiki/effect/damage_building): When triggering bombing or destruction events, use goto_province to guide the viewport to the province containing damaged buildings, helping players intuitively grasp the effects.
  • [controls_province](/wiki/trigger/controls_province): In a trigger, check whether a province is controlled; if the condition is met, then use goto_province to pan—avoiding confusion from panning to enemy-held territory outside player view.

Common Pitfalls

  1. Confusing province ID with state ID: Beginners often mistakenly fill in the numeric ID of a state (state) here, but this command requires the finer-grained province ID, which have different numeric ranges and source files (map/definition.csv). Entering the wrong ID causes camera pan failure or errors.
  2. Invoking outside COUNTRY scope: goto_province is only valid within COUNTRY scope; if written in a sub-block of every_owned_state or similar STATE scope calls, the script fails silently and is difficult to debug.