OK, we'll keep it simple, and you can elaborate it later if you wish.
I don't know how much cheat the AI gets, so for this example I'll guess it at +50% for the hard AI and +100% for the expert AI, and multiply their rates by 0.67 and 0.5 respectively, to set them back to normal. I think you can get the actual number by playing a comp stomp, then looking at the AI's resource incomes vs. yours at the very beginning of the game.
We will modify the .scar file by adding some code near the bottom. The last few lines should look like this, except for the three asterisks I am adding to show where we're going to put the new code:
local function WinCondition_Init()
Rule_AddInterval(WinCondition_Check, 3)
***
end
Scar_AddInit(WinCondition_Init)
Don't add the asterisks. If you want to know what all the functions do, search the web for
coh2 updated scar documentation.
Here is the code we will add. Anything after two dashes is a comment. I'm reducing the indentation to three per level of depth instead of their 8-character tab, to minimize the amount of wrapping you see when you read this:
-- My Stuff: ------------------------------------------------------------------
for p = 1, World_GetPlayerCount() do -- iterate over all the players
local player = World_GetPlayerAt(p) -- get more information about this player
if (AI_IsAIPlayer(player)) then
if (AI_GetDifficulty(player)==AD_Hard) then
Modify_PlayerResourceRate(player,RT_Manpower,0.67,MUT_Multiplication)
Modify_PlayerResourceRate(player,RT_Munition,0.67,MUT_Multiplication)
Modify_PlayerResourceRate(player,RT_Fuel,0.67,MUT_Multiplication)
end
if (AI_GetDifficulty(player)==AD_Hardest) then
Modify_PlayerResourceRate(player,RT_Manpower,0.5,MUT_Multiplication)
Modify_PlayerResourceRate(player,RT_Munition,0.5,MUT_Multiplication)
Modify_PlayerResourceRate(player,RT_Fuel,0.5,MUT_Multiplication)
end
end -- loop over all the players
-- End of My Stuff. ----------------------------------------------------------
All that should be where the three asterisks are in the first example. The different indentation doesn't matter, so you can just paste it in.
I haven't ever used AD_Hardest, but that's what the documentation says. Sometimes it's out of date, so if it gives an error my first guess would be AD_Expert for CoH2.
Save the file and rebuild your mod. (Notice that 'build' only works the first time; now you have to 'rebuild', or else 'clean' it first.) You shouldn't get any errors, because the code is not processed at this step, but make a habit of checking for errors anyway.
Now run the game using your mod. If there is an error in the code the game will pause at the very start, and it will say something like "fatal scar execution error - game paused" in the middle of the screen. If it does that, open the console and scroll up to find where it tells what line number in the code it didn't like. Then you'll have to find that line number in your code, counting blank lines as well as code and comments. We'll talk more about that if it happens.
Play the game and see if it feels right. I tried the x0.67 for the hard AI last night, and it really cut back on the AI's bombardments. Or if you don't want to go by feel, play a complete game and look at the AI income rates in the replay as compared to your own.
Let us know how it works.