effect · hidden_effect
Definition
- Supported scope:
any - Supported target:
none
Description
Effect not shown in tooltips
hidden_effectanynoneEffect not shown in tooltips
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
hidden_effect 常用于在事件或决策触发时悄悄修改游戏状态,而不让玩家在 tooltip 中看到"幕后操作",例如设置追踪用的全局变量、标记任务完成状态或给 AI 国家静默执行补偿逻辑。典型场景是在玩家触发某个事件选项时,同时在后台记录数据或调整 AI 行为,保持界面干净不暴露实现细节。
# 在事件选项中,显示给玩家看的效果正常写,额外的追踪逻辑藏进 hidden_effect
option = {
name = my_event.1.a
add_political_power = 50 # 玩家可见
hidden_effect = {
set_global_flag = my_mod_event_1_taken # 玩家不可见
set_variable = { my_mod_tracker = 1 }
}
}
[set_global_flag](/wiki/effect/set_global_flag) / [clr_global_flag](/wiki/effect/clr_global_flag):最常见搭档,在 hidden_effect 中悄悄设置或清除全局标记,用于后续 trigger 判断而不污染 tooltip。[set_variable](/wiki/effect/set_variable) / [add_to_variable](/wiki/effect/add_to_variable):在不影响玩家阅读性的前提下维护数值型变量,适合积分系统或进度追踪。[save_global_event_target_as](/wiki/effect/save_global_event_target_as):在背景中静默绑定事件目标,避免 target 指定信息出现在 tooltip 里干扰玩家理解。[custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):与 hidden_effect 形成互补——真实逻辑放进 hidden_effect 隐藏,再用 custom_effect_tooltip 在外部展示一条人工撰写的友好说明。hidden_effect 内的所有内容对玩家完全不可见,若把重要的政治力、科技等奖励写在里面,玩家在 tooltip 预览时看不到任何提示,会造成体验混乱甚至被误认为 bug。hidden_effect 内再套 hidden_effect:嵌套毫无意义,内层块的行为与外层完全一致,只会增加代码冗余和阅读负担,应当将所有需要隐藏的指令平铺在同一个 hidden_effect 块中。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.
hidden_effect is commonly used to silently modify game state when events or decisions trigger, preventing players from seeing "behind-the-scenes operations" in the tooltip. Typical applications include setting tracking variables, marking task completion states, or executing compensatory logic for AI nations without player visibility. The key scenario is executing visible effects for the player while simultaneously recording data or adjusting AI behavior in the background, keeping the interface clean and avoiding implementation details.
# In event options, write visible effects normally for the player, and hide additional tracking logic in hidden_effect
option = {
name = my_event.1.a
add_political_power = 50 # Player can see this
hidden_effect = {
set_global_flag = my_mod_event_1_taken # Player cannot see this
set_variable = { my_mod_tracker = 1 }
}
}
[set_global_flag](/wiki/effect/set_global_flag) / [clr_global_flag](/wiki/effect/clr_global_flag): Most common companion, silently setting or clearing global flags within hidden_effect for subsequent trigger checks without polluting the tooltip.[set_variable](/wiki/effect/set_variable) / [add_to_variable](/wiki/effect/add_to_variable): Maintaining numeric variables without affecting player readability; ideal for scoring systems or progress tracking.[save_global_event_target_as](/wiki/effect/save_global_event_target_as): Silently binding event targets in the background, preventing target specification information from appearing in the tooltip and confusing players.[custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Forms a complementary pair with hidden_effect—place actual logic inside hidden_effect for hiding, then use custom_effect_tooltip externally to display a manually written friendly description.hidden_effect is completely invisible to players. If important rewards like political power or technology are placed inside, players won't see any hints in the tooltip preview, causing confusion and potentially being mistaken for a bug.hidden_effect within hidden_effect: Nesting serves no purpose—inner blocks behave identically to outer ones and only increase code redundancy and reading burden. Instead, lay all commands that need hiding flat within a single hidden_effect block.