Imperator: Rome

Imperator: Rome

Bricks, Marble and Your Imagination
Modify your Imperator: Rome experience by checking out the many mods created and shared by the community, including tweaks to almost any aspect of the game.
Doraemon 3 Sep, 2020 @ 11:24pm
Need Example for create_unit Script
It's been months since I last played Imperator. I am still trying to figure out how to script spawn army. I already looked on paradoxwikis modding section, but it's still hazy and unclear.

I've some experience in CK2 modding and here is a sample of my army spawn script:

character_event = {
id = bu2

is_triggered_only = yes

hide_window = yes

immediate = {
location = {
ROOT = {
spawn_unit = {
province = PREV
home = PREV
owner = THIS
troops = {
light_infantry = { 6000 6000 }
heavy_infantry = { 2000 2000 }
pikemen = { 4000 4000 }
archers = { 3000 3000 }
light_cavalry = { 9500 9500 }
knights = { 500 500 }
}
attrition = 0
maintenance_multiplier = 0
cannot_inherit = yes
}
}
}
}}



Imperator, on the other hand, I have no clue about the order script. I don't know where the scopes, triggers, effects, event modifiers should be placed. Ended up not getting any of it working.

I want to mod a decision where it triggers an army of specific unit spawn for me. Preferably no attrition and maintenance cost (like CK2 above). Just wanted to experiment on it. All examples of create_unit script will be greatly helpful!