PROGRESS!
I've gotten the basic functions of th elevy script working, as of right now, you build a muster_call building, then demolish it and you get units! I'm currently coming up with a bonus/penalty scheme to make it all nice n' balanced, but here's the campaign script code as of right now:
Code:
;=============================================================
;= O Levy Script by Alex Drake =
;=============================================================
;=============================================================
; Declare some local variables
;=============================================================
declare_counter Facnr
set_counter Facnr 1
declare_counter Facstart
set_counter Facstart 0
declare_counter Grrson
set_counter Grrson 0
;=============================================================
; Figure out if this is the player's turn and what faction he belongs to
;=============================================================
monitor_event FactionTurnStart FactionType england
and FactionIsLocal TrueCondition
;console_command puppify_my_love
if I_SettlementOwner London = england
set_counter Facstart 1
set_counter Facnr 5
set_counter Grrson 1
;console_command add_money england, 50000
end_if
end_monitor
;=============================================================
;
;=============================================================
declare_counter muster_exists
set_counter muster_exists 0
monitor_event SettlementTurnStart SettlementName London
and SettlementBuildingExists = muster_call
set_counter muster_exists 1
end_monitor
declare_counter muster_dne
set_counter muster_dne 0
monitor_event SettlementTurnEnd SettlementName London
and not SettlementBuildingExists = muster_call
set_counter muster_dne 1
end_monitor
declare_counter London_lev
set_counter London_lev 0
monitor_event SettlementTurnStart SettlementName London
and SettlementBuildingExists = wooden_wall
set_counter London_lev 1
end_monitor
declare_counter gov_chivalry
monitor_event SettlementTurnStart SettlementName London
and GovernorAttribute Chivalry >= 1
set_counter gov_chivalry 1
end_monitor
;=============================================================
;;;;; Monitor events to check if player built muster call
;=============================================================
declare_counter muster_destroyed
set_counter muster_destroyed 0
monitor_event SettlementTurnEnd SettlementName London
and not SettlementBuildingExists = muster_call
set_counter muster_destroyed 1
;console_command puppify_my_love
end_monitor
monitor_event FactionTurnEnd FactionType england
and I_LocalFaction england
if I_CompareCounter muster_destroyed 1
;console_command puppify_my_love
console_command add_money england, 50000
end_if
end_monitor
monitor_event FactionTurnEnd FactionType england
and I_LocalFaction england
if I_CompareCounter muster_exists = 1
and I_CompareCounter muster_dne = 1
create_unit London, Peasants, num 4, exp 1, arm 0, wep 0
create_unit London, Town Militia, num 2, exp 6, arm 0, wep 0
if I_CompareCounter gov_chivalry = 1
create_unit London, Spear_Militia, num 1, exp 2, arm 0, wep 0
end_if
;console_command puppify_my_love
end_if
end_monitor
suggestions?
Bookmarks