International trade routes & Science

Frossa

Prince
Joined
Apr 29, 2012
Messages
413
Location
Sweden
How do you modify the amount of Science you get from a trade route with a civilization that has more techs than you do? I believe the default bonus stands at 1 Science per undiscovered technology, but I want to be able to change that bonus to, perhaps, 10 Science per tech.
I couldn't find anything related to this in GlobalDefines.xml (maybe I didn't look hard enough), so does anybody have a clue where this is defined?
 
Hard coded in the DLL unfortunately. You'd have to modify this and recompile the DLL to change it:

Code:
int CvPlayerTrade::GetTradeConnectionBaseValueTimes100(const TradeConnection& kTradeConnection, YieldTypes eYield, bool bAsOriginPlayer)
{
	if (bAsOriginPlayer)
	{
		if (GC.getGame().GetGameTrade()->IsConnectionInternational(kTradeConnection))
		{
			if (eYield == YIELD_GOLD)
			{
				int iResult = 0;
				if (!GET_PLAYER(kTradeConnection.m_eDestOwner).isMinorCiv())
				{
					int iBase = GC.getINTERNATIONAL_TRADE_BASE();
					iResult = iBase;
				}
				return iResult;
			}
			else if (eYield == YIELD_SCIENCE)
			{
				int iTechDifference = GC.getGame().GetGameTrade()->GetTechDifference(kTradeConnection.m_eOriginOwner, kTradeConnection.m_eDestOwner);
				int iAdjustedTechDifference = 0;
				if (iTechDifference > 0)
				{
					int iCeilTechDifference = (int)ceil(iTechDifference / 2.0f);
					iAdjustedTechDifference = max(iCeilTechDifference, 1);
				}

				return iAdjustedTechDifference * 100;
			}
		}
	}
	else
	{
		if (eYield == YIELD_SCIENCE)
		{
			int iTechDifference = GC.getGame().GetGameTrade()->GetTechDifference(kTradeConnection.m_eDestOwner, kTradeConnection.m_eOriginOwner);
			int iAdjustedTechDifference = 0;
			if (iTechDifference > 0)
			{
				int iCeilTechDifference = (int)ceil(iTechDifference / 2.0f);
				iAdjustedTechDifference = max(iCeilTechDifference, 1);
			}

			return  iAdjustedTechDifference * 100;
		}
		else
		{
			return 100;
		}
	}

	return 0;
}
 
Maybe you could make a dummy building giving 1000% more science from trade routes. That should help you.

IIRC there is no xml value for this in the building files.
Iam also looking for changing ammount per trading route, but didnt find a way yet without firing the dll.
 
Top Bottom