Solution found! In export_descr_script.txt I put the following trigger:
Code:
Trigger 2134_Recruit_Legion_Trigger
WhenToTest SettlementPanelOpen
Condition I_SettlementSelected Rome
AdviceThread Recruit_Legion_Thread 0
And in the background script:
Code:
monitor_event SettlementPanelOpen Rome
and Treasury >= 5000
suspend_unscripted_advice false
end_monitor
monitor_event ButtonPressed advisor_speech_bubble
suspend_unscripted_advice true
end_monitor
And then finally the Legion Recruitment script:
Code:
script
select_ui_element advisor_dismiss_button
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
console_command create_unit Rome "roman hastati" 2
console_command create_unit Rome "roman princeps" 2
console_command create_unit Rome "roman velite" 2
console_command create_unit Rome "roman triarii" 1
console_command create_unit Rome "roman light cavalry" 1
console_command add_money -5000
console_command add_population Rome -1210
terminate_script
end_script
So what happens is that if you open the settlement panel for Rome (ie, double-click Rome) while the background script is running, it momentarily disables the "suspend_unscripted_advice" command, allowing seperate show_me scripts to run. Simultaneously, the Legion Recruitment show_me script runs (but only if Rome is selected), and the advisor pops up. Then, when the player clicks on the advisor's face (at least I think that's what advisor_speech_bubble is), the background script re-enables the "suspend_unscripted_advice" command.
For some reason, this can only be run once per turn, though, but that's no problem. I've only tested it briefly, so there may be some more little problems, but so far so good.
Now, to get it working with post-Marian Legions as well...
Bookmarks