Where is the menu for setting up CPU players?


I wanted to add some more difficulty levels to my mod, and I think I have everything set up in the AI and script files, but I can’t find the menu for setting up the CPU players anywhere. Does anybody know where it is? I guess it’s in ‘newui’ somewhere, but I can’t find it.

Just to clarify: I mean the screen when your setting up a player vs. CPU game and you pick the map in the upper right, the game options in the lower right (found this already), and I’m looking for the center-left window where you set up the positions, teams, colors, and difficulty or closing the player out of the game.


1 Like

I gave a feeling @b8factor looked into this and found that the difficulty levels are hard coded. In which case the only option is to modify an existing difficulty level…

If GetGameSettingAsString is accessible from the AI scope, you could alternatively set up some Game Options.

If its not accessible, i have another somewhat hacky idea you could try.

Should be in \newui\shared\gamesetup.lua, if I’m not mistaken.

AI difficulty levels are hard-coded.
Both GetGameSettingAsString and GetGameSettingAsNumber are accessible from the AI Scope, so as @radar3301 said, you can use Game Options to add more difficulty levels.

Thanks for your answers!

I was thinking that the Complex Mod had added some extra difficulty levels, but I looked at it again and it also only has 4 levels and closed. (I still haven’t found where they changed the names either though.)

@ Dwarfinator: It looks to me like \newui\shared\gamesetup.lua is for setting up multiplayer games, but yeah it should be the same mostly. I think it’s that ‘PLAYERLISTHEADER’, but how can I find the individual parts of that?

I think 4 levels should do it actually. The mod is mostly for me and the guys I play with anyway, and we always play together against the CPU on expert, but they’re getting to be too wimpy. I kind of think everybody else who still plays this game is in the same boat, so I could probably turn easy into expert and go up from there.

This might be a knucklehead question, but I have more or less no coding skills: I found the names of the difficulty levels in ‘ui.dat’ in string numbers 2571 to 2577. I’ve been changing everything in Editor. If I change the names of the difficulties there, it has no effect on what’s displayed in the game. What am I doing wrong?

Is your changed ui.dat file in data:locale/English or just in data:locale?

neither - I was changing the .dat file in the root folder of the mod. But you’re right! I copied the .dat file into data:locale/English and now it works! YAY!

I should be okay for now I think - Thanks everyone!

Later I might add some additional features like maybe granting the AIs different levels of research at the beginning of the game, but I might be able to figure that out from looking at the Dual Command mod. He put an option for changing the CPU damage in the game options, which is cool, but I think I’d rather make the AI more butch by changing the resource multipliers and build speeds and stuff like that. I already got the AI to be more aggressive by getting rid of the logic that makes them go into permanent defense mode sometimes.

If I need more help with it I’ll write back.

Thanks again!!