概要
Victoria 3 moddingの際の、文法を確認するための備忘録的な記事です。
詳しいmoddingの方法等は公式wiki等を確認してください。
create_building (1)
build_university_decision.1 = {
is_shown = {
exists = c:JAP
c:JAP = THIS
#関東かつ大学がない州があるか
any_scope_state = {
state_region = s:STATE_KANTO
not = { has_building = building_university }
}
}
when_taken = {
every_scope_state = {
if = {
limit = { state_region = { this = s:STATE_KANTO } }
create_building = {
building = building_university
level = 3
}
}
}
}
# AI操作国の場合は実行しない
ai_chance = { base = 0 }
}
「関東地方にレベル3の「大学」を建設する」というものです。
state_region = { this = s:STATE_KANTO }
という記述方法を見つけるのに苦労しました。
直接対象の州を指定してcreate_building
を実行できる訳ではなく、全ての州をチェックして、条件に合う州に対してcreate_building
を実行すると記述する点も厄介です。
create_building (2)
build_administration_decision.1 = {
is_shown = { any_scope_state = { tax_capacity < tax_capacity_usage } }
when_taken = {
every_scope_state = {
if = {
limit = {
tax_capacity < tax_capacity_usage
any_scope_building = {
is_building_type = building_government_administration
level < 5
}
}
create_building = {
building = building_government_administration
level = 5
}
}
}
}
}
課税キャパシティを超えている州の、行政府のレベルを5に変えるものです。
(すでに5を超えている場合は変わらない)
課税キャパシティなどの州の変数は、直接tax_capacity
と書くようです。
(buildingsのようにstate.tax_capacity
としなくてよい)
ゲームファイルのevents\test_events.txt
内にadd_building_level
という関数がありますが、wikiに記載も見つからないので実行できなそうです。
これが使えれば楽だったのですが……
領土操作
ethiopia_unification.1 = {
is_shown = { exists = c:HAR }
when_taken = {
c:SHW = {
annex = c:HAR
annex = c:WLG
annex = c:BRN
annex = c:KFA
annex = c:SDM
annex = c:BGM
annex = c:WLO
annex = c:TGR
annex = c:GJM
}
s:STATE_GONDER.region_state:AWS = {
set_state_owner = c:SHW
}
s:STATE_ERITREA.region_state:EGY = {
set_state_owner = c:SHW
}
}
ai_chance = {
base = 0
}
}
上記はソロモン朝シェワ国が、エチオピア統一する内容です。
hoi4ではジブラルタルのような地域も「州」となっていますが、vic3では州を複数の領有国で分割した「分割州」となっています。
そのため、s:STATE_ERITREA.region_state:EGY
のように領有国まで指定する必要があります。
従属国
if = {
limit = {
OR = {
is_country_type = recognized
is_country_type = colonial
}
}
create_diplomatic_pact = {
country = c:HAW
type = puppet
}
}
else = {
create_diplomatic_pact = {
country = c:HAW
type = vassal
}
}
上記はハワイを保護国にする内容です。
宗主国側が列強国に承認されているか、未承認国であるかによってtype
が異なります。
誤ったものだといきなり独立されてしまうので、注意が必要です。
自治度 | 承認国 | 未承認国 |
---|---|---|
高 | protectorate | - |
中 | dominion | tributary |
低 | puppet | vassal |
2024/05/23 追記
植民地を持つ国は colonial
のようです。
OR条件で追加しましたが、反転して、is_country_type = unrecognized
でいいかも(未確認)
請求権
s:STATE_PALESTINE = {
remove_claim = c:TUR
}
上記はパレスチナ州から、オスマン帝国の請求権を削除するEffectです。
請求権の操作は直感と逆だったので記載しておきます。
終わりに
ミス等ありましたら、コメントなどでご指摘ください。
修正履歴
- 2024/05/19 :
country_type
をis_country_type
に修正 - 2024/05/23 : 傀儡タイプの条件に、
is_country_type = colonial
を追加 - 2024/06/22 : 請求権操作のEffectを追加