UPDATE: not possible it would seem. With disable_entire_ui, "entire" does not include UI elements on scrolls; it does not disable scrolls or their buttons, only the 'main' UI elements like turn end button and so forth. Therefore, presumably, disable_ui doesn't work on scroll buttons either.
Does anybody know how to disable the prebattle scroll's "Fight" and (optionally) "Withdraw" buttons, thus forcing the player to use autoresolve?
I have tried disable_ui commands on those buttons but nothing seems to work on that scroll. I also tried disabling the entire ui and then enabling just the autoresolve button.
Thanks in advance.
EDIT: To expand on what I have tried...
Firstly, I found that the PreBattle scroll actually opens twice. Or at least that [monitor_event ScrollOpened ScrollOpened prebattle_scroll] triggers twice when armies clash.
So my script looks like this:
I thought that perhaps the double-triggering was somehow interfering with disable_ui so I have added a counter such that disable_ui will only be performed on the second opening.Code:set_event_counter pb_scroll_opened_count 0 monitor_event ScrollOpened ScrollOpened prebattle_scroll inc_event_counter pb_scroll_opened_count 1 if I_EventCounter pb_scroll_opened_count == 2 ;historic_event nazgul disable_ui prebattle_fight_button set_event_counter pb_scroll_opened_count 0 end_if end_monitor
The historic_event is there to confirm that this part of the script is actually being reached. So yes: disable_ui is being invoked but it is doing nothing. Other buttons wouldn't disable either when I tried those instead. And the same behaviour if I remove all of my double-trigger handling code.
Turning this monitor into a PreBattlePanelOpen one instead had the exact same behaviour: double-trigger and no effect.
Oh, and I also tried simulating a click on the autoresolve instead of disabling the other buttons...
That did nothing also.Code:set_event_counter pb_scroll_opened_count 0 monitor_event ScrollOpened ScrollOpened prebattle_scroll inc_event_counter pb_scroll_opened_count 1 if I_EventCounter pb_scroll_opened_count == 2 select_ui_element prebattle_auto_resolve_button simulate_mouse_click lclick_down simulate_mouse_click lclick_up set_event_counter pb_scroll_opened_count 0 end_if end_monitor
This is in Kingdoms.




Reply With Quote





