
Originally Posted by
BozosLiveHere
Holy crap....I never knew we could do that. That opens up a lot of possibilities. I have to see if it works in RTW now.
Afaik that only works in M2TW.
You could also do a trigger combined with an event counter setting though, it'd work equally well. In fact, I could directly trigger the normal ruler trait that way but I thought it'd make sense if the ruler isn't directly appointed both historically and from a gameplay point of view (so you can change your mind without penalty for example).
Edit: By the way, another nifty thing for modders that's related to this is my advisor cycle. I often have multiple advisors pending on events like SettlementSelected for example. So what I did is script an advisor cycle that cycles through the available messages when you select the settlement. So every time you click on it, you get the next message (if there are more than one). It's an easy way to overcome the problem of searching for a new interface for each interaction (because I'm also implementing things like Bishop titles and other offices).
Here's the code for it if you're interested (so far, only two possible states but more will be added):
Code:
declare_counter advisor_cycle_pos_select
declare_counter skip_monitor
monitor_event SettlementSelected SettlementName Florence
; Position 0: no character present
if I_CompareCounter advisor_cycle_pos_select == 0
if I_CompareCounter advisor_cycle_character_present 1
advance_advice_thread No_Character_Present_Thread
set_counter skip_monitor 1
end_if
inc_counter advisor_cycle_pos_select 1
end_if
; Position 1: Province title/Cancel province title
if I_CompareCounter advisor_cycle_pos_select == 1
and I_CompareCounter skip_monitor == 0
if I_EventCounter Florence_Title == 0
advance_advice_thread New_Ruler_Thread
set_counter skip_monitor 1
end_if
if I_EventCounter Florence_Title == 3
advance_advice_thread Cancel_New_Ruler_Thread
set_counter skip_monitor 1
end_if
;inc_counter advisor_cycle_pos_select 1
set_counter advisor_cycle_pos_select 0
end_if
set_counter skip_monitor 0
end_monitor
Edit2: The above code also contains my implementation of an Else if statement (the skip_monitor thing)
Bookmarks