• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
This is an eternal question and only new patch can fix it. AI will protect it's puppets only if it's puppet at war. At peace time, AI will never watch for puppet's borders
Thanks for your comprehensive explanation! At this point I will have to create an event that places garrisons along the border.
Can you tell me what the command is to keep troops locked in the province?
 
Thanks for your comprehensive explanation! At this point I will have to create an event that places garrisons along the border.
Can you tell me what the command is to keep troops locked in the province?

My own example - In last version of PWV, German Player/ AI was forced to create RKs. All RKs have events that give them free garrisons. Why? Without garrisons, GG Polen will annexed by Soviets in first days of Babarossa ( Since German AI cannot send divisions before a potential invasion )

Solution - You will have to create events for the puppet which will give free garrisons before the arrival of the main forces from the master state. Like i'm said in my previous post, master state will watch for puppet's borders only if puppet at war
 
My own example - In last version of PWV, German Player/ AI was forced to create RKs. All RKs have events that give them free garrisons. Why? Without garrisons, GG Polen will annexed by Soviets in first days of Babarossa ( Since German AI cannot send divisions before a potential invasion )

Solution - You will have to create events for the puppet which will give free garrisons before the arrival of the main forces from the master state. Like i'm said in my previous post, master state will watch for puppet's borders only if puppet at war

# The Warsaw Military District

event = {
country = RUS
id = 548710
random = no
style = 0
picture = "WMD"

name = "The Warsaw Military
District"

desc = "The Warsaw Military District was a Russian military district of the Imperial Russian Army. It covered the territory of Congress Poland. The Warsaw Military District was created in 1862."

date = { day = 11 month = january year = 1897 }

action_a = {
name = "Deploy the troops!"
command = { type = add_corps which = "6-y Armeyskiy Korpus" value = land when = 836001 where = 254 } #Lomza
command = { type = add_division which = "4-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "16-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "4-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "14-y Armeyskiy Korpus" value = land when = 836002 where = 243 } #Lublin
command = { type = add_division which = "8-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "13-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "14-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "15-y Armeyskiy Korpus" value = land when = 836003 where = 232 } #Warsaw
command = { type = add_division which = "6-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "8-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "6-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "15-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "19-y Armeyskiy Korpus" value = land when = 836004 where = 246 } #Chelm
command = { type = add_division which = "17-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "38-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "7-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "1-ya Donskaya Kazach'ya Diviziya" value = cavalry }
command = { type = add_corps which = "23-y Armeyskiy Korpus" value = land when = 836005 where = 223 } #Lodz
command = { type = add_division which = "3-ya Gvardeyskaya Pekhotnaya Diviziya" value = mechanized }
command = { type = add_division which = "2-ya Pekhotnaya Diviziya" value = infantry }
}
}

I created this event and it works perfectly. What command do I have to add to block the divisions in the provinces?

This?
type = lock_division which = [id type] value = [id id]
Lock this division (it may no longer move.)
 
# The Warsaw Military District

event = {
country = RUS
id = 548710
random = no
style = 0
picture = "WMD"

name = "The Warsaw Military
District"

desc = "The Warsaw Military District was a Russian military district of the Imperial Russian Army. It covered the territory of Congress Poland. The Warsaw Military District was created in 1862."

date = { day = 11 month = january year = 1897 }

action_a = {
name = "Deploy the troops!"
command = { type = add_corps which = "6-y Armeyskiy Korpus" value = land when = 836001 where = 254 } #Lomza
command = { type = add_division which = "4-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "16-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "4-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "14-y Armeyskiy Korpus" value = land when = 836002 where = 243 } #Lublin
command = { type = add_division which = "8-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "13-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "14-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "15-y Armeyskiy Korpus" value = land when = 836003 where = 232 } #Warsaw
command = { type = add_division which = "6-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "8-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "6-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "15-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_corps which = "19-y Armeyskiy Korpus" value = land when = 836004 where = 246 } #Chelm
command = { type = add_division which = "17-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "38-ya Pekhotnaya Diviziya" value = infantry }
command = { type = add_division which = "7-ya Kavaleriiskaya Diviziya" value = cavalry }
command = { type = add_division which = "1-ya Donskaya Kazach'ya Diviziya" value = cavalry }
command = { type = add_corps which = "23-y Armeyskiy Korpus" value = land when = 836005 where = 223 } #Lodz
command = { type = add_division which = "3-ya Gvardeyskaya Pekhotnaya Diviziya" value = mechanized }
command = { type = add_division which = "2-ya Pekhotnaya Diviziya" value = infantry }
}
}

I created this event and it works perfectly. What command do I have to add to block the divisions in the provinces?

This?
type = lock_division which = [id type] value = [id id]
Lock this division (it may no longer move.)

This command for divisions that are present from the very beginning of scenario, you can not block divisions that were added by event. If I'm remember correctly
Just add this event for Poland (Russia's puppet) not for Russia. Polish AI will watch for it's borders, thats what you need
 
This command for divisions that are present from the very beginning of scenario, you can not block divisions that were added by event. If I'm remember correctly
Just add this event for Poland (Russia's puppet) not for Russia. Polish AI will watch for it's borders, thats what you need
Yhank you, very good.

32452352353.jpg
254323535.png
 
IIRC there's also the possibility to activate dormant units already present in the country's file. These units can be locked, with correct model, and complete with attachments.
Thanks a lot for the tip. Do you have an example?
I noticed the "dormant" divisions in the .inc file if I'm not mistaken.
 
Here's an example of a dormant unit, to be added in the country's .inc file :

Code:
landdivision =
{ dormant = yes
  id         = { type = 18150 id = 1001 }
  name         = "I/4ème Division"
  type         = d_07
  model         = 0
  extra1      = artillery
  brigade_model1 = 3
  extra2      = sp_anti_air
  brigade_model2 = 0
  extra3      = b_01
  brigade_model3 = 0
  strength     = 40
  max_strength     = 100
  locked     = yes
}

And an event activating dormant divisions :

Code:
event = { # The new army divisions
    id = 8070205
    random = no
    country = BEL

    name = "8070205name"
    desc = "8070205desc"
    style = 2
    picture = "Wehrmacht"

    action = {
        name = "ACTION_NAME_OK"
        ai_chance = 100
        command = { type = add_corps which = "4ème Division d'armée" when = 70061 where = 113 }
        command = { type = activate_division which = 18150 value = 1001 where = 113 when = 0 }
        command = { type = activate_division which = 18150 value = 1002 where = 113 when = 0 }
        command = { type = add_corps which = "5ème Division d'armée" when = 70062 where = 112 }
        command = { type = activate_division which = 18150 value = 1003 where = 112 when = 0 }
        command = { type = activate_division which = 18150 value = 1004 where = 112 when = 0 }
        command = { type = money value = -350 }
          command = { type = local_setflag which = BEL_new_divisions }
        command = { trigger = { ai = yes } type = ai which = "switch/production/BEL_prodswitch_13.ai" }
    }

}
 
Can anyone figure out why France is refusing to attack Italy?

(For comparison, it is willing to launch troops into other countries such as Spain)

I am attaching the AI files that I think France is using.

upload_2020-4-18_14-14-30.png
 

Attachments

  • fra_1936.txt
    18,5 KB · Views: 2
  • FRA_ITA_atwar.txt
    1,5 KB · Views: 2
AI will give the most outlandish, sorta pun there, peace offers of provinces I never had any intention of stepping into, but not once has the AI agreed to a demand I make that would be cost them far less than it offers me during the same playthrough and war.

Likewise with puppetting, AI could be completely occupied but I'm forced to annex and then liberate.

Are there files unique to each nation for surrender conditions or do they all fall into another set of files?
 
  • 1
Reactions:
Can anyone figure out why France is refusing to attack Italy?

(For comparison, it is willing to launch troops into other countries such as Spain)

I am attaching the AI files that I think France is using.
I haven't looked at AI files in a while so I can't help, but you might want to be sure which files are loaded. There's an AI file logger that can be enabled (IIRC in misc.txt) that allows you to know which files are loaded by which country and when, during a game.

AI will give the most outlandish, sorta pun there, peace offers of provinces I never had any intention of stepping into, but not once has the AI agreed to a demand I make that would be cost them far less than it offers me during the same playthrough and war.

Likewise with puppetting, AI could be completely occupied but I'm forced to annex and then liberate.

Are there files unique to each nation for surrender conditions or do they all fall into another set of files?
I don't remember how the peace offer works, except for the fact that there's a setting somewhere (misc.txt?) that forces the countries belonging to one of the three factions to accept any peace deal. I hope this is the cause of some of the issues you described.
 
You can also look at the save game files. Those store whatever ai behavior is being used at the time of save.
 
I don't remember how the peace offer works, except for the fact that there's a setting somewhere (misc.txt?) that forces the countries belonging to one of the three factions to accept any peace deal. I hope this is the cause of some of the issues you described.
Any at all? Hm, not quite. I was hoping there may be a way to implement devastation, as in the Battle of Britain goes to Nazis overwhelmingly, causing IC shortfall at a significant amount for most of the year that the UK might be forced to accept a peace deal, or perhaps kicked out of war by event?
 
At best you can write an event for a peace deal using the IC as trigger. I'm afraid I can't think of anything else.

EDIT: wait, I remember another AI setting involved in peace deal, IIRC it was "ferocity" which forced a country to not accept (but perhaps still offer) peace deals.
 
I have a question about AI. Is it possible for a country to station troops in allied country towards the third country which they are not in war? During the war they move the forces in, but, can they do it in peace?
 
I have a question about AI. Is it possible for a country to station troops in allied country towards the third country which they are not in war?

Welcome to HOI 2.
Not. It is not a possible. Country (Master) will send troops to support its allies only if they're at war
 
Welcome to HOI 2.
Not. It is not a possible. Country (Master) will send troops to support its allies only if they're at war
Bad, is there some ways to improvise? I need such troop positioning as part of preparation for offensive war.
 
Bad, is there some ways to improvise?

Pray for patch. I'm really need this command (peace time preparations) for my mods.
Really? I'm have no idea. If you would deploy garrisons via cheat event for AI, AI will re-deploy garrisons in wrong province. So there is no stable solution for this question