Log in

View Full Version : Population Cost Script Effect Possible?



Malachus
03-05-2007, 01:42
By using scripts, is it possible to mimic the population cost effect that was present in RTW where the number of soldiers in a unit trained were deducted from the settlement's population?

Maybe something along the lines of: if unit X is created in settlement Y, then add -Z to the population?

Granted, if this is possible, I'm assuming it would require a separate entry for each unit in the game and one for each settlement resulting in TONS of lines of code.

But, since realism is the ultimate goal for a lot of mods out there, this would be a pretty cool idea to incorporate. Indeed, for cities that have populations of 30,000+, recruiting 5 units of 150 men each really won't have much of an impact but at least it'd be nice to know that it does matter how many troops you train and when (especially in the early game, where settlement populations are low).

FactionHeir
03-13-2007, 14:45
Hmmm I guess you'd have to look at the RTW files to figure out which file made the change and whether the same file is present in M2TW.

As a guess though, you could try the food variable in the unit file. The comment says its no longer used, but maybe that is what took the population? Worth a try anyway.

alpaca
03-14-2007, 16:13
Well you should be able to use the UnitTrained event with a monitor_event that executes console_command add_population <settlement> <unit_size> - however you'd have to do that for each unit/settlement combination and it wouldn't change with the unit size setting the player makes.

adembroski
03-16-2007, 04:16
I don't know that I like that idea, purely based on the fact that it assumes all troops are drawn from the settlement itself, rather than the countryside surrounding it.