PDA

View Full Version : I cracked Era System for Units!!!



DukeofSerbia
12-29-2006, 18:53
Hello ladies and gentlemen in ORG.

I successfully found way for implementing eras in Medieval II Total War! And it works much better than in first Medieval. :2thumbsup:

I again red Epistolary Richard “Final Report from Brisbane” https://forums.totalwar.org/vb/showpost.php?p=1294779&postcount=1 and found something interesting what he mentioned:



export_descr_buildings.txt
edb now controls the initial number of units available to be recruited from different buildings, the refresh rate and the unit max in a similar manner to mercenaries. You can also control what buildings do when the settlement is converted from city to castle and vice versa. Some hidden resources are now used in descr_missions.txt, to prefer guild and crusade/jihad targets _and_ - which I know some people will find most exciting – allow brigands and pirates to be completely switched off in certain provinces via a script command!

Perhaps most interestingly, there’s a new event_counter condition that can be used – referencing events in descr_events and in the campaign script. This should allow complete control over when and how certain troops become available to be recruited.

In terms of hardcoded limits – 64 for hidden resources as before, now up to 10 buildings in a chain (consecutively, without needing to branch) and I’m told that there doesn’t appear to be any limit on the number of complexes – however I’m taking this with a pinch of salt personally. We better test it first.

I tested what he wrote and it works!

In export_descr_buildings.txt only condition used is



and event_counter gunpowder_discovered 1

This line is added to units which need gunpowder. Gunpowder event is in descr_events.txt. Event is:



event historic gunpowder_discovered
date 160 170
movie event/gunpowder_invented.bik

Because game starts in 1080 that means that event will occur somewhere between 1240 and 1250 (date is in years after starting year: 1080+160 or 1080+170). In original MTW it was in 1270 (now can be set manually :)). There are 27 (if I counted well :)) historical events in descr_events.txt. This means 27 various conditions for units. And you can set even manually dates! Comparing to three eras in original this is El Dorado!!!

All what you need is to add line after unit in export_descr_buildings.txt:



and event_counter ? x

? can be first_windmill, earthquake_in_aleppo, science_alchemy_book, and etc (look in descr_events.txt).
x is number and from what I found it must be 1!

Example

If you are annoyed like me that Janissary troops are available before 1300, then add line in export_descr_buildings.txt



recruit_pool "Janissary Archers" 1 0.34 3 1 requires factions { turks, } and event_counter football_banned 1

When event hits in 1314 (if is starting year 1080) you’ll got Janissary troops. What can I add? This is great possibility for implementation of various dynasties and units in factions. I already started that and will be introduced in my new mod but next month about it…

I tested even more. I tried earthquake and plague events and it works! This means 4 earthquakes and 5 plague events. Total 36 events. Basically, you can add more events but I don’t know hard core limits. :book:

Now, somebody ask how to send units in pension like was in original MTW. I mean I want to pension later Viking and some other units. Peace of cake! Just use conditional “and not”:



recruit_pool "Janissary Archers" 1 0.34 3 1 requires factions { turks, } and not event_counter football_banned 1

You want even more? You can combine even further :yes::



recruit_pool "Hobilars" 1 0.5 4 0 requires factions { england, } and event_counter first_european_paper 1 and not event_counter science_maths_zero_europe 1

This means that Hobilars will be available between 1150 and 1202 if starting year is 1080. Historical fanatics and realistic mods now can add more events and control units years of appearing. Not simply like mercenaries (where you put exact dates), but with additional (simple) coding this is obviously possible.

My two cents :).:smash:


UPDATE

I played with files even further (I forgot to write it in forum). Ha ha ha. :laugh4:

In descr_events.txt can be add your event. Peace of cakes! But it has to be counter type of event.



counter - just increase a counter

I added following event:



event counter zivela_srbija
date 1


After one year this counter event will happen.
Now open export_descr_buildings.txt and add it to unit(s) which you want:



recruit_pool "Hobilars" 1 0.5 4 0 requires factions { england, } and event_counter zivela_srbija 1

After one year Hobilars will appear.

This is open wide possibilities. For historical mods that mean you can control appearance of units to be historical as much as possible.
And remember – you won’t be informed that event happened but in tech tree you’ll see change. :2thumbsup:

dopp
01-02-2007, 12:59
Would you be able to add your own custom events? Kind of funny how football being banned affects the appearance of Janissaries... I see potential for confusion right there.

alpaca
01-02-2007, 14:16
That should be possible, iirc you could add historic events in RTW (or at least in BI). However I'm not sure how I did it back then. I'm not sure how it works with the event counters though.

Csatadi
01-03-2007, 00:20
Great! :balloon2:

dragases1453
01-04-2007, 10:38
Really great!

Savage_German
01-04-2007, 10:43
Another guy has done this before, you know.

DukeofSerbia
01-17-2007, 12:24
UPDATE

I played with files even further (I forgot to write it in forum). Ha ha ha. :laugh4:

In descr_events.txt can be add your event. Peace of cakes! But it has to be counter type of event.



counter - just increase a counter

I added following event:



event counter zivela_srbija
date 1


After one year this counter event will happen.
Now open export_descr_buildings.txt and add it to unit(s) which you want:



recruit_pool "Hobilars" 1 0.5 4 0 requires factions { england, } and event_counter zivela_srbija 1

After one year Hobilars will appear.

This is open wide possibilities. For historical mods that mean you can control appearance of units to be historical as much as possible.
And remember – you won’t be informed that event happened but in tech tree you’ll see change. :2thumbsup:

phoenix[illusion]
01-18-2007, 19:02
[QUOTE=DukeofSerbia]


recruit_pool "Hobilars" 1 0.5 4 0 requires factions { england, } and event_counter zivela_srbija 1
[QUOTE]
This is the best part of message:laugh4:

simke_90
07-12-2007, 15:16
Can someone tell me how to change population limit from 255000 to,I don't know,few millions?