Page 1 of 1

manpower production mysteriously through the roof

Posted: Sun Jul 12, 2020 1:04 pm
by Nachtmahr667
Hello dear MOD forum members,

I am trying to "create" new European minors countries in the editor (I just rename and edit the values of Asian minors countries, lol), but I have encountered a problem: Sometimes I set the manpower production value at e.g. "6", but ingame it's turned into something ludicrous, like "120". I have tried to compare what I have done differently from countries where everything works fine, but I couldn't find any differences. Does anybody have any idea what the reason for this mess-up could be?

Thanks!^^

RE: manpower production mysteriously through the roof

Posted: Sun Jul 12, 2020 4:04 pm
by AlvaroSousa
120 per turn?

You got to settings one which is how many they got four turn and one which is how many they currently have in their pool.

RE: manpower production mysteriously through the roof

Posted: Mon Jul 13, 2020 12:42 am
by Nachtmahr667
Yes, 120 per turn.
I'll upload screenshots.

Image

RE: manpower production mysteriously through the roof

Posted: Mon Jul 13, 2020 12:43 am
by Nachtmahr667
ingame

Image

RE: manpower production mysteriously through the roof

Posted: Mon Jul 13, 2020 9:29 am
by AlvaroSousa
Why does your country have no morale? It needs some locations with morale and production to calculate the manpower production.

Could be because you have none the formula gets all whacko. I gotta check.

RE: manpower production mysteriously through the roof

Posted: Mon Jul 13, 2020 9:51 am
by Nachtmahr667
ORIGINAL: Alvaro Sousa

Why does your country have no morale?

I wanted to create a sort of Vichy Poland, so the country starts out with no territory, like Vichy France.
ORIGINAL: Alvaro Sousa

I gotta check.

Thanks!^^

RE: manpower production mysteriously through the roof

Posted: Mon Jul 13, 2020 12:12 pm
by AlvaroSousa
I think you might be able to do this.

unlock the country making it active. Make it an alliance. Place the unit on the map. Now force the country to surrender. It should keep the unit on the map. But now that unit won't get reinforced.

So it will show up surrendered with their unit on the map. I think that will work. The code is dynamic in weird ways.

When I did my mod for SC2 I got real creative on using the logic of the code.

RE: manpower production mysteriously through the roof

Posted: Tue Jul 14, 2020 3:42 pm
by AlvaroSousa
These are the two lines of code that determine manpower

c = country ID
manpower = what they currently have stockpiled

Code: Select all

 Game.M.country[c].manpower += ((Game.M.country[c].manpowerProduction * Game.M.country[c].politics.moral) / Math.Max(1, Game.M.country[c].politics.maxMoral));
 

In this case it's (6 * 0) / 1 = 0 manpower.


This makes sure you don't go over the limit.

Code: Select all

 Game.M.country[c].manpower = Math.Min(Game.M.country[c].manpower, Game.M.country[c].maxManpower);
 

This might be some float bizarre division error.