Home › Lua API › TradeManager

Available out of the box. Usable from Lua in the unmodified game.

TradeManager

24 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: TradeManager (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
CalculateDestinationReligiousPressureFromPotentialRoute TradeManager:CalculateDestinationReligiousPressureFromPotentialRoute(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (city:GetID()). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (city:GetID()). (inferred) …
ui-cache yes ↗ 0x6b9120 —
CalculateDestinationYieldFromAttachingResource UI state: TradeManager:CalculateDestinationYieldFromAttachingResource(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes], arg6?: integer[ResourceTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateDestinationYieldFromAttachingResource(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number, arg6?: number) → number (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: arg1 — Id of a player (as in Players[id]).; arg3 — Id of a player (as in Players[id]).; arg5 — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).; arg6 — Index of a row of the Resources table (the value of GameInfo.Resources[...].Index).
ui-cache, gameplay yes ↗ 0x6b9130
same code as CalculateOriginYieldFromAttachingResource
—
CalculateDestinationYieldFromModifiers UI state: TradeManager:CalculateDestinationYieldFromModifiers(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes], arg6?: integer[ResourceTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateDestinationYieldFromModifiers(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number, arg6?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b9140 —
CalculateDestinationYieldFromPath UI state: TradeManager:CalculateDestinationYieldFromPath(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateDestinationYieldFromPath(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number) → number (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b9150
same code as CalculateDestinationYieldFromPotentialRoute
—
CalculateDestinationYieldFromPotentialRoute UI state: TradeManager:CalculateDestinationYieldFromPotentialRoute(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateDestinationYieldFromPotentialRoute(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number) → number (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b9150
same code as CalculateDestinationYieldFromPath
—
CalculateDestinationYieldsFromAttachingResource UI state: TradeManager:CalculateDestinationYieldsFromAttachingResource(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer, paYields?: number) → table
gameplay state: TradeManager:CalculateDestinationYieldsFromAttachingResource(arg1?: any, arg2: integer, arg3: integer, arg4: integer) → table (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: originCityPlayer — Id of a player (as in Players[id]).; destinationCityPlayer — Id of a player (as in Players[id]).
ui-cache, gameplay yes ↗ 0x6b9160
same code as CalculateOriginYieldsFromAttachingResource
0x6b96e0
CalculateDestinationYieldsFromModifiers UI state: TradeManager:CalculateDestinationYieldsFromModifiers(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer, paYields?: number) → table
gameplay state: TradeManager:CalculateDestinationYieldsFromModifiers(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer) → table
args: originCityPlayer — Id of a player (as in Players[id]).; destinationCityPlayer — Id of a player (as in Players[id]).
ui-cache, gameplay yes ↗ 0x6b92f0 0x6b9870
CalculateDestinationYieldsFromPath UI state: TradeManager:CalculateDestinationYieldsFromPath(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer) → table
gameplay state: TradeManager:CalculateDestinationYieldsFromPath(arg1?: any, arg2: integer, arg3: integer, arg4: integer) → table (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: originCityPlayer — Id of a player (as in Players[id]).; destinationCityPlayer — Id of a player (as in Players[id]).
ui-cache, gameplay yes ↗ 0x6b9490
same code as CalculateDestinationYieldsFromPotentialRoute
0x6b9a10
CalculateDestinationYieldsFromPotentialRoute UI state: TradeManager:CalculateDestinationYieldsFromPotentialRoute(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer) → table
gameplay state: TradeManager:CalculateDestinationYieldsFromPotentialRoute(arg1?: any, arg2: integer, arg3: integer, arg4: integer) → table (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: originCityPlayer — Id of a player (as in Players[id]).; destinationCityPlayer — Id of a player (as in Players[id]).
ui-cache, gameplay yes ↗ 0x6b9490
same code as CalculateDestinationYieldsFromPath
0x6b9a10
CalculateOriginReligiousPressureFromPotentialRoute TradeManager:CalculateOriginReligiousPressureFromPotentialRoute(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (city:GetID()). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (city:GetID()). (inferred) …
ui-cache yes ↗ 0x6b95d0 —
CalculateOriginYieldFromAttachingResource UI state: TradeManager:CalculateOriginYieldFromAttachingResource(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes], arg6?: integer[ResourceTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateOriginYieldFromAttachingResource(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number, arg6?: number) → number (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: arg1 — Id of a player (as in Players[id]).; arg3 — Id of a player (as in Players[id]).; arg5 — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).; arg6 — Index of a row of the Resources table (the value of GameInfo.Resources[...].Index).
ui-cache, gameplay yes ↗ 0x6b9130
same code as CalculateDestinationYieldFromAttachingResource
—
CalculateOriginYieldFromModifiers UI state: TradeManager:CalculateOriginYieldFromModifiers(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes], arg6?: integer[ResourceTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateOriginYieldFromModifiers(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number, arg6?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b95e0 —
CalculateOriginYieldFromPath UI state: TradeManager:CalculateOriginYieldFromPath(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateOriginYieldFromPath(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b95f0 —
CalculateOriginYieldFromPotentialRoute UI state: TradeManager:CalculateOriginYieldFromPotentialRoute(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateOriginYieldFromPotentialRoute(arg1?: number, arg2: integer, arg3: integer, arg4: integer, arg5?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (as in Players[id]).; arg4 — Id of a city (named cityID in the scripts). (inferred) …
ui-cache, gameplay yes ↗ 0x6b9600 —
CalculateOriginYieldsFromAttachingResource UI state: TradeManager:CalculateOriginYieldsFromAttachingResource(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer, paYields?: number) → table
gameplay state: TradeManager:CalculateOriginYieldsFromAttachingResource(arg1?: any, arg2: integer, arg3: integer, arg4: integer) → table (the wrapper calls a stub that returns a constant (0, 1, false or a table of zeros))
args: originCityPlayer — Id of a player (as in Players[id]).; destinationCityPlayer — Id of a player (as in Players[id]).
ui-cache, gameplay yes ↗ 0x6b9160
same code as CalculateDestinationYieldsFromAttachingResource
0x6b96e0
CalculateOriginYieldsFromModifiers UI state: TradeManager:CalculateOriginYieldsFromModifiers(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer, paYields?: number) → table
gameplay state: TradeManager:CalculateOriginYieldsFromModifiers(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer) → table
args: originCityPlayer — Id of a player (as in Players[id]).; originCityID — Id of a city (named cityID in the scripts). (inferred); destinationCityPlayer — Id of a player (as in Players[id]).; destinationCityID — Id of a city (named cityID in the scripts). (inferred)
ui-cache, gameplay yes ↗ 0x6b9610 0x6b9b90
CalculateOriginYieldsFromPath UI state: TradeManager:CalculateOriginYieldsFromPath(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer) → table
gameplay state: TradeManager:CalculateOriginYieldsFromPath(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer) → table
args: originCityPlayer — Id of a player (as in Players[id]).; originCityID — Id of a city (named cityID in the scripts). (inferred); destinationCityPlayer — Id of a player (as in Players[id]).; destinationCityID — Id of a city (named cityID in the scripts). (inferred)
ui-cache, gameplay yes ↗ 0x6b97b0 0x6b9d30
CalculateOriginYieldsFromPotentialRoute UI state: TradeManager:CalculateOriginYieldsFromPotentialRoute(originCityPlayer?: number[PlayerTypes], originCityID: integer, destinationCityPlayer: integer[PlayerTypes], destinationCityID: integer) → table
gameplay state: TradeManager:CalculateOriginYieldsFromPotentialRoute(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer) → table
args: originCityPlayer — Id of a player (as in Players[id]).; originCityID — Id of a city (named cityID in the scripts). (inferred); destinationCityPlayer — Id of a player (as in Players[id]).; destinationCityID — Id of a city (named cityID in the scripts). (inferred)
ui-cache, gameplay yes ↗ 0x6b98f0 0x6b9e70
CalculateYieldFromIncomingRoutes UI state: TradeManager:CalculateYieldFromIncomingRoutes(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateYieldFromIncomingRoutes(arg1?: number, arg2?: number, arg3?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg3 — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).
ui-cache, gameplay yes ↗ 0x6b9a30 —
CalculateYieldFromOutgoingRoutes UI state: TradeManager:CalculateYieldFromOutgoingRoutes(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[YieldTypes]) → FixedPointT<8>
gameplay state: TradeManager:CalculateYieldFromOutgoingRoutes(arg1?: number, arg2?: number, arg3?: number) → number (FixedPoint)
args: arg1 — Id of a player (as in Players[id]).; arg3 — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).
ui-cache, gameplay yes ↗ 0x6b9a40 —
CanStartRoute UI state: TradeManager:CanStartRoute(arg1?: number, arg2?: number, arg3?: number, arg4?: number, arg5?: boolean) → boolean
gameplay state: TradeManager:CanStartRoute(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer) → boolean
args: arg1 — Id of a player.; arg2 — Id of a city (city:GetID()).; arg3 — Id of a player.; arg4 — Id of a city (city:GetID()). …
ui-cache, gameplay yes ↗ 0x6b9a50 0x6b9fd0
CanStartRouteWithResource UI state: TradeManager:CanStartRouteWithResource(arg1?: integer[PlayerTypes], arg2?: integer, arg3?: integer[PlayerTypes], arg4?: integer, arg5?: integer[ResourceTypes]) → boolean
gameplay state: TradeManager:CanStartRouteWithResource(arg1?: any[HksObject], arg2: integer, arg3: integer, arg4: integer, arg5?: number) → boolean
args: arg1 — Id of a player (as in Players[id]).; arg3 — Id of a player (as in Players[id]).; arg5 — Index of a row of the Resources table (the value of GameInfo.Resources[...].Index).
ui-cache, gameplay yes ↗ 0x6b9b90 —
GetTradeRoutePath ★ TradeManager:GetTradeRoutePath(arg1?: number, arg2?: number, arg3?: number, arg4?: number) → table ⚠
args: arg1 — Id of a player (the scripts name the argument playerID / owner). (inferred); arg2 — Id of a city (named cityID in the scripts). (inferred); arg3 — Id of a player (the scripts name the argument playerID / owner). (inferred); arg4 — Id of a city (named cityID in the scripts). (inferred)
ui-cache yes ↗ 0x6b9ba0 0x6ba120
IsRouteAllowed TradeManager:IsRouteAllowed(arg1?: number, arg2?: number, arg3?: number, arg4?: number, arg5?: boolean) → boolean ui-cache yes ↗ 0x6b9f20 0x6ba4a0

Notes (★)

GetTradeRoutePath

Returns the plots of a trade route between two cities.