As I think, using "general" instead of "named_character"
As I think, using "general" instead of "named_character"
"general" is for a captain, thus you get only the unit, not a general. A general would spawn, if there was written "named character" instead
Allright thanks ! What about the names then ? Is it the same rules as for named characters with textfiles relations ?
On what factors is it possible to spawn an army? Like could I script it that a rebel army appears when 'heretic' religion gets too high?
All kinds of things; too many to mention.
Yes, if you mean how much heretic a particular settlement has, e.g. London.Like could I script it that a rebel army appears when 'heretic' religion gets too high?
terminate_monitor ensures that it only happens once.Code:monitor_event CharacterTurnEnd IsRegionOneOf London_Province and PopulationHeretic >= 30 and not FactionType slave ;spawn somewhere in London region terminate_monitor end_monitor
Well I tried to do it but for some reason it isn't working. Here's what I did:
Code:monitor_event CharacterTurnEnd IsRegionOneOf Carpenter_Wall and PopulationHeretic >= 10 and not FactionType normans spawn_army faction normans character Rei, general, age 26, x 46, y 151 unit Cultist Fanatics exp 6 armour 0 weapon_lvl 0 end terminate_monitor end_monitor
The province started with 20 heretic. I ended turn a few times and nothing occured. Am I missing something?
Should I declare counters first at the top of the script?
I'm sorry, I'm still confused about how to do this.
I put the "declare counter" for one province to try it out. How exactly do I activate it by monitoring? Is there a past example of how it is done? So I could simply copy the template.
Is there a tutorial for the campaign script somewhere? I'd rather try to read that instead of keep necro-ing this thread.
Did you have a look at the docudemon ? It is the bible of coding !
And once the topic has been necro-ed, it is not old anymore
IsRegionOneOf requires the regions ID number, not the name. You can get the ID by using the show_cursorstat console command. Also disable the religion line to test the functionality otherwise. Unless you terminate the monitor after the first use, or use random name for the character, you will ask for errors.
Well the region code didnt seem to work for me, but this formula did:
So now an army is at least created.Code:monitor_event SettlementTurnStart SettlementName CB4_Kaiu_Shiro spawn_army faction normans character Amir of Cairo, general, age 26, x 46, y 151, unit Cultist Fanatics exp 6 armour 0 weapon_lvl 0 end terminate_monitor end_monitor
But when I add "and PopulationHeretic >= 10" the script no longer works.
The settlement event does not export the required info for that condition, only a character event does. The docu demons help you to determine what event you need for which condition.
I just used this monitor in the default campaign after setting Nottingham to 20% heretic and it worked without a hitch. I used 'moors' as the normans are not present.
Initially I couldn't get it to work as I copied the code from your example - and copying TAB here doesn't get preserved, it gets replaced with SPACE, see the blue entries. Once I realized that and restored the TAB entries everything worked fine.Code:monitor_event CharacterTurnEnd IsRegionOneOf Nottingham_Province and PopulationHeretic >= 10 and not FactionType moors spawn_army faction france character random_name, named character, age 37, x 102, y 154 unit[TAB]Scots Guard[TAB]exp 2 armour 0 weapon_lvl 0 end terminate_monitor end_monitor
Nothing.
With the "CharacterTurnEnd IsRegionOneOf", nothing happens at all.
This is it now
I made sure there were tabs in the needed spaces. Are there supposed to be more? Such as between "CharacterTurnEnd" and "IsRegionOneOf"?Code:monitor_event CharacterTurnEnd IsRegionOneOf Carpenter_Wall spawn_army faction normans character random_name, general, age 26, x 46, y 151 unit Cultist Fanatics exp 6 armour 0 weapon_lvl 0 end terminate_monitor end_monitor
Am I missing anything? Like other text or another file to edit along with this? The Docudemon only shows the most basic template. Im having trouble understanding how to read it. My problem, I know.
The entire script works now, except for that entry. Previously adding the entry would stop the whole script.
Is the faction (normans) listed in the descr_strat file? Are you using the correct definition? It has to be the region's name, not the settlement's, check the spelling in descr_regions (weirder stuff has happened then a misspell) . And it will happen after you press turn end. And you obviously need a character in that region.
Ah... what kind of character is needed? In the settlement? Or in the region?