The -ai thing totally works. I just took over a Julii campaign in 168 BCE. Then I saved it. Then I closed RTW. Then I loaded it and played for a bit.
Totally. Works.
The -ai thing totally works. I just took over a Julii campaign in 168 BCE. Then I saved it. Then I closed RTW. Then I loaded it and played for a bit.
Totally. Works.
afaik the -ai switch will not work properly ...
at least I've ran a zillion games with the -ai switch and there is always "something" that makes me believe there is some diff. (dont ask me what, I just wouldnt risk it, the -ai switch clearly hasnt been intended to jump a campaign ... my advise, dont use it as such)
also about the "simulate_mouse_click lclick_down/up" ... afaik you do not need both, dont know where people got the 2nd command from but I'm not using it and have the same results ...
G
You're right. When I implemented the -ai switch in EB, I couldn't get the EB background script to work, even when I turned the ai switch off and reloaded the game.
just wondering, what are you trying to do?
make some sort of randomised start?
if so, there are easier ways imo, wich again leave slightly more of the control in your hands ...
like I've partially set up my game, take traits and ancillaries, I've made a few hidden traits, where one is used only in descr_strat, it is given to starting families wich than at characterturnstart get a random collection of traits
like so;
the stopgame trait prevents it giving traits again as its the startgame trait's antitrait, together with some random augmentation of the traits the generals get in descr_stratCode:;------------------------------------------ Trigger game_startup2 WhenToTest CharacterTurnStart Condition IsGeneral and Trait RS_StartGame >= 1 Affects RS_StopGame 1 Chance 100 Affects RS_Management 1 Chance 30 Affects RS_Influence 1 Chance 30 Affects RS_Law 1 Chance 30 Affects RS_Trading 1 Chance 30 Affects RS_TaxCollection 1 Chance 30 Affects RS_TrainingAgents 1 Chance 30 Affects RS_TrainingUnits 1 Chance 30
wich together wich some other settings creates a mild feel of a diff game each "turn 0" (gamestart), scripts can even do the same with entire factions
G
Hi RedSpot, I explained what I'm trying to do a bit more clearly in posts 9 and 11. It's not just about a randomised start - it's about starting the game at a whole new point in history, when the factions are a little more developed.
Since the -ai switch seems a bit buggy, I'm having another crack at my original script. What I'd really like to do now is to set up code to have the AI deal with battles and diplomacy.
Here's my script at the moment:
If I take out the comments on my new monitor_events, RTW 1.5 CTDs as it loads (presumably when it tries to load this script). But these events are in the docudemon - can anyone tell me what I'm doing wrong?script
declare_counter loop
set_counter loop 0
monitor_event FactionTurnStart FactionType romans_julii
and I_TurnNumber < 5
console_command control greek_cities
campaign_wait 10
console_command add_money 40000
console_command control romans_julii
end_monitor
;monitor_event PreBattlePanelOpen
;console_command puppify_my_love
;end_monitor
;monitor_event NavalAutoResolvePanelOpen
;console_command puppify_my_love
;end_monitor
;monitor_event DiplomacyMission
;console_command puppify_my_love
;end_monitor
;monitor_event ScrollOpened
;console_command puppify_my_love
;end_monitor
while I_CompareCounter loop = 0
end_while
end_script
The script is pretty much working. I ripped off some of the code from the EB team - it automatically resolves land and sea battles and exits from diplomacy screens. I still need to:
1. Figure out a way to automatically dismiss the battle results scroll after a land or sea battle.
2. Figure out a way to automatically dismiss all the other scrolls that pop up (blah blah senate mission, etc). They don't pause the turn sequence, but they do create lag.
Here's the code, I'd be very grateful if anyone could help:
script
;
declare_counter loop
set_counter loop 0
;
declare_counter clickAutoResolve
set_counter clickAutoResolve 0
;
declare_counter clickAutoResolveNaval
set_counter clickAutoResolveNaval 0
;
declare_counter declineDiplomaticOffer
set_counter declineDiplomaticOffer 0
;
monitor_event FactionTurnStart FactionType romans_julii
console_command control greek_cities
console_command add_money 40000
end_monitor
;
monitor_event FactionTurnStart FactionType greek_cities
console_command control romans_julii
console_command add_money 40000
inc_counter loop 1
end_monitor
;
monitor_event PreBattlePanelOpen TrueCondition
set_counter clickAutoResolve 1
end_monitor
;
monitor_conditions I_CompareCounter clickAutoResolve = 1
set_counter clickAutoResolve 0
select_ui_element prebattle_auto_resolve_button
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
monitor_event NavalAutoResolvePanelOpen TrueCondition
set_counter clickAutoResolveNaval 1
end_monitor
;
monitor_conditions I_CompareCounter clickAutoResolveNaval = 1
set_counter clickAutoResolveNaval 0
select_ui_element prebattle_auto_resolve_button
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
monitor_event DiplomacyPanelOpen TrueCondition
set_counter declineDiplomaticOffer 1
end_monitor
;
monitor_conditions I_CompareCounter declineDiplomaticOffer = 1
select_ui_element confirm_quit_scroll
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
while I_CompareCounter loop < 5
end_while
;
console_command control egypt
;
end_script
The script is pretty much working. I ripped off some of the code from the EB team - it automatically resolves land and sea battles and exits from diplomacy screens. I still need to:
1. Figure out a way to automatically dismiss the battle results scroll after a land or sea battle.
2. Figure out a way to automatically dismiss all the other scrolls that pop up (blah blah senate mission, etc). They don't pause the turn sequence, but they do create lag.
Here's the code, I'd be very grateful if anyone could help:
script
;
declare_counter loop
set_counter loop 0
;
declare_counter clickAutoResolve
set_counter clickAutoResolve 0
;
declare_counter clickAutoResolveNaval
set_counter clickAutoResolveNaval 0
;
declare_counter declineDiplomaticOffer
set_counter declineDiplomaticOffer 0
;
monitor_event FactionTurnStart FactionType romans_julii
console_command control greek_cities
console_command add_money 40000
end_monitor
;
monitor_event FactionTurnStart FactionType greek_cities
console_command control romans_julii
console_command add_money 40000
inc_counter loop 1
end_monitor
;
monitor_event PreBattlePanelOpen TrueCondition
set_counter clickAutoResolve 1
end_monitor
;
monitor_conditions I_CompareCounter clickAutoResolve = 1
set_counter clickAutoResolve 0
select_ui_element prebattle_auto_resolve_button
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
monitor_event NavalAutoResolvePanelOpen TrueCondition
set_counter clickAutoResolveNaval 1
end_monitor
;
monitor_conditions I_CompareCounter clickAutoResolveNaval = 1
set_counter clickAutoResolveNaval 0
select_ui_element prebattle_auto_resolve_button
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
monitor_event DiplomacyPanelOpen TrueCondition
set_counter declineDiplomaticOffer 1
end_monitor
;
monitor_conditions I_CompareCounter declineDiplomaticOffer = 1
select_ui_element confirm_quit_scroll
simulate_mouse_click lclick_down
simulate_mouse_click lclick_up
end_monitor
;
while I_CompareCounter loop < 5
end_while
;
console_command control egypt
;
end_script
It occurs to me that I could use the same counter for both land and sea battles, and just create two separate triggers for activating that counter. I might do that, if only for the sake of efficiency.
But getting rid of the battle results screen is the key concern. Do you think I could just nerf the entire UI while the script is running?
Bookmarks