• 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.
Question : how the commad ai_prepare_war works ? (if works ... not seems at all).

action = {
name = "ACTION_NAME_HURRAH"
command = { type = relation which = IND value = -10 }
command = { type = ai_prepare_war which = IND }
command = { type = add_corps which = "ResoluteDefence" value = land when = -1 where = 1247 }
command = { type = add_division value = armor when = 0 }
command = { type = add_division value = armor when = 0 }
}

The command tell the AI to move troops to the border with that country.
 
How do you make ai to leave exactly one div in certain province along the border of a neutral nation?

You'd be better doing an event to put one div there.
Actually you'd be better having it as a dormant (locked) division in the INC file, call it by event. Locked it will stay there. AI moves stuff around too much.
 
How do you discourage Ai from sending troops to certain Allied fronts , for example I dont want that Germany sends troops to help U09 in Serbian front , but only in Russian front

Hmm, allies are tricky. I know in the invasion part of the AI you can choose to help allies or not. I would suggest you look at the USA ai for the d-day landings, and possibly it might help you.
 
How do you make Ai stop using strategic redeployment?

Add this line to your AI file:
Code:
strat_redeploy_threshold = [days]

If the time for a unit to move is longer than [days] AI will use strategic redeployment instead. Setting it to a really high number will make the AI stop using strategic redeployment in all but the most extreme cases.
 
I have a question, where gets the game the information which .ai files to load in a scenario? Is this stored in the event files? For example when a switch occures. I noticed that some countries have mentioned which file to load in the setup .inc file, though not all, but for most of them an .ai file exists...but if I delete the line in the .inc file, the game still loads the .ai file for the country at start (notice in savedebug), so this is all strange to me...
 
I have a question, where gets the game the information which .ai files to load in a scenario? Is this stored in the event files? For example when a switch occures. I noticed that some countries have mentioned which file to load in the setup .inc file, though not all, but for most of them an .ai file exists...but if I delete the line in the .inc file, the game still loads the .ai file for the country at start (notice in savedebug), so this is all strange to me...

The AI files are found in the ai folder. It also has a switch folder inside the ai folder.
The AI files control the armies of the countries in the game.
If there is a particular AI file made for a particular country, it will be made so that the AI will do certain things specifically for that country. It could be attacking specific provinces, or sending invasions from a specific port etc.

If there is no specific AI file for a country, then the default.ai and minor_default.ai AI files kick in and give a generic control to all countries.

The AI is reloaded every year for every country, at the turn of the year.
If you want to start a war, you make up a specific war AI file for that country and put it into the temporary SWITCH folder. You then call that specific AI file from an event.
 
How would I go about changing AI_SOV_Spheres to AI_RUS_Spheres I'm making a Back in the USSA mod where America has a communist revolution whereas Russia did not and America became a communist superpower and the Russian Empire became Constitutional Monarchy and stayed in close ties with the UK
 
How would I go about changing AI_SOV_Spheres to AI_RUS_Spheres I'm making a Back in the USSA mod where America has a communist revolution whereas Russia did not and America became a communist superpower and the Russian Empire became Constitutional Monarchy and stayed in close ties with the UK

First you need to understand a couple of things:

Look in the config/world_names.csv to see the TAGS used in the game.
Now look in the scenario folder for the scenario you wish to use (1914 ?) and open up ths RUS.inc file for Russia, or (1936 ?) for Sov.inc file.

So, SOV and RUS refer to the same country but at different times.

You don't NEED to change the TAG. You could continue to use AI_SOV_Spheres as long as in your INC file, Russia is SOV. Else if your INC file for Russia is RUS, then use the RUS ai file. But don't mix them up.

Remember to keep the original files, as they may be called by the game, so just make a copy, rename it, and change it to suit your needs.
 
First you need to understand a couple of things:

Look in the config/world_names.csv to see the TAGS used in the game.
Now look in the scenario folder for the scenario you wish to use (1914 ?) and open up ths RUS.inc file for Russia, or (1936 ?) for Sov.inc file.

So, SOV and RUS refer to the same country but at different times.

You don't NEED to change the TAG. You could continue to use AI_SOV_Spheres as long as in your INC file, Russia is SOV. Else if your INC file for Russia is RUS, then use the RUS ai file. But don't mix them up.

Remember to keep the original files, as they may be called by the game, so just make a copy, rename it, and change it to suit your needs.
Thanks its 1939 Russian Empire it stays in power due to America having the revolution instead of Russia
 
Does anyone know if the AI makes ships (or infantry divisions, for that matter) with more than one brigade/improvement attached?

I've been meaning to test this but just haven't had the time.
 
Im having problems to make work belgium invation in ww1 goes right in e3 map.

I could emulate the run to sea by dividing french units over ita and ger (u08) borther. This give and advise to invade belgium. They coup a part but garrisoning use so few units becose no mather how much i set combat and front ratio i asign priorizing bel and fra over rus. They spend to much units in the east. More over, dont work reactive to reagrupate units. Garrisoning is right assigned but theres no enought units in the area to lock the zone.

In deed belgium in e3 map is very permeable for attacks from france and have many rivers to cross from germany.

I get allways ger overruned and pulled out.

if the ai employ the intelligece info (units number) no allocate units, theres no other way to balance the units number, but until that i preffer see if theres a way moofing only ai. i think theres enought units for 2/3 fronts actualy at escenario at 1914.

Any idea? Other idea i had but i dont know how effective could be is set belgium as core by event to force a better priority in garrisoning (i dont know if it works of its the same working garrison a non-national or a core province)?
 
Im having problems to make work belgium invation in ww1 goes right in e3 map.

I could emulate the run to sea by dividing french units over ita and ger (u08) borther. This give and advise to invade belgium. They coup a part but garrisoning use so few units becose no mather how much i set combat and front ratio i asign priorizing bel and fra over rus. They spend to much units in the east. More over, dont work reactive to reagrupate units. Garrisoning is right assigned but theres no enought units in the area to lock the zone.

In deed belgium in e3 map is very permeable for attacks from france and have many rivers to cross from germany.

I get allways ger overruned and pulled out.

if the ai employ the intelligece info (units number) no allocate units, theres no other way to balance the units number, but until that i preffer see if theres a way moofing only ai. i think theres enought units for 2/3 fronts actualy at escenario at 1914.

Any idea? Other idea i had but i dont know how effective could be is set belgium as core by event to force a better priority in garrisoning (i dont know if it works of its the same working garrison a non-national or a core province)?

I would consider myself to be pretty good at DH AI and getting the AI to do exactly what I want it to do.

In the Putin mod, which uses the E3 map, I have spent many hours trying to get the AI to work properly.

My conclusion: The Dh AI does not work in the E3 map. Honestly! You are better off setting the AI to default for all. Then the most important thing after that is to not depend on the AI to do things, you need to do everything by event.

For example: One country invades another. You would usually set lost_national = 75% and let the AI invade, take 75% and your event fires for you. This is normal. BUT in the E3 map, the units just sit there looking at eachother. So I have had to set the lost_national = 10% to at get the event to fire.

I have no idea why the AI does not work in the E3 map, it could be too many provinces???? No idea.

Maybe MartinBG knows?
 
i preffer dont use lost_national for general reasones.

I see rivers get craizy the ai when its moving the front and get a zone in between rivers or in a river curve. If germany dont take lowney (or something like that) german couldnt go into belgium. Similar in russiaborder, but the front moves slowly becose theres no so much province nexus.

In general it manage good the front and multifront, and the revolt garrisoning. But rivers get mad all the stuff.