effect · ai_message
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
ai message... ?
ai_messageCOUNTRYnoneai message... ?
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.
ai_message is primarily used to send internal messages or signal hints to AI nations within mods, commonly appearing in scenarios that require triggering specific AI behavioral responses—such as notifying AI allies to adjust their strategy after the player completes a certain focus. Due to severely limited official documentation on its parameters, actual usage often appears as a debugging or experimental feature.
country_event = {
id = my_mod.1
hidden = yes
immediate = {
ai_message = {
# Specific parameters should be verified through testing with the actual game version
}
}
}
[add_ai_strategy](/wiki/effect/add_ai_strategy) — Often combined with ai_message; while sending the message, use add_ai_strategy to supplement concrete strategy weights for the AI nation, making AI behavioral adjustments more comprehensive.[has_country_flag](/wiki/trigger/has_country_flag) — Used to check whether a specific flag has been set before executing ai_message, preventing duplicate triggers or messages sent at the wrong time.[country_event](/wiki/effect/country_event) — Commonly paired with ai_message; trigger a hidden event in the same execution block where the message is sent, leveraging event chains to implement more complex AI response logic.[clr_country_flag](/wiki/effect/clr_country_flag) — Clear the flag promptly after sending the message, working in tandem with flag control to ensure the message is only sent once under intended conditions.