Log in

View Full Version : Making mercenary units trainable



FactionHeir
01-03-2008, 17:23
Today I was looking back at things I tried previously that didn't work out and how to modify them to make them work.

What I came across that was bugging me was making mercanry units trainable.
Initially, I only wanted them retrainable as in this topic:
https://forums.totalwar.org/vb/showthread.php?t=95283

However, as that didn't work out for some reason, I thought of scrapping the limit of only allowing retraining, in making the unit fully hirable.

As you can imagine, that didn't quite work either...

What I did:
Change descr_regions.txt to have several regions have a resource called levant
Change export_descr_buildings.txt to add levant as one of the hidden resources to the top
Change export_descr_buildings.txt to add following lines to large_stone_wall, huge_stone_wall, fortress and citadel:


recruit_pool "Crusader Sergeants" 1 0.2 2 0 requires factions { england, scotland, france, hre, denmark, spain, portugal, milan, venice, hungary, poland, sicily, } and hidden_resource levant
recruit_pool "Crusader Knights" 1 0.15 2 0 requires factions { england, scotland, france, hre, denmark, spain, portugal, milan, venice, hungary, poland, sicily, } and hidden_resource levant
recruit_pool "Religious Fanatics" 1 0.2 3 0 requires factions { england, scotland, france, hre, denmark, spain, portugal, milan, venice, hungary, poland, sicily, } and hidden_resource levant
recruit_pool "Great Cross" 1 0.1 1 0 requires factions { england, scotland, france, hre, denmark, spain, portugal, milan, venice, hungary, poland, sicily, } and hidden_resource levant
recruit_pool "Ghazis" 1 0.2 3 0 requires factions { egypt, turks, } and hidden_resource levant
recruit_pool "Mutatawwi'a" 1 0.2 4 0 requires factions { egypt, turks, } and hidden_resource levant

Change export_descr_unit.txt to add the factions to the ownership line of the above units
Started a new game as HRE, teleported a character to Damascus, took it after a turn using auto_win, add_population up to 24000, process_cq to build all walls and enough PO buildings to prevent a revolt.
Ended turn about 10 times.

Still cannot hire any of the units.
I tried above then also with removing the mercenary_unit attribute off the selected units, but that didn't help either.

Of course I could create a completely new unit resembling the above units, but it has to be the same unit in my case because I want this to allow retraining.

Any pointers on where I went wrong?

Charge
01-03-2008, 18:02
That might sound very stupid, but have you regenerated .rwm? (you haven't mentioned it)
It is so simple procedure that I constantly keep forgetting it :wall:
Or deleting it after changes to descr_regions isn't actual in M2TW ?

FactionHeir
01-03-2008, 19:43
Good point, I haven't deleted it because I didn't add any regions.
But maybe doing so will fix it... Will try it out in just a bit!

Thanks for the reply

FactionHeir
01-03-2008, 19:46
Yes, it works absolutely perfect now (tried as Egypt this time around as they start with Gaza).

Thanks a lot for your help Charge :bow:

alpaca
01-04-2008, 13:38
You might want to be careful with mercenary retraining. Mirage41 from BC mentioned a CTD to me in regions that are both able to recruit the unit and where you can get it as a merc unit (although the exact conditions aren't clear to me right now).
He said removing the ability to recruit it apparently fixed the problem so if you get weird ctds some dozens of turns into the game, have a look for this.

FactionHeir
01-04-2008, 13:53
Thanks for the heads up alpaca!

I haven't started a new campaign with those settings yet (trying to finish my old one first), but I think I know what could be causing the CTD you mention.

Retraining a mercenary unit usually draws from the mercenary pool to do so. When the pool is empty, you normally cannot retrain. However, if you can also recruit it in the settlement, it might try to draw from both pools and if the merc pool is empty but the settlement pool is not, it might cause a CTD or so...
That is coupled with the bug that if you try to retrain a merc from merc pool and add/remove it from the retraining queue a few times, it actually deplenishes the merc pool each time rather than replenishing it when you cancel retraining that same turn...

With your new information though, I'll make those units that are trainable in the resource regions non hirable from the merc pool of the same region. Hopefully that will work.

Thanks :grin:

alpaca
01-04-2008, 16:32
Yeah that was my theory, too. The game probably gets "confused" by which pool to apply here.

FactionHeir
01-04-2008, 19:05
Ran a few tests just now.

It seems that the game differentiates completely between units hired with the crusade tag and those without regardless of settlement availability of hire:

Any unit I hired as a crusading mercenary, I cannot retrain even if I can build that unit in a given settlement or even if I have the same unit without the crusading tag in the mercenary file for the same region.

Any same unit without the crusading tag cannot be retrained in a settlement that can build that unit.

Hirable mercenaries in settlements can only be retrained in a settlement's training pool, not the mercenary pool.

I guess that makes it completely impossible to enable a faction to hire a mercenary in a city and retrain it using a local merc pool and vice versa...

alpaca
01-07-2008, 20:25
Hmm that probably disproves our theory :laugh4: