v.4 use that (in
HSD_Functions.lua, the comment in Defines.lua is just a reminder):
Code:
local range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1) * GetConvertionRangePercent(playerID) / 100)
Values are in
Defines.lua
Code:
[B]CONVERT_BARBARIAN_RANGE[/B] = 4
[B]CONVERT_ERA_RANGE_MOD[/B] = 45
And
g_Era is the highest era reached by any player
Era values are:
Code:
ANCIENT = 0
CLASSICAL = 1
MEDIEVAL = 2
RENAISSANCE = 3
INDUSTRIAL = 4
MODERN = 5
POST_MODERN = 6
FUTURE = 7
GetConvertionRangePercent is used to lower the range of barbarians conversion for spawning CS.
Say you're civilization is spawning, and the most advanced civ in game is in Renaissance era (=3)
GetConvertionRangePercent for a major civ is 100, so the range would be:
range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1)
->
range = Round(4 * math.max((3 + 1 * 45 / 100), 1)
->
range = Round(4 * math.max(3.45, 1)
->
range = Round(4 * 3.45) = 14
(In next version it will be range = Round(4 * math.max(((3 + 1) * 45 / 100), 1) = 7)