Использование скрипта Восстания Баронов (Medieval 2: Total War)

Использование скрипта Восстания Баронов (Medieval 2: Total War)

Я решил написать этот тутор для создания новых фракции в Medieval 2: Total War с помощью скрипта Альянса Баронов. Я взял Шотландию и Португалию.


Необходимые файлы:
-Descr_sm_factions (Data)
-Campaign_script (Data/World/Maps/Campaign/Campaign_name)
-Descr_strat (Data/World/Maps/Campaign/Campaign_name)


Шаги:
1) Во-первых, вы должны решить, какая фракция появится из какой фракции.
2) Второй шаг, это зайти в descr_sm_factions и добавить к фракции, которая будет возникать "Отслеживание фракции откуда должна появиться ваша фракция" и фракции откуда должна появится ваша фракция "Скрытая фракция, появятся у фракции с именем". В моем случае это Шотландия:

faction scotland, shadowed_by portugal
culture southern_european
religion catholic
symbol models_strat/symbol_scotland.CAS
rebel_symbol models_strat/symbol_rebels.CAS
primary_colour red 39, green 118, blue 216
secondary_colour red 243, green 219, blue 13
loading_logo loading_screen/symbols/symbol128_scotland.tga
standard_index 6
logo_index FACTION_LOGO_SCOTLAND
small_logo_index SMALL_FACTION_LOGO_SCOTLAND
triumph_value 5
custom_battle_availability yes
can_sap yes
prefers_naval_invasions yes
can_have_princess yes
has_family_tree yes


И для Португалии, фракция которой появится:

faction portugal, shadowing scotland
culture southern_european
religion catholic
symbol models_strat/symbol_portugal.CAS
rebel_symbol models_strat/symbol_rebels.CAS
primary_colour red 255, green 255, blue 255
secondary_colour red 0, green 0, blue 255
loading_logo loading_screen/symbols/symbol128_portugal.tga
standard_index 13
logo_index FACTION_LOGO_PORTUGAL
small_logo_index SMALL_FACTION_LOGO_PORTUGAL
triumph_value 5
custom_battle_availability yes
can_sap yes
prefers_naval_invasions yes
can_have_princess yes
has_family_tree yes


Внимание: Появляющаяся фракция должна быть той же культуры, что и фракция из которой она появляется и у них должны быть одинаковые бодигарды!
3) Как только вы сделаете все вышеперечисленное переходите к третьему этапу. Добавьте в descr_strat запись о появляющейся фракции.

faction portugal, balanced smith
ai_label catholic
dead_until_emerged
re_emergent
denari 15000
denari_kings_purse 3000


Мы должны добавить несколько юнитов новой фракции, также нужно добавить генерала. Итак вы должны создать спавн скрипт на создание армии с генералом возле города или в городе. Вот как у меня:

character John, named character, male, age 27, x 83, y 169
traits GoodRiskyAttacker 1 , NaturalMilitarySkill 1 , GoodCommander 1 , BattleDread 2 , StrategyDread 1 , LoyaltyStarter 1
army
unit SE Bodyguard exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0


character George, named character, label portugal1, male, age 25, x 70, y 165
traits GoodRiskyAttacker 1 , BattleDread 2 , StrategyDread 1 , LoyaltyStarter 1
army
unit SE Bodyguard exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0
unit Town Militia exp 0 armour 0 weapon_lvl 0


Я создал генерал-губернаторов провинций Порто и Визеу.


4) Теперь перейдем к файлу campaign_script. И найдем скрипт восстания баронов:

monitor_event FactionTurnEnd FactionType england
and I_NumberOfSettlements england > 15
and I_CompareCounter ba_first_emergence = 1
and I_NumberOfSettlements barons_alliance = 0
and I_EventCounter ba_last_spawn_timer > 10

generate_random_counter authority_value 1 100


;the lower the faction leaders authority, the greater the chance of the barons_alliance appearing
if I_FactionLeaderAttribute england Authority = 0

if I_EventCounter authority_value <= 33
faction_emerge barons_alliance england 5 50.0 145.0 0.9 town false
end_if

end_if

if I_FactionLeaderAttribute england Authority = 1

if I_EventCounter authority_value <= 25
faction_emerge barons_alliance england 6 60.0 135.0 0.9 town false
end_if

end_if

if I_FactionLeaderAttribute england Authority = 2

if I_EventCounter authority_value <= 20
faction_emerge barons_alliance england 6 65.0 130.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute england Authority = 3

if I_EventCounter authority_value <= 15
faction_emerge barons_alliance england 6 70.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute england Authority = 4

if I_EventCounter authority_value <= 10
faction_emerge barons_alliance england 6 80.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute england Authority = 5

if I_EventCounter authority_value <= 5
faction_emerge barons_alliance england 6 85.0 120.0 0.85 town false
end_if

end_if

if I_NumberOfSettlements barons_alliance > 0
set_event_counter ba_last_spawn_timer 0
historic_event barons_reemerge_poor_king
add_money barons_alliance 10000
end_if

end_monitor


Я сделал вывод и изменил Англию на Шотландию, Баронов на Португалию.(то есть упоменания о англии и баронах в скрипте поменял на упоменании о Шотландии и Португалии)

faction_emerge portugal scotland 4 80.0 120.0 0.85 town false

if I_NumberOfSettlements portugal > 0
add_money portugal 10000
set_counter portugal_emerge 1
end_if

historic_event portugal_emerges

end_monitor

;check when English leaders authority is low
monitor_event FactionTurnEnd FactionType scotland
and I_NumberOfSettlements scotland > 2
and I_NumberOfSettlements portugal = 0

generate_random_counter authority_value 1 100

;the lower the faction leaders authority, the greater the chance of the portugal appearing
if I_FactionLeaderAttribute scotland Authority = 0

if I_EventCounter authority_value <= 33
faction_emerge portugal scotland 4 80.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute scotland Authority = 1

if I_EventCounter authority_value <= 25
faction_emerge portugal scotland 4 100.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute scotland Authority = 2

if I_EventCounter authority_value <= 20
faction_emerge portugal scotland 4 100.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute scotland Authority = 3

if I_EventCounter authority_value <= 15
faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute scotland Authority = 4

if I_EventCounter authority_value <= 10
faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
end_if

end_if

if I_FactionLeaderAttribute scotland Authority = 5

if I_EventCounter authority_value <= 5
faction_emerge portugal scotland 4 80.0 120.0 0.85 town false
end_if

end_if

end_monitor


Португалия будет возникать в свою очередь в зависимости от авторитета генералов.

if I_FactionLeaderAttribute scotland Authority = 4

if I_EventCounter authority_value <= 10
faction_emerge portugal scotland 4 90.0 120.0 0.85 town false
end_if


Если авторитет лидера равен 4, то Португалия появится со следующими параметрами:

faction_emerge portugal scotland 4 90.0 120.0 0.85 town false

Значения:
emerging_faction: Португалия
target_faction: Шотландия
min_num_remain: 4 (Мин населенных пунктов, которые необходимо сохранить фракции, откуда появится ваша фракция).
max_order_threshold: 90 (максимум общественного порядка для появления новой фракции).
max_order_threshold_surrounding: 120 (максимальный общественный порядок в соседних провинциях для появления фракции)
min_level_threshold: город (минимальный уровень населенного пункта, где может появиться новая фракция).
fire_emerge_message: неправда(tru, false)
leader_script_label: не используется (опционально)
leader_name: не используется (опционально)
leader_age: не используется (опционально)


Автор: Polpolgio
Перевод: Хранитель

Добавить комментарий

Ссылки в комментариях не работают. Надоела капча - зарегистрируйся.

Защитный код
Обновить