PDA

View Full Version : Year Jump mod for EB (help wanted)



mrtwisties
11-27-2007, 09:34
Aaages back, Epistolary Richard created a year jump mod for BI. It handed control to the computer for a set number of turns, after which you took over.

I'd really like to get something similar working for EB. The particular use that I have for it is I want to start as the Saka Rauka in Chighu in 172 BCE and run like hell from the Yuezhi. One way or another, it's going to make a fantastic AAR. But this capability would add to the replay value of any faction.

I'm sure you can think of a bunch of other uses for it. Gotten bored of your campaign? Fast-forward 50 years (and perhaps change factions) and explore the alternate history of the world you're creating. Testing a money script or similar AI behaviour mod? Let the computer play it through for a hundred years or more on your behalf.

The trick, of course, is to get it working.

In the spoiler, you can see the version of Epistolary Richard's code that you would use if you were playing with the Alemanni.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; WELCOME TO YEAR JUMP ;;;
;;; Follow the instructions below ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

script
console_command control slavs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; BEFORE YOU LAUNCH THE GAME ;;;
;;; Input the _turn_ number you want to jump to ;;;
;;; (2 turns in a year) in place of the '5' below ;;;
;;; ;;;
;;; - number cannot exceed 93 (Slavs emerge) ;;;
;;; - if your own faction or Sassanids are destroyed ;;;
;;; then it will not work, reload campaign ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; DO NOT CHANGE ANYTHING ABOVE HERE ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; INSERT DESIRED TURN NUMBER IN LINE BELOW
while I_TurnNumber < 5


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; DO NOT CHANGE ANYTHING BELOW HERE ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end_while
console_command control sassanids
wait 3
console_command control alemanni

monitor_event FactionTurnEnd FactionIsLocal
and Treasury < -50000
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnEnd FactionIsLocal
and Treasury < -40000
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnEnd FactionIsLocal
and Treasury < -30000
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnEnd FactionIsLocal
and Treasury < -20000
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnEnd FactionIsLocal
and Treasury < -10000
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnEnd FactionIsLocal
and Treasury < 0
console_command add_money 10000
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and Treasury > 0
set_counter loop 1
terminate_monitor
end_monitor
while I_CompareCounter loop < 1
end_while
end_script


It's very simple code. The problem is that it depends on the existence of an emergent faction, and AFAIK I'm not going to be able to put an emergent faction into EB.

Since I'm pretty new to modding, and since I've already stuffed up my EB installation and won't have the time to reinstall for at least a week, I'd like your advice on how to proceed.

So far as I've come up with, there are two options:

1. Create a loop that works something like this:

script
console_command control [faction1]
console_command run_ai
wait 100
console_command control [faction2]
console_command run_ai
wait 100
while I_TurnNumber < 5 ; you can change this to whatever
end_while
[transitional code to put you back in control of your own faction with > 0 cash]
end_script

The idea is that you'd switch to controlling faction 1, then run the AI until it's faction 1's turn, then switch to controlling faction 2, then run the AI until it's faction 2's turn, then go back to the beginning.

Would this work? Is my code for it correct? Should I use halt_ai commands rather than wait commands?

2. Turn the Casse into an emergent faction and use Epistolary Richard's code.

Any comments or suggestions would be extremely welcome.

mrtwisties
11-27-2007, 10:00
3. Use simulate_mouse_click to end turns, and set up a system to cycle through factions that you were in control of when the turn ended, so that every faction got to be controlled by the AI at least for most of the time.

mrtwisties
11-28-2007, 09:05
I had a go on RTW 1.5, which still works. Am having trouble: https://forums.totalwar.org/vb/showthread.php?t=95802

mrtwisties
11-28-2007, 13:28
This mod is now working for RTW 1.5, and when I get a chance I'll port it to EB. I'm surprised that no-one seems interested, given the number of people who wanted to get access to factional reforms as soon as possible. But I'll still release the code, just in case someone changes their mind.

Here's the RTW 1.5 version:



declare_counter loop
set_counter loop 0

monitor_event FactionTurnStart FactionType romans_julii
and I_TurnNumber < 50
console_command control greek_cities
campaign_wait 10
console_command add_money 40000
console_command control romans_julii
end_monitor

while I_CompareCounter loop = 0
end_while

overweightninja
11-28-2007, 13:35
This mod is now working for RTW 1.5, and when I get a chance I'll port it to EB. I'm surprised that no-one seems interested, given the number of people who wanted to get access to factional reforms as soon as possible. But I'll still release the code, just in case someone changes their mind.

Here's the RTW 1.5 version:

Have a little patience mate, I notice this threads only been up a couple of days and this is certainly the first time I found it (in fact I came here from another thread).
I'm afraid I can't offer any practical help right now, just wanted to say this does sound like a great idea if you can get it going, would be REALLY useful.
Anyway all the best, I'll be following your progress :2thumbsup:
Cheers

mrtwisties
11-28-2007, 14:11
Fair call. I did sound a little petulant.

Gugus
11-28-2007, 15:19
Also intrested, only lurking. Unfortuantelly have no spare time and skills to help :).
G

mrtwisties
11-29-2007, 01:46
I now have a more elegant implementation of the code. As we speak, I'm fast-forwarding to 200 BCE in an EB campaign. I haven't loaded the background script, so time is passing extremely quickly.

I'll eventually need to change the triggers so that you can load the background script before fast-forwarding. I also need to nut out a few issues to make it a smoother ride. Once that's all done, I'll let you guys know.

Megas Methuselah
12-02-2007, 20:11
Wow. I admit, I never visit the unofficial mod part of EB's forum, and now that I did, I'm glad of it. I can't wait for this, it sounds so cool. I stopped playing a Baktrian campaign a while back because it got a little boring, with the same reason applying to any of my dead campaigns. This mod should put quite a bit of spice to these games.
:beam:




Someone should sticky this thread.

EDIT: I'm no help as a modder, sorry. But I want this mod!

mrtwisties
12-02-2007, 21:21
Cheers, M.

I can't get the battle results screen to disappear automatically, which means you have to hit enter sometimes when you're fast-forwarding. I've got some workarounds in mind, but it's not foolproof yet.

I also haven't tested it while the EB background script is running. If Pharnakes is right, it's going to go mental when I do that. Sigh.

Pharnakes
12-03-2007, 00:45
Yeah, sorry but I would be very suprised if you get this to work. Sorry:shame:

Mouzafphaerre
12-03-2007, 08:26
.

Someone should sticky this thread.
Thread Tools > Stick the thread to the top ~;)
.

mrtwisties
12-03-2007, 12:36
Wow. At first it seemed like Pharnakes was right. But then I restored all my backup files and it looks like I did something somewhere that completely broke EB. So Pharnakes may or may not be right, and it's time for an ol' fashioned "complete reinstall".

I'm planning to produce a modified version of the EBBS that plays for you for ten years whenever it's triggered. Hopefully that'll work...

overweightninja
12-03-2007, 14:16
I'm planning to produce a modified version of the EBBS that plays for you for ten years whenever it's triggered. Hopefully that'll work...

Good luck mate! :2thumbsup:

mrtwisties
12-03-2007, 15:18
Cheers, OWN. So far, so good. Have restructured my earlier code to fit in the EBBS, and it works fine in RTW 1.5 (I always test there first, because it's so much faster / easier to mod). Tomorrow I'll start the grand run.

mrtwisties
12-05-2007, 07:37
Or perhaps not :). Am still working on dismissing the diplomacy and battle results screens automagically. Does anyone know a good keypress utility? I've pretty much given up on scripting it. I don't think you can select the relevant ui_element from the script. Or at least, I don't know what the correct name is.

Pharnakes
12-05-2007, 12:11
Don't think you can script them away. In fact I'm sure you can't.

Might be able to switch them off in prefrences, though.

Lord Of Ruin
12-30-2007, 23:07
This sounds awesome for a quick jump into the future if you get bored, i don't mind clicking some battle resolves or diplomatic junk, ill take any working version you have that wont screw my game :beam:

PS: would it be save compatible?