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

[BNW] <Improvement_YieldPerEra> of my Custom Tile Improvement is not working, Help!

Discussion in 'Civ5 - Creation & Customization' started by tac_NCVD, Jul 10, 2020.

  1. tac_NCVD

    tac_NCVD Chieftain

    Joined:
    Feb 29, 2020
    Messages:
    18
    Gender:
    Male
    <Improvement_YieldPerEra> of my Custom Tile Improvement is not working, Help!
    Code:
        <Improvement_YieldPerEra>
            <Row>
                <ImprovementType>IMPROVEMENT_CAT_CITADEL_ZHAO</ImprovementType>
                <YieldType>YIELD_SCIENCE</YieldType>
                <Yield>2</Yield>
            </Row>
        </Improvement_YieldPerEra>
     
  2. Troller0001

    Troller0001 Watching from a safe distance

    Joined:
    Mar 9, 2016
    Messages:
    741
    Gender:
    Male
    Location:
    The Netherlands
    So YieldPerEra is a bit of a weird thing, and the name is rather misleading.
    It works based on the era of archaeological records, and is for instance used for the landmark to give extra culture the older your artefact is. It does not give yields based on the construction era of the improvement.

    The relevant source code:
    Code:
        int iYieldChangePerEra = pImprovement->GetYieldChangePerEra(eYield);
        if (ePlayer != NO_PLAYER && iYieldChangePerEra > 0)
        {
            CvPlayerAI& kPlayer = GET_PLAYER(ePlayer);
    
            int iPlotEra = GetArchaeologicalRecord().m_eEra;
            int iNumEras = kPlayer.GetCurrentEra() - iPlotEra;
    
            if (iPlotEra != NO_ERA && iNumEras > 0)
            {
                iYield += (iNumEras * iYieldChangePerEra);
            }
        }
    
    Specifically note that iPlotEra is based on the era of the archaeological record on the plot.
     
  3. tac_NCVD

    tac_NCVD Chieftain

    Joined:
    Feb 29, 2020
    Messages:
    18
    Gender:
    Male
    thanks!
     

Share This Page