effect · add_unit_medal_to_latest_entry
Definition
- Supported scope:(none)
- Supported target:
none
Description
add_unit_medal_to_latest_entry = { unit_medals = key }
add_unit_medal_to_latest_entrynoneadd_unit_medal_to_latest_entry = { unit_medals = key }
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.
add_unit_medal_to_latest_entry attaches a medal to the latest entry in a division's unit journal, commonly used in custom campaign events or achievement systems to automatically award honors when player units complete specific tasks. For example, in a level event triggered after an elite division completes an encirclement:
# In the immediate block of an event, append a medal to the latest journal entry
immediate = {
add_unit_medal_to_latest_entry = {
unit_medals = my_mod_iron_cross
}
}
Currently, no other compatible effects or trigger commands are listed in the scope whitelist, so relevant cross-references cannot be provided. In practical implementations, this instruction typically appears in script chains dedicated to managing division-level journals. It is recommended to use it alongside journal entry creation commands to ensure the "latest entry" actually exists before executing this instruction.
Calling without an existing entry: This instruction operates on the "latest entry." If no journal entries have been created through corresponding commands at the time of invocation, the medal has nowhere to attach, resulting in silent failure with no error message and lost medals. Always confirm that journal entries are created beforehand.
Misspelled unit_medals key: The key must exactly match the identifier defined under common/unit_medals/ (case-sensitive). If the key name does not match, the game will not crash but the medal will not display, making it easy to overlook during debugging.