-
-
Notifications
You must be signed in to change notification settings - Fork 67
Code Style
zumbak04 edited this page Apr 10, 2021
·
5 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
is_ai = yes
is_ruler = yes
any_courtier = {
is_ai = yes
is_ruler = yes
}
-
has_dlc
,is_alive
. -
is_ai
,is_adult
,is_incapable
,is_imprisoned
. -
is_ruler
,is_landed
,is_independent_ruler
,is_mercenary_company
,is_holy_order
, Government triggers, tier triggers,is_at_war
. -
character
,in_diplomatic_range
. - Cooldowns, attempt limits, and other blockers.
- Being type (
being_
traits) , race (creature_
traits), religion, culture, other traits. - Wealth, piety, prestige, and user variables.
- Other conditions.
Example
is_alive
is_ai = yes
is_adult = yes
is_independent_ruler = yes
NOT = { has_character_modifier = invited_student_society_cooldown }
trait = creature_troll
religion = religion:loa_group
# Other conditions
age > 45
any_courtier = {
is_mercenary_company = yes
is_adult = yes
prestige > 1000
}
-
save_scope_as
,set_variable
, and other saves/sets that will be needed further in effect. - Cooldowns, attempt limits, and other blockers.
- Being type (
being_
traits), race (creature_
traits), religion, culture, other traits. - Wealth, piety, prestige, and user variables.
- Other effects.
- Event firing (
trigger_event
). death
Example
save_scope_as = target_test
culture = culture:gilnean
death = { death_reason = death_execution killer = root }
random_courtier = {
add_character_flag = placeholder_ongoing_flag
add_gold = 1500
trigger_event = TEST.10
}
So far, there's no style.