Hey modders,
I am currently designing a Mod for Age of Empires IV (“The Great Defense”, 4vs1 AI), and its already running pretty good. However, I have one big problem: I would like to make the difficulty adjustable, directly connected to the difficulty setting of the AI player (player5).
For this, I used difficulty = AI_GetDifficulty(player5), which sets (as I found out by experimenting) the variable “difficulty” to a number from 0 to 6.
I can use this number (in Solo Player!) for different things: calculating intervals (like "interval = difficulty * 5), using it as boolean in “if-functions” like “if difficult == 0” etc.
The weird thing is: The same functions do NOT work in Multiplayer. I can however run the line “difficulty = AI_GetDifficulty(player5)” in Multiplayer, but i can not use this number in any way ( like in the examples above). In multiplayer, it will then stop the game immediately and tell me “error in displaying game results” or something like this.
I hope the explanation was clear, and that you can maybe help me. These are the lines I am talking about:
Soloplayer: all three lines work fine
Multiplayer: first two lines are “ok”, adding the 3rd line crashes the game
Thanks if anyone can help me