Re: Newbie scripting question [LevyScript]
alpaca:
when I try:
monitor_event SettlementTurnStart SettlementName London
and BuildingDestroyed = emergency_call
console_command puppify_my_love
console_command add_money england, 40000
end_monitor
I get puppies immediately whenever I start a new game, what sort of syntax can one put in the TrueCondition block? (Ie; I need to check for a specific building getting destroyed during a particular settlement's turn.
Also, is there a way to check the existence of a particular level of a building in a monitor event? I have the following buildings;
[General]
emergency_call
Level 1: Emergency Levy (City) - emergency_levy
castle_emergency_call
Level 1: Emergency Muster (Castle) - emergency_muster
[Militia Muster] (City)
city_muster
Level 1: Auxiliary Levy - auxiliary_levy
Level 2: General Levy - general_levy
Level 3: War Levy - war_levy
[Army Muster] (Castle)
castle_muster
Level 1: Auxiliary Muster - auxiliary_muster
Level 2: General Muster - general_muster
Level 3: Expeditionary Muster - expeditionary_muster
Level 4: War Muster - war_muster
But for some reason, when I do something like:
declare_counter muster_exists
set_counter muster_exists 0
monitor_event SettlementTurnStart SettlementName London
and SettlementBuildingExists = emergency_call
set_counter muster_exists 1
;console_command puppify_my_love
end_monitor
it works, whereas when I do this
declare_counter muster_exists
set_counter muster_exists 0
monitor_event SettlementTurnStart SettlementName London
and SettlementBuildingExists = emergency_levy
set_counter muster_exists 1
;console_command puppify_my_love
end_monitor
it never fires.
Am I using SettlementBuildingExists incorrectly (ie; can it only get the base building class and not building level), or is there another condition I can use instead?
Re: Newbie scripting question [LevyScript]
Nevermind, I figured it out!
Code:
monitor_event BuildingDestroyed BuildingName = war_levy
;;;;;Do some stuff
end_monitor
It works like a charm, now I just have to get the rest of the buildings together!
Re: Newbie scripting question [LevyScript]
Yeah the docudemon example for SettlementBuildingExists is a bit faulty.
You have to use
Code:
declare_counter muster_exists
set_counter muster_exists 0
monitor_event SettlementTurnStart SettlementName London
and SettlementBuildingExists emergency_call = emergency_level
set_counter muster_exists 1
;console_command puppify_my_love
end_monitor
As logic tokens you can use >, <, =, a combination of these and !=