-
-
Notifications
You must be signed in to change notification settings - Fork 51
Code Style
zumbak04 edited this page Dec 12, 2019
·
8 revisions
Hello! In this article you will find the code style that we use for writing events, decisions, traits etc. It is advisable to follow this style so that other developers can have an easier time interpreting your code.
- There should be gaps (empty lines) between the numbered groups written below. In essence, all conditions in the same number group will occur together in one code block.
- Inside new scopes, the order begins anew.
Example
has_dlc = "Legacy of Rome"
ai = yes
is_playable = yes
any_courtier = {
has_dlc = "Legacy of Rome"
ai = yes
is_playable = yes
}
-
has_dlc
,is_alive
,is_dying
,is_untouchable_trigger
,can_rule_peacefully_trigger
. -
ai
,is_playable
,is_adult
,is_incapable
,prisoner
,is_inaccessible_trigger
. -
is_ruler
,is_landed
,independent
,is_tributary
,mercenary
,holy_order
,controls_religion
,is_offmap_governor
,government
,tier
,war
,in_revolt
. -
character
,is_within_diplo_range
,same_realm
. - Flags/traits/modifiers working as cooldowns, attempt limits and other blockers.
- Being type (
being_
traits) , race (creature_
traits), class (class_
traits), mana triggers (has_<5-1>_mana_trigger
), religion, culture, other traits. - Wealth, piety, prestige, society currency, offmap currency and user variables.
- Other conditions.
Example
has_dlc = "Legacy of Rome"
ai = yes
is_playable = yes
independent = yes
NOT = { has_character_modifier = invited_student_society_cooldown }
trait = creature_troll
religion = old_gods_worship
# Other conditions (you can not write comments)
diplomacy = 15
has_guardian = yes
any_courtier = {
is_untouchable_trigger = no
is_adult = yes
has_5_mana_trigger = yes
prestige = 1000
}
-
show_scope_change
,save_event_target_as
. - Flags/traits/modifiers working as cooldowns, attempt limits and other blockers.
- Being type (
being_
traits) , race (creature_
traits), class (class_
traits), mana effects (remove_<5-1>_mana_effect
,add_<5-1>_mana_effect
), religion, culture, other traits. - Wealth, piety, prestige, society currency, offmap currency and user variables.
- Other effects.
- Event firing (character_event etc.).
death
Example
save_event_target_as = target_test
add_trait = class_warlock_6
remove_3_mana_effect = yes
culture = gilnean
death = { death_reason = death_execution killer = ROOT }
random_courtier = {
show_scope_change = yes
set_character_flag = placeholder_ongoing_flag
wealth = 1500
character_event = { id = TEST.10 }
}
Utilize the order given in this article while leaving a gap between modifiers similar to how they are sectioned off. For example, there should be a gap between "Character Attribute Modifiers" and "Realm Modifiers".
Example
diplomacy = 2
combat_rating = 10
demesne_size = 2
vassal_limit = 1
build_cost_modifier = 0.2
vassal_opinion = 10
general_opinion = 10