How do i find the difficulty the AI is using? Like Easy, Medium or Hard.
I want to give the easy AI other build limits vs the Medium or Hard AI.
Someting like: easy AI=1 warfactory, medium AI=3 warfactories, hard AI=8 warfactories
I placed this in HOUSE.CPP:
bool DoDifficultyTest = true;
if (DoDifficultyTest && !IsHuman) {
int DifficultyTestLimit = 1; //does this work for each AI seperate?
switch (<<<<what do i need to use here?>>>>) {
case DIFF_EASY:
DifficultyTestLimit = 1;
break;
case DIFF_NORMAL:
DifficultyTestLimit = 4;
break;
case DIFF_HARD:
DifficultyTestLimit = 10;
break;
}
if (BQuantity[STRUCT_POWER] < DifficultyTestLimit ) {
b = &BuildingTypeClass::As_Reference(STRUCT_POWER);
if (Can_Build(b, ActLike)) {
choiceptr = BuildChoice.Alloc();
*choiceptr = BuildChoiceClass(URGENCY_HIGH, b->Type);
}
}
}
I tried:
Difficulty
Result: AI keeps building 4 in easy, medium & hard.
PlayerPtr->Difficulty
Result: AI keeps building 4 in easy, medium & hard.
How do i find the difficulty the AI is using? Like Easy, Medium or Hard. I want to give the easy AI other build limits vs the Medium or Hard AI. Someting like: easy AI=1 warfactory, medium AI=3 warfactories, hard AI=8 warfactories
I placed this in HOUSE.CPP:
bool DoDifficultyTest = true; if (DoDifficultyTest && !IsHuman) { int DifficultyTestLimit = 1; //does this work for each AI seperate? switch (<<<<what do i need to use here?>>>>) { case DIFF_EASY: DifficultyTestLimit = 1; break; case DIFF_NORMAL: DifficultyTestLimit = 4; break; case DIFF_HARD: DifficultyTestLimit = 10; break; } if (BQuantity[STRUCT_POWER] < DifficultyTestLimit ) { b = &BuildingTypeClass::As_Reference(STRUCT_POWER); if (Can_Build(b, ActLike)) { choiceptr = BuildChoice.Alloc(); *choiceptr = BuildChoiceClass(URGENCY_HIGH, b->Type); } } }
I tried: Difficulty Result: AI keeps building 4 in easy, medium & hard.
PlayerPtr->Difficulty Result: AI keeps building 4 in easy, medium & hard.
Anyone a tip for me?