Are city-states hard coded not to have Great People or something?

Leugi

Supreme Libertador
Joined
Jan 25, 2013
Messages
1,675
Location
Bolivia
Ok... question in title...

I wanted to add progress towards X Great Person for a city-state that is both an ally and follows the religion of a player. BUT the lua code doesn't seem to work, as the CS never gets the unit... I know the conditions are functional because of a print thing, but I can't check to see the City View and see if it has progress because not even spies can do that with CS (for some reason). I also tried adding a dummy building to them, that granted the GP points, it doesn't seem to work either.

Code:
local tSpecialist = GameInfo.Specialists.SPECIALIST_MUSICIAN.ID;
local tBonus = 6000;


function TiwanakuInfluence(iPlayer)
	local pPlayer = Players[iPlayer];
	if pPlayer:IsAlive() then
		for _, tPlayer in pairs(Players) do
			if (tPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_TIWANAKU"]) then
				if (tPlayer:HasCreatedReligion()) then
					local eReligion = tPlayer:GetReligionCreatedByPlayer();
						if (pPlayer:GetMinorCivFriendshipLevelWithMajor(tPlayer:GetID()) == 2) then
							for tCity in pPlayer:Cities() do
								if (tCity:GetReligiousMajority() == eReligion) then
									tCity:ChangeSpecialistGreatPersonProgressTimes100(tSpecialist, tBonus)
									print ("It works?!");
								end
							end
						end
				end
			end
		end
	end
	
end

Any ideas?
 
It's probably hard coded if you can't make a CS spawn it. If the code for CS not getting great people is a DLL, then you'll need another program.
 
Hard-coded in CvCityCitizens:: DoSpecialists()

Code:
// Enough to spawn a GP?
if (GetSpecialistGreatPersonProgress(eSpecialist) >= iGPThreshold) {
	// No Minors
	if (!GET_PLAYER(GetCity()->getOwner()).isMinorCiv()) {
		// Now... actually create the GP!
	}
}
 
Hrrm Hrrm Hrrm. Would it be possible to workaround (says my broken hack-it-with-a-sharp-pickaxe mind) by giving a player a GP and then gifting that GP to the CS? If so, would the CS have the faintest idea what to do with it?
 
I think we could simply try somehow counting each turn the civ is allied/has a religion with the CS, and after it hits the end of the counter, InitUnit a Great Person for the CS, right?

However, I suppose that would need Saveutils.
 
Top Bottom