- When you create an event or decision, always leave a comment so other developers can know context.
- Try to use
weight_multiplier
instead ofmean_time_to_happen
, it makes the mod less CPU intensive. - Add pre-triggers as much as possible, this also makes the mod less CPU intensive.
- There's custom Notepad++ language
Guardians of Azeroth\coder_resources\CK2 Language.xml
. It's very desirable to instal it. This will highlight the syntax of CK2 and will allow to use Right Click >Toggle Single Line Comment
,Block Comment
andBlock Unmomment
functions to comment out multiple lines.
To instal:
- Open Notepad++ and open the "Define Your Language" tool in the "Language" menu
- Click "Import" and select the
Guardians of Azeroth\coder_resources\CK2 Language.xml
file. - Make sure to hit "Save As" in the Define Your Language tool. Type anything you want as the name, it isn't important.
- Select the new language in the "Language" menu.
- There must be a gap (line without any text) between the numbered groups written below. In essence, all conditions in the same number group will occur together in one code block. For example, a space will exist between
has_dlc
andai
.
has_dlc
,is_untouchable_trigger
,can_rule_peacefully_trigger
ai
,is_playable
,is_adult
,is_incapable
,prisoner
,is_inaccessible_trigger
is_ruler
,is_landed
,independent
,same_realm
,mercenary
,holy_order
,is_tributary
,government
,tier
,war
character
,is_within_diplo_range
, cooldowns, limit of attempts or flags/traits/modifiers that are set if an event/decision is ongoing or happened.- Being type (
being_
trait) , race (creature_
trait), class (class_
trait), mana triggers (has_5_mana_trigger
,has_4_mana_trigger
etc) religion, culture, +other traits - Wealth, piety, prestige, and user variables
- Other conditions
show_scope_change
,save_event_target_as
- Cooldowns, limit of attempts or flags that are set if the event/decision is ongoing
- Being type (
being_
trait) , race (creature_
trait), class (class_
trait), mana effects (add_5_mana_effect
,remove_5_mana_effect
,clear_mana_modifier_effect
etc) religion, culture, +other traits - Wealth, piety, prestige, and user variables
- Other effects
- Continuation of an event chain
- Death
- Utilize the order given in this article making a gap between the modifiers similar to how they are sectioned off. For example "Character Attribute Modifiers" and "Realm Modifiers".