Wiki

effect · add_raid_history_entry

Definition

  • Supported scope:RAID_INSTANCE
  • Supported target:none

Description

Add history entry to a raid.
Example:
add_raid_history_entry = yes/no

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

In mods involving Raid gameplay, when you need to record critical event milestones for a raid mission (such as successfully routing defenders or completing plunder), you can invoke this effect within the corresponding RAID_INSTANCE scope to enable subsequent tracking of raid progress through logs or UI. For example, writing a history entry at the conclusion of a raid phase:

raid_event = {
    id = my_raid.10
    hidden = yes
    immediate = {
        add_raid_history_entry = yes
    }
}

Synergy

  • [raid_add_unit_experience](/wiki/effect/raid_add_unit_experience): Upon raid completion, unit experience rewards are typically logged in history simultaneously, with both effects often triggered sequentially within the same execution block.
  • [raid_damage_units](/wiki/effect/raid_damage_units): Immediately after inflicting unit casualties, write a history entry to record combat losses, making the raid record more comprehensive.
  • [hidden_trigger](/wiki/trigger/hidden_trigger): Before writing a history entry, use hidden triggers to validate whether the raid's current state meets recording conditions, preventing invalid or duplicate writes.

Common Pitfalls

  1. Scope errors: This effect can only be invoked within RAID_INSTANCE scope. Direct use in country or province scopes will silently fail or throw errors. Always confirm you have properly switched scope into the raid instance.
  2. yes/no misuse: Beginners often assume passing no can "undo" a history entry, but this parameter merely controls whether the write action executes. Once a history record is written, it typically cannot be deleted or rolled back through subsequent calls.