- Dec 14, 1999
- 18.436
- 39.143
Hello everyone and welcome to another development diary for Imperator! Today we’ll delve into what we call unit-abilities, and also show off some interesting and fun modding mechanics.
What we call unit-abilities in Imperator can be one of three categories, where some of them are hardcoded like moving cohorts between legions or detaching a siege force, while others are fully 100% done through our script.
Reorganisational
Please be aware that cohorts that are loyal to its commanders will not be possible to reorganise away from that commander.
Toggles
Some of these are unlocked by different military traditions, and some of them are always available, and some toggles have a small military power cost.
Actions
Some of these are unlocked by different military traditions, and some of them are always available.
Modding Support
So, making lots of these scriptable was possible due to the new super-powerful scripting tools of Jomini, which is the game-mechanics layer we have on top of Clausewitz these days.
We have some nice ways to get dynamic values in effects, like this in the raiding mechanics. You can basically access any “trigger” from any scope you can switch to as a value and modify with each other.
We can also do loops, which is used in the levies.
And for those of you that modded previous games, and know about city, character and country scopes, will be happy to know that Imperator has those and far more, like unit scope, pop scope, party scope, etc..
Next week, we'll be back with a look at the technology system!
What we call unit-abilities in Imperator can be one of three categories, where some of them are hardcoded like moving cohorts between legions or detaching a siege force, while others are fully 100% done through our script.
Reorganisational
- Create New Unit - Allows you to create a new unit and transfer cohorts/ships to it, or back.
- Consolidate - Merges cohorts of the same type, and then disbands empty cohorts.
- Detach Siege - Leaves behind a large enough force to siege or occupy the current city.
- Split Half - Splits the Unit in Half
- Recruit To - Opens up the recruit window, so you can recruit cohorts/ships directly to this unit. They will automatically march and merge to this unit.
- Disband - For when you don’t want that unit anymore.
Please be aware that cohorts that are loyal to its commanders will not be possible to reorganise away from that commander.
Toggles
- Select Objective - Can Select an Objective for this unit, and it will perform it without further input from you. More details in a later development diary.
- Allow Attachment - Allow other nations units to attach to this one.
- Cavalry Skirmish - Trades Defense for Offense on Light Cavalry and Camels.
- Phalanx - Slower movement for armies, while heavy infantry defence is much stronger.
- Padma Vyuha - Slower movement for heavy infantry defence and archer offence
- Unit Reorganisation - Double Maintenance and Slow movement speed, but unit reinforcing and morale recovery is much faster. Without using this, units recover slower than in previous games.
- Force March - Heavier Attrition and No morale recovery while moving much faster.
Some of these are unlocked by different military traditions, and some of them are always available, and some toggles have a small military power cost.
Actions
- Attach/Detach to Unit - Attach/Detach to another unit present in the city.
- Shattered Retreat - Gives the order for the unit to perform a shattered retreat. This is handy if you want to save the remnants of your army trapped deep in enemy territory, or when you are cut off by hostile Forts.
- Construct Border Fort - Creates a colony in an unowned city bordering you, adding 1 freeman pop of your culture and a fort for military power.
- Desecrate Holy Site - Spend religious power in another nations capital to reduce their omen power for a long time.
- Raise Levies - Spend Military Power to get more cohorts to your unit.
- Military Colonies - Spend Military Power to create a freeman pop of your culture/religion in the current city.
- Raid City - Spend Military Power to get gold and manpower from an enemy city.
- Build Road - Spend Military Power to build a road towards the next city the army moves to.
Some of these are unlocked by different military traditions, and some of them are always available.

Modding Support
So, making lots of these scriptable was possible due to the new super-powerful scripting tools of Jomini, which is the game-mechanics layer we have on top of Clausewitz these days.
We have some nice ways to get dynamic values in effects, like this in the raiding mechanics. You can basically access any “trigger” from any scope you can switch to as a value and modify with each other.
Code:
unit_owner = {
add_treasury = {
value = root.unit_location.total_population
multiply = root.unit_location.civilization_value
divide = 100
}
add_manpower = {
value = root.unit_location.total_population
multiply = root.unit_location.civilization_value
divide = 250
}
}
We can also do loops, which is used in the levies.
Code:
while = {
count = {
value = root.unit_owner.max_manpower
multiply = 0.25
round_up = yes
}
add_subunit = light_infantry
}
And for those of you that modded previous games, and know about city, character and country scopes, will be happy to know that Imperator has those and far more, like unit scope, pop scope, party scope, etc..
Next week, we'll be back with a look at the technology system!
- 1