Wiki

effect · effect_tooltip

Definition

  • Supported scope:any
  • Supported target:any

Description

Shows just tooltip of effects

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

effect_tooltip is used to display the tooltip text of an effect to the player without actually executing it. This is commonly used when you need to preview potential outcomes of an option to the player, or to add explanatory text outside a hidden_effect block. For example, in an event option where you've already placed the real logic in hidden_effect, you can still use this to "pretend" to show the tooltip of that effect in the option interface.

option = {
    name = my_event.1.a
    hidden_effect = {
        # The actual complex logic goes here, won't be directly displayed to the player
        add_victory_points = { province = 3 value = 5 }
    }
    # Only show the tooltip without re-executing the effect
    effect_tooltip = {
        add_victory_points = { province = 3 value = 5 }
    }
}

Synergy

  • [hidden_effect](/wiki/effect/hidden_effect): The classic pairing — hide the actual execution logic in hidden_effect, then use effect_tooltip at the outer layer to restore the visible tooltip, preventing effects from being displayed twice or logic from being exposed to the player.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): When the content displayed by effect_tooltip still isn't intuitive enough, you can additionally pair it with custom_effect_tooltip using localization strings to provide friendlier explanatory text.
  • [if](/wiki/effect/if): In conditional branches, if you only want an effect to display as a tooltip in certain conditions (rather than execute), you can nest effect_tooltip inside the if block to achieve "conditional tooltips".

Common Pitfalls

  1. Mistakenly thinking it will actually execute the effect: effect_tooltip only renders the tooltip text and won't produce any actual changes to the game state. Beginners often write effect_tooltip outside hidden_effect while forgetting to include the hidden_effect block itself, resulting in the effect not executing at all — it just looks like "something happened".
  2. Mixing with custom_effect_tooltip causing duplicate descriptions: If you've already written custom explanatory text using custom_effect_tooltip, wrapping another layer of effect_tooltip displaying the same content will cause the player to see duplicate tooltip segments in the UI. You need to carefully plan which approach should handle the final display.