PDA

View Full Version : Idea: Scripted limits to unit recruitment?



MiniMe
11-06-2007, 22:56
Dear EB developers!

Kingdom Crusades script has a very interesting thing - unit counters.
You can recruit only one very special unit, after that counter is set to 0, and is set back to 1 only after you lose this unit.
My idea is: evolve it. This could be a perfect solution to limit all unit recruitment and link it to amount and size of faction provinces.

Example: KH

SCRIPT:
counter "of KH heavy infantry":
if monitor_event "huge city captured" then set counter "of KH heavy infantry" +4
if monitor_event "large city captured" then set counter "of KH heavy infantry" +2
if monitor_event "huge city lost" then set counter "of KH heavy infantry" -4
if monitor_event "huge city lost" then set counter "of KH heavy infantry" -2
if Thorakitai recruited then set counter "of KH heavy infantry" -1

EDB:
recruit Thorakitai requires (...resources...) and counter "of KH heavy infantry" >0

(of course, my example is not exactly how it should look like, I'm ain't a scripter, but I hope you've got the idea despite my poor scripting skills and pidgin english)

Yes, this means we need several very complicated counters for every faction, but in the end it will be possible to achieve historically correct numbers and composition of armies for every faction, like Rome'd be able to field 10 Post Marian Legionary cohorts per huge city or Pahlavans'd be able to field 2 Parthian Cataphracts and 6 Persian Archer-spearmen per large city.

Hope my idea could be of any use to you,
Best regards,
MiniMe

bovi
11-07-2007, 00:14
I thought that only worked for agents. Sounds interesting.

Leão magno
11-10-2007, 13:07
If this could be implemented we would feel the diference between grand and small factions arise even more... how would the AI react to that limitation to all units?

Charge
11-10-2007, 13:18
Doesn't you not need script at all to emulate this? EDB and limited numbers of unit per building (= per city size), and very low or off spawning frequency (not like vanilla's 0.5-2 units per turn) can do it too.

antisocialmunky
11-10-2007, 16:35
Doesn't you not need script at all to emulate this? EDB and limited numbers of unit per building (= per city size), and very low or off spawning frequency (not like vanilla's 0.5-2 units per turn) can do it too.

This is different, its like agents. It makes it so you can't build units after you have a certain amount of them.

MiniMe
11-10-2007, 21:27
If this could be implemented...
"if" is the key word here. I'm not sure whether my idea could be implemented at all. Only serious modders and scripters, not one of my kind (able only to mess with descr_mount, descr_model_battle, EDB, EDU) could answer this question.

...we would feel the diference between grand and small factions arise even more...
quite the opposite. Currently AI priority is unit recruitment. If AI has 15 provinces and enough money (and through script he has), he will recruit 15 units. And next turn he will recruit another 15. And next turn he'll do the same. Heard of Grey Death Ultrastacks, did ye?

...how would the AI react to that limitation to all units?
Just the way he reacts now in Crusades, when he's done recruiting Templar uniqe unit - he'll stop recruit them since there's no more such a possibility for him

It makes it so you can't build units after you have a certain amount of them.
Yep, that's exactly what I was trying to say.

Charge
11-11-2007, 00:23
It makes it so you can't build units after you have a certain amount of them.Disable respawn (2nd i think number)

alpaca
11-11-2007, 14:44
Unfortunately you don't have a unit number condition, all you got is a unit exists condition. What you can do is to limit the pool to one unit max with some tricks but it's not really possible to limit it to, say, three units or four units (at least unless somebody proves me wrong).

Charge
11-11-2007, 15:47
@alpaca


I believe that if you limit number of units per building (=per city),
recruit_pool "Demi Lancers" 2 0.5 2 0

and set reappearance to 0 (or very low)
recruit_pool "Demi Lancers" 2 0 2 0

you will have limited amount of them which faction can train and have,
but yet I haven't much testing with it. I suppose you can train new units when some have died, until you fullfill max unit numbers..

This doesn't appear to mercenaries, etc..

Explain please if I wrong

alpaca
11-11-2007, 16:00
@alpaca


I believe that if you limit number of units per building (=per city),
recruit_pool "Demi Lancers" 2 0.5 2 0

and set reappearance to 0 (or very low)
recruit_pool "Demi Lancers" 2 0 2 0

you will have limited amount of them which faction can train and have,
but yet I haven't much testing with it. I suppose you can train new units when some have died, until you fullfill max unit numbers..

This doesn't appear to mercenaries, etc..

Explain please if I wrong
Yeah thing is if you do this, you will get two units of these in every settlement, and then none again until infinity.

MiniMe
11-11-2007, 20:09
Charge, I'm afraid Alpaca's right.
Take a look at Crusades campaign script (I suppose, you have it),
part "RECRUITMENT - UNIQUE UNITS"
If they could have limit unique units recruitment your way, they wouldn't bother to write all that staff.