• 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.
It can be hard to set up a mod to work with moddir. I just started trying it a couple of weeks ago. It just seems like a better idea than having to overwrite the vanilla version or having two installations.

I believe the problem is making sure your subdirectories mirror the ones in the original game folder. One problem I've had with it is that if the game doesn't find a file in the mod directory it will load up the default. It can be hard to tell which is running in some cases.
 
It is awesome in scope, limited in reality I'm afraid. But thanks for trying it out. I don't know how long I've worked on it. It is programming practice for me, but I wish I had done it in C# instead of Java. It would make the GUI easier and be simpler to distribute.
 
I've put up a new 50 country scenario at the site and added some screenshots. One is a history from my handsoff run of the 161 country scenario for the first 16 months or so. The other is a look at a 20 country map.

I think I'm off for some CK for a while. Got an unwelcome appointment with the Mongols I'm afraid. :rofl:
 
I tried the new one and it runs much better than the first scenario you made. I think 160 countries is too much so maybe try and find a good number between that.

Anyway as for the problem of getting countries to declare war, how about you raise the belligerence of every nation so eventually they all start declaring war on eachother. Im not sure it'll work, but it's worth a shot.
 
Lt Hilsdorf said:
Anyway as for the problem of getting countries to declare war, how about you raise the belligerence of every nation so eventually they all start declaring war on eachother. Im not sure it'll work, but it's worth a shot.

There should be no need for you to raise the belligerence, the risk mod's AI start the wars on the second day after the scenario begins, does the AI have any army? i find it pretty stupid of them to declare war without one. :rolleyes:
 
fudd_bopo said:
There should be no need for you to raise the belligerence, the risk mod's AI start the wars on the second day after the scenario begins, does the AI have any army? i find it pretty stupid of them to declare war without one. :rolleyes:
well they never do declare war at all. I played untill 1938 and some nations had pretty large armies, but no one declared war on anyone. I think the only political thing that happened was that Germany and japan formed an allience.
 
I tried the mod out and in april first year there were a couple of wars.
Think it would do good with some extra ic and resources. Also are there any meaning to have those 3 mayor alliances there? :confused:
 
The ai for the risk mod is set up to encourage lots of action. I plan on using it in the future, at least as an option. I haven't yet since there are places in it where all the countries are listed, like in the "war = { }" part of the ai file. I haven't tested with it yet to see what will happen if countries that don't exist are in the file, or if a country can have itself listed there and still function. That is important because if not each country will have to have an ai file written with specific information for itself.

I haven't been able to get the ai to run from the moddir folder either, it is using the default.ai from the normal folder. In the games I was playing I had changed the war = value in that file from 50 to 100. In the future I will include a renamed version of that file for people to put in their ai folder and have the ai run from it for now.

I also changed the misc.txt file so that countries get 100% of the ic from conquered provinces. I will include that version in the moddir folder in the future. When I put one up with the changes I will post a note here.


Thanks for experimenting with this.
 
AlenlorDRot said:
The ai for the risk mod is set up to encourage lots of action. I plan on using it in the future, at least as an option. I haven't yet since there are places in it where all the countries are listed, like in the "war = { }" part of the ai file. I haven't tested with it yet to see what will happen if countries that don't exist are in the file, or if a country can have itself listed there and still function. That is important because if not each country will have to have an ai file written with specific information for itself.

I haven't been able to get the ai to run from the moddir folder either, it is using the default.ai from the normal folder. In the games I was playing I had changed the war = value in that file from 50 to 100. In the future I will include a renamed version of that file for people to put in their ai folder and have the ai run from it for now.

I can confirm that it does not cause any issues to have extra countries in the .ai files, even coutnries that arent in the game. I was using the risk mod AI in my mod where I only have eight countries in the game, and it did nothing strange that I could tell.

However I am using it in a moddir format, and your comment regarding not getting the .ai to work from a moddir does give me pause. How did you know it wasn't using your .ai? I've got a default.ai file and a XXX_36.ai file (one for each country) in my AI directory and they are all identical in contents. So one of those files should get used if it's getting them from my moddir AI directory. However I don't know of any definate way to check... do you?


Colt.
 
I had been writing the ai files to "ai\RandRoadAI\xxx.ai" in the moddir directory. Before that I had been testing the same subdirectory in my normal game folder. I forgot about having it there and thought it was working properly, but people without the files in the normal game folder were getting load errors. I confirmed that by removing the files from my normal game folder and testing it. I'm not sure why ai files would be any different than others as far as moddir is concerned.

I think I will just include that subdirectory in the future and copy it to the regular ai directory. It doesn't overwrite anything and allows each country to have an individual ai.

To test you could just move default.ai out of the normal ai folder temporarily and try to start the game. If it has been getting it from there instead of the moddir there should be an error message saying the file can't be found. Otherwise, it must be getting it in the moddir.
 
AlenlorDRot said:
To test you could just move default.ai out of the normal ai folder temporarily and try to start the game. If it has been getting it from there instead of the moddir there should be an error message saying the file can't be found. Otherwise, it must be getting it in the moddir.

Nice idea... I'll try that out and see. Thanks.

Colt.

EDIT : Well, tried it out, and yep, you are right... AI files are not being read in from a moddir directory. There's supposed to be a way to specify in the .inc files what .ai file is to be used for that country... I'll have to look into that and see if I can specify the moddir path that way, (hey, a similar method worked for some events I was trying to put in, so you never know)

EDIT2 : Ok, confirmed you CANNOT get ai files in a moddir directory to be used, even if you specify the ai file path in the .inc files, (by using the 'ai = "xxxx\ai\xxxx.ai"' command). I gave a full path in my .inc files and I get the error "can't open ai\19xx\ai\default.ai" (where 19xx is the name of my moddir), so it's obviously looking for the files inside the ai directory rather than the 19xx directory like it should.
AlanlorDRot, thanks for the heads up! I've been making changes to my ai files in my moddir ai directory thinking it should make a difference, but now I know better. You've said me lots of pain. TA!

Colt.
 
Last edited:
one suggestion, maybe Intervenionism-Isolationism bar should be the only one bar not randomized. Every c. should have max. intervenionism so there will be more wars alliances etc
 
Kroko said:
one suggestion, maybe Intervenionism-Isolationism bar should be the only one bar not randomized. Every c. should have max. intervenionism so there will be more wars alliances etc
Yes, great idea.
 
I was having plenty of wars with the ai I was creating. This is the history from the last 6 months of the game I'm playing now.

1937-00-03 : 8:00 January 4, 1937 : Cuba accepted peace with Iraq on the following terms : Return to Status Quo.
1937-00-10 : 8:00 January 11, 1937 : Kazakhstan declared war upon Italian Social Republic.
1937-00-12 : 8:00 January 13, 1937 : Azerbaijan declared war upon Sierra Leone.
1937-00-14 : 8:00 January 15, 1937 : Portugal annexed Italian Social Republic.
1937-00-16 : 8:00 January 17, 1937 : Afghanistan declared war upon Malaysia.
1937-00-20 : 8:00 January 21, 1937 : France declared war upon Brazil.
1937-00-21 : 8:00 January 22, 1937 : Union of Mali annexed Malaysia.
1937-00-29 : 8:00 January 30, 1937 : Korea annexed Sierra Leone.
1937-01-00 : 8:00 February 1, 1937 : Portugal declared war upon Guinea.
1937-01-04 : 8:00 February 5, 1937 : Guinea cancelled a trade agreement they had with us.
1937-01-05 : 0:00 February 6, 1937 : Arab Federation concluded a diplomatic deal with us.
1937-01-17 : 8:00 February 18, 1937 : Union of Mali declared war upon Tajikistan.
1937-01-21 : 8:00 February 22, 1937 : Azerbaijan declared war upon Slovakia.
1937-01-26 : 8:00 February 27, 1937 : People's Republic of Korea declared war upon Tajikistan.
1937-02-07 : 8:00 March 8, 1937 : Venezuela declared war upon Libya.
1937-03-17 : 8:00 April 18, 1937 : Vietnam declared war upon Cuba.
1937-04-04 : 8:00 May 5, 1937 : Nationalist Spain declared war upon Cuba.
1937-04-07 : 8:00 May 8, 1937 : Albania accepted peace with Costa Rica on the following terms : Kotlas to Albania & Velikij Ustyug to Albania.
1937-04-08 : 8:00 May 9, 1937 : Poland declared war upon Venezuela.
1937-04-13 : 8:00 May 14, 1937 : Turkey declared war upon Romania.
1937-05-01 : 8:00 June 2, 1937 : Equatorial Africa declared war upon Guatemala.
1937-05-03 : 8:00 June 4, 1937 : Costa Rica declared war upon Cuba.
1937-05-06 : 8:00 June 7, 1937 : Manchukuo annexed Gold Coast.
1937-05-13 : 8:00 June 14, 1937 : Iceland declared war upon Romania.
1937-05-26 : 8:00 June 27, 1937 : Brazil annexed France.

The problem was that the ai files weren't being read from the moddir so that the countries were using the default which isn't very aggressive. They will have to be pasted into the ai directory of the main game folder to work. I will put them in their own subdirectory so that no other files are overwritten. The names are different anyway I believe.

The intervention slider idea is good though. I will try to include it as an option whenever I get around to making an interface for this thing.
 
I made a couple of updates at the website.

I added a new 100 country game. I made all the country tags selectable. Hopefully it won't let you select countries not included in the scenario, but I wouldn't bet on it.

The ai files are included in a RandRoadAI folder. This won't run from moddir and will have to be put in the games regular ai folder so that it is hoi2/ai/RandRoadAI. This should help with the lack of wars.

I added the source code I've used to make scenarios. It is in java so if you are familiar with that you can take it, modify it, compile it, and make your own scenarios. Or you can just amuse yourself looking at the mess I've made.

On a side note: I accidentally added the partisans as a country to the scenario I'm playing at home. I started as a democracy and couldn't declare war on anyone, but the partisans were listed in the statistics as an enemy. I think this could be exploited to generate a real Fantasia type scenario where the partisans own the world except for one province for each country.
 
how are the countries starting provinces randomized ?
for example, 1,2,3,4,5 -> Holland, 6,7,8,9 -> Afganistan 10-20 -> CSa ... etc ?

The program reads in a list of province id numbers I try to organize so that each preceding province is adjacent to the following province. It is almost in numerical order and far from perfect which causes some countries to be divided on the map.

I divide the number of provinces by the number of countries to decide how many each country will get. Then I shuffle the country tags to be used in the scenario so that the same two countries aren't always adjacent to each other. Then I choose a random spot in the province list and give each country x number of provinces.

This reminds me that I need to put the province list online as well.
 
I added all the countries to the playable list for the scenario. This causes problems in scenarios without all of the countries. If you select a country that isn't included in the scenario the game will crash, at least mine does. The Germans, Soviet, and British are always safe. After that the original countries from the Road to War scenario are the best bet.

Sorry for the bug, but the scenario file isn't being written on the fly yet, it is static.

EDIT: That has now been fixed. The scenario file is being written when the game is created so that only countries in the scenario are selectable. The latest scenario has this added to it.
 
Last edited: