Hands-On Usage
In custom Raid gameplay mods, when a raid mission reaches specific milestones (such as successfully destroying targets or completing designated rounds), use this effect to reward participating units with experience, creating a positive feedback loop of "better performance leads to faster unit growth". Note that experience is expressed as a "ratio of total experience required to reach max level", allowing flexible adjustment of reward magnitude based on difficulty tiers.
# Reward participating units with experience upon raid mission settlement
RAID_INSTANCE = {
# Grant different rewards based on whether excellent rating is achieved
if = {
limit = {
hidden_trigger = { ... } # Check raid completion conditions
}
raid_add_unit_experience = 0.3 # Reward 30% progress experience
}
else = {
raid_add_unit_experience = 0.1 # Base reward 10% progress
}
}
Synergy
[add_raid_history_entry](/wiki/effect/add_raid_history_entry): Records a raid history log entry while granting experience, making it easy to track "why experience was gained". Both effects commonly appear together in the same settlement block.
[raid_damage_units](/wiki/effect/raid_damage_units): Raids typically involve casualties. First use this command to inflict damage on participating units, then use experience rewards as compensation for "paying a price for growth", logically forming a complete combat settlement loop.
[hidden_trigger](/wiki/trigger/hidden_trigger): Used for implicit condition checks before awarding experience (such as whether the raid succeeded or met minimum participation rounds), preventing unconditional experience distribution that breaks balance.
[meta_trigger](/wiki/trigger/meta_trigger): When dynamic parameter passing is needed (such as determining reward ratios based on raid level variables), combine with meta_trigger to construct parameterized condition judgments, making experience rewards more flexible.
Common Pitfalls
- Calling directly under country/state scope: This effect only works within
RAID_INSTANCE scope. If mistakenly written under country or state scope, the script silently fails without error reporting. Ensure the call chain has entered the raid instance scope.
- Misinterpreting the value as absolute experience amount: The input value represents "the ratio of experience required to reach max level" rather than a fixed amount. Setting
1.0 means directly reaching max level—beginners often input the same magnitude as regular add_experience, causing all participating units to instantly max level.