How to: Create units ~ including unique units
The Client Kingdoms mod uses this in order to generate the troops the player is offered though there are many, many other uses.
Here's a sample script:
Code:
script
console_command create_unit Campus_Scythii "barb infantry briton" 4
end_script
In this case when the script is activated 4 units of the Briton Warband will be created in Campus Scythii.
It need not necessarily be a settlement, you can also use a character name. This example comes from the Prologue script.
Code:
script
console_command create_unit "Gaius Julius" "roman velite" 2
end_script
RomeShell provide these parameters:
Code:
create_unit (settlement/character_name) (unit_id) (opt: how many)(opt: exp/armour/weapon)
Here's the relevant points
- the troop description corresponds to their Type line in export_descr_unit
- character names must be in "quotes", settlements not
- double or triple-barrelled settlement names must have an _ instead of spaces
- importantly, the troops become owned by whoever controls the settlement or the character's faction, there is no need for a faction to be able to build the unit or even have ownership in export_descr_unit.
This gives us the potential to have unique units appear not just at the beginning of the game but also as it progresses as you can trigger this script based on date, the capture of a particular settlement, the construction of a building or anything else specified amongst the event identifiers.
And as no changes are needed to export_descr_unit it means that custom battles and bribery are completely unchanged.
Bookmarks