I created the following script in data/world/maps/campaign/imperial_campaign/playerSiegeWithGeneralsOnly.txt
In descr.strat.txt, I appended the following at the bottom:Code:script monitor_event ScrollOpened ScrollOpened seige_scroll and I_AgentSelected general disable_cursor select_ui_element siege_end_button simulate_mouse_click lclick_down simulate_mouse_click lclick_up enable_cursor end_monitor end_script
It should work but it does not: When I take any faction and send an army without a general to a siege, I can besiege it as always. Instead, this script should automatically click abort siege when there is no general in my besieging army.Code:...script playerSiegeWithGeneralsOnly.txt
This is the scriptling_log.txt output when I test this feature - it shows no error message
Code:(playersiegewithgeneralsonly.txt) (SCOPE) Entering new scope, end token is end_script (playersiegewithgeneralsonly.txt::3) (CREATE) Creating token monitor_event (playersiegewithgeneralsonly.txt) (SCOPE) Entering new scope, end token is end_monitor (playersiegewithgeneralsonly.txt::5) (CREATE) Creating token disable_cursor (playersiegewithgeneralsonly.txt::6) (CREATE) Creating token select_ui_element (playersiegewithgeneralsonly.txt::7) (CREATE) Creating token simulate_mouse_click (playersiegewithgeneralsonly.txt::8) (CREATE) Creating token simulate_mouse_click (playersiegewithgeneralsonly.txt::9) (CREATE) Creating token enable_cursor (playersiegewithgeneralsonly.txt) (SCOPE) Got end token end_monitor, exiting scope (playersiegewithgeneralsonly.txt) (SCOPE) Got end token end_script, exiting scope