As there are only a few examples of editing the scripts, I'll provide a detailed explanation. Anyway, to edit the scripts in the long run, you'll need to have some experience in programming (and that won't be possible for me to guide by hand every modding requests dealing with scripting changes). What I can do though is replying to people not finding a function or not knowing where to find something.
In Data\Scripts\Faction.bsf
At line 3042:
// 2 - Number of structures in each region (no discount)
result += ADMIN_BURDEN_STRUCCOEFFh * Pow(Region_Structures_Count(regionID), ADMIN_BURDEN_STRUCPOWERh, 100)
This is the part which depends of the content of the region. You'll want to alter that depending of the distance to the nearest capital of the faction (this gives benefits from having multiple capitals, which is good)
So first store the current value calculated for the region in a new variable, say:
regionalVal = ADMIN_BURDEN_STRUCCOEFFh * Pow(Region_Structures_Count(regionID), ADMIN_BURDEN_STRUCPOWERh, 100);
then call the function returning the nearest capital. This will return the capital ID and the distance to this capital, stored in gResult. See the explanations at line 10.900:
// NEAREST CAPITAL ID
// Returns the regionID
// in <gResult> returns the distance, in map coordinates (70.000 is Rome-Tarente)
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FUNCTION Faction_Politic_NearestCapitalID(factionID, regionID)
--
You thus call this faction and store the capital ID. gResult has been updated too. for example capitalID = Faction_Politic_NearestCapitalID(factionID, regionID);
Then you might decide that a distance of 250.000 map coordinates is your coefficient 1. More will be costlier, less will be cheaper.
Code: Select all
if (capitalID > 0)
{
gResult = Max(62500, gResult) // coeff will not be below 25%
}
else
{
gResult = 750000 // not having a capital is equivalent to triple distance everywhere
}
regionalVal = DivideAndRound(regionalVal * gResult, 250000)
And then you add this modified regional value to the current tally, so:
result += regionalVal;
Hope this helps.