manpower production mysteriously through the roof

Moderator: AlvaroSousa

Post Reply
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

manpower production mysteriously through the roof

Post 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!^^
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: manpower production mysteriously through the roof

Post 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.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: manpower production mysteriously through the roof

Post by Nachtmahr667 »

Yes, 120 per turn.
I'll upload screenshots.

Image
Attachments
Editor.jpg
Editor.jpg (110.3 KiB) Viewed 479 times
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: manpower production mysteriously through the roof

Post by Nachtmahr667 »

ingame

Image
Attachments
ingame.jpg
ingame.jpg (192.86 KiB) Viewed 479 times
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: manpower production mysteriously through the roof

Post 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.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: manpower production mysteriously through the roof

Post 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!^^
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: manpower production mysteriously through the roof

Post 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.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: manpower production mysteriously through the roof

Post 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.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Post Reply

Return to “MODS and Scenarios”