effect · hidden_effect
Definition
- Supported scope:
any - Supported target:
none
Description
Effect not shown in tooltips
hidden_effectanynoneEffect not shown in tooltips
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.