1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

SpecialistYields - YIELD_FAITH

Discussion in 'Civ5 - SDK / LUA' started by Pazyryk, Jul 7, 2014.

  1. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Has anyone looked into this or got it working?

    Culture is still added separately. However, a quick look at dll code makes me think Faith should work. It's even referenced in CvCityCitizens::IsAIWantSpecialistRightNow():
    Code:
    if(pSpecialistInfo && pSpecialistInfo->getYieldChange(YIELD_FAITH) > 0)
    However, the yield from faith specialist isn't working for me. The DB is correct. One possible reason it may not work in Éa is that I have 2 different specialists that both give Faith. I can't quite deconvolute dll DB code to know if that is a problem or not.
     
  2. insert_brain

    insert_brain Chieftain

    Joined:
    Jun 14, 2014
    Messages:
    8
    I was poking around the C++/Lua requests thread and found this:

    http://forums.civfanatics.com/showpost.php?p=12525425&postcount=39

    Did not check it myself, just reporting
     
  3. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
  4. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
    The reason why it doesn't work in the standard DLL is this function:

    Spoiler :
    Code:
    int CvCity::GetFaithPerTurn() const
    {
    	VALIDATE_OBJECT
    
    	// No faith during Resistance
    	if(IsResistance() || IsRazing())
    	{
    		return 0;
    	}
    
    	int iFaith = GetFaithPerTurnFromBuildings();
    	iFaith += GetBaseYieldRateFromTerrain(YIELD_FAITH);
    	iFaith += GetFaithPerTurnFromPolicies();
    	iFaith += GetFaithPerTurnFromTraits();
    	iFaith += GetFaithPerTurnFromReligion();
    
    	// Puppet?
    	int iModifier = 0;
    	if(IsPuppet())
    	{
    		iModifier = GC.getPUPPET_FAITH_MODIFIER();
    		iFaith *= (100 + iModifier);
    		iFaith /= 100;
    	}
    
    	return iFaith;
    }
    


    It doesn't check faith from specialists.
     
  5. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Thanks!

    I was tricked by the faith specialist reference in CvCityCitizens::IsAIWantSpecialistRightNow.

    Looks like all we need is CvCity::GetFaithPerTurnFromSpecialists(), exposed to Lua for UI.
     

Share This Page