New Great People not being correctly utilized by the AI

DartsZeUberaffe

Chieftain
Joined
Jun 1, 2016
Messages
8
So I'm in a bit of a dilemma regarding a civ and their unique ability.

A civ of mine has the ability to gain a multitude of different great people by researching certain techs.

However - this is where the problem kicks in - they do not replace the existing great people, and even if I wanted them to that wouldn't be viable as there are multiple same "types" of these new great people (IE there would be 4 Great General equivalents).

Well why not make them into an entirely new great person? Well, I did. But it turns out, making new great people allows others civs to select them via free great people like the Liberty finisher or the tower of Pisa, making their whole uniqueness somewhat redundant and completely unbalances free great people as you would never want to choose the base game great people except via honor system.

Make them not great people? That's where I'm currently at. But there's an entirely new problem with that. Before, the AI could handle the unique great people just fine when they were Great People by definition of the game. But now, the AI has no idea what to do with them despite still supposedly having the same great person AI assigned to them, so this civ AI just hoards these unique great people and essentially makes their culture game a joke.

So here's my question at least: Is there any way for me to circumvent these two problems? For example, would it be possible to make it so you CAN'T select these units when you gain free Great People? Or make it possible so that the AI would utilize them without making them great people again?

Mod in question attached just in case.
 

Attachments

  • Emera's Dragonland (v 4).civ5mod
    12.4 MB · Views: 15
Whenever I add a unique unit that has no replacement (this applies to buildings too), I make a dummy unit that cannot be trained by any means and make that the default unit for its unitclass, along with the actual unit. That way only my own modded civ can train my unit. Now, I've never made a great person unit, but I wonder if it's possible using this method to define a dummy unit that has no 'special' attribute while the unit actually meant for your civ does have it. Might be worth giving that a shot.
So here's my question at least
I can't speak for either of your questions, I want to say yeah, it's possible to prevent a certain Great Person from being selectable when you receive a free one but it's honestly been so long since I've really modded Civ V so I don't want to give a definitive answer; and I'm just not the right person for the second question.
 
I'm just going to throw an idea out for you, is it possible to use the Lua PlayerCanCreate hook and add custom code to handle your Great Person? Not sure if DLL code would circumvent this, but worth a shot?

It's been a long time since I've looked into the DLL or even used this hook, but it might be something to look into!

Here's some psuedo code that might point you in the right direction, I think `TurnsRemaining.lua` in `Expansion2/Scenarios/CivilWarScenario` provides examples of other, similar hooks, that might help. I'd like to stress this is untested:

Code:
GameEvents.PlayerCanCreate.Add(function(iPlayer, iUnitID, iUnitType)
  if (iUnitType ~= GameInfo.Units["MY_CUSTOM_GREAT_PERSON"].ID) then
    return true;
  end

  return Players[iPlayer]:GetCivilizationType() == 'MY_CIVILIZATION';
 
Last edited:
Top Bottom