Epistolary Richard
11-14-2006, 02:22
'Scuse my excitement about this one - I got into the modding game to mess around with recruitment so this - along with the other new additions to edb - make my head spin with the possibilities. :dizzy2:
This is all about three scripting commands which give us a great deal of control over the size of recruitment pools for special cases which can't be covered by the standard refresh rates in edb.
The three commands are these (examples from the Norman prologue campaign script):
freeze_recruit_pool all true (also uses region_name as well as all)
- this prevents all unit recruitment (not agent recruitment) from occurring in the settlement.
set_recruit_pool region_name value unit_name
- this sets the number of the pool for this unit
For example:
set_recruit_pool London_Province 3 Spear Militia
inc_recruit_pool region_name value unit_name
- this increments the amount in the pool for this unit by this amount, can also be negative
For testing and results see the bottom of this thread.
The possibilities
Fundamentally, this gives us the power through the scripts alone - and using all the conditionals we're used to in scripts - to determine on a unit and province basis what troops are available to be recruited.
Major reforms, big events like gunpowder, stuff like that is better determined through event conditions in edb - but think of the smaller scale...
- you gain an alliance with another power and that grants you a recruitment pool of a new unit in a settlement of yours near to them
- cities recently conquered are unable to produce troops for a certain number of turns
- the death of a king might stop recruitment across a whole empire
- capturing a settlement suddenly allow (or prevent) recruitment of a troop type
- 1 off unique units!
- pools based on the happiness level and taxation of settlements
- a special event or a date or even enemy proximity would grant you a new pool you could recruit from
Fundamentally, any convergence of events you can script can now provide a recruitment pool effect.
Testing and results
Here's the section of script I used:
freeze_recruit_pool London_Province true
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 4
set_recruit_pool London_Province 3 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 5
set_recruit_pool London_Province 9 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 6
set_recruit_pool London_Province 1 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 7
inc_recruit_pool London_Province -2 Spear Militia
terminate_monitor
end_monitor
So, the number in the pool should go 0 -> 3 -> 9 -> 1 -> 0 (-1)
0
https://img170.imageshack.us/img170/2985/freezerecruitno2.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruitno2.jpg)
3 (NB, though it says will produce another unit in 2 turns, this does not actually occur)
https://img170.imageshack.us/img170/8122/freezerecruit2jn0.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruit2jn0.jpg)
9
https://img170.imageshack.us/img170/3285/freezerecruit3xr8.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruit3xr8.jpg)
1
https://img382.imageshack.us/img382/4524/freezerecruit4qm9.th.jpg (https://img382.imageshack.us/my.php?image=freezerecruit4qm9.jpg)
0
https://img142.imageshack.us/img142/3669/freezerecruit5by7.th.jpg (https://img142.imageshack.us/my.php?image=freezerecruit5by7.jpg)
Of course, you don't have to freeze recruitment to use this - it can continue to replenish normally, just leave out the freeze line above.
This is all about three scripting commands which give us a great deal of control over the size of recruitment pools for special cases which can't be covered by the standard refresh rates in edb.
The three commands are these (examples from the Norman prologue campaign script):
freeze_recruit_pool all true (also uses region_name as well as all)
- this prevents all unit recruitment (not agent recruitment) from occurring in the settlement.
set_recruit_pool region_name value unit_name
- this sets the number of the pool for this unit
For example:
set_recruit_pool London_Province 3 Spear Militia
inc_recruit_pool region_name value unit_name
- this increments the amount in the pool for this unit by this amount, can also be negative
For testing and results see the bottom of this thread.
The possibilities
Fundamentally, this gives us the power through the scripts alone - and using all the conditionals we're used to in scripts - to determine on a unit and province basis what troops are available to be recruited.
Major reforms, big events like gunpowder, stuff like that is better determined through event conditions in edb - but think of the smaller scale...
- you gain an alliance with another power and that grants you a recruitment pool of a new unit in a settlement of yours near to them
- cities recently conquered are unable to produce troops for a certain number of turns
- the death of a king might stop recruitment across a whole empire
- capturing a settlement suddenly allow (or prevent) recruitment of a troop type
- 1 off unique units!
- pools based on the happiness level and taxation of settlements
- a special event or a date or even enemy proximity would grant you a new pool you could recruit from
Fundamentally, any convergence of events you can script can now provide a recruitment pool effect.
Testing and results
Here's the section of script I used:
freeze_recruit_pool London_Province true
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 4
set_recruit_pool London_Province 3 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 5
set_recruit_pool London_Province 9 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 6
set_recruit_pool London_Province 1 Spear Militia
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and I_TurnNumber = 7
inc_recruit_pool London_Province -2 Spear Militia
terminate_monitor
end_monitor
So, the number in the pool should go 0 -> 3 -> 9 -> 1 -> 0 (-1)
0
https://img170.imageshack.us/img170/2985/freezerecruitno2.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruitno2.jpg)
3 (NB, though it says will produce another unit in 2 turns, this does not actually occur)
https://img170.imageshack.us/img170/8122/freezerecruit2jn0.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruit2jn0.jpg)
9
https://img170.imageshack.us/img170/3285/freezerecruit3xr8.th.jpg (https://img170.imageshack.us/my.php?image=freezerecruit3xr8.jpg)
1
https://img382.imageshack.us/img382/4524/freezerecruit4qm9.th.jpg (https://img382.imageshack.us/my.php?image=freezerecruit4qm9.jpg)
0
https://img142.imageshack.us/img142/3669/freezerecruit5by7.th.jpg (https://img142.imageshack.us/my.php?image=freezerecruit5by7.jpg)
Of course, you don't have to freeze recruitment to use this - it can continue to replenish normally, just leave out the freeze line above.