Home › Lua API › PlayerTrade

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

PlayerTrade

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

Community reference for this object: PlayerTrade (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
CalcFavorPerTurnFromTradePartners UI state: PlayerTrade:CalcFavorPerTurnFromTradePartners() → number
gameplay state: PlayerTrade:CalcFavorPerTurnFromTradePartners() → number
touches (inferred from the code): reads Cache::Player::Trade::m_Variants+0x10
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x7425f0 0x742f30
CountOutgoingRoutes PlayerTrade:CountOutgoingRoutes() → number
touches (inferred from the code): reads Player::Instance::m_id
gameplay yes ↗ 0x6f72d0 0x6f7a10
GetInternationalYieldModifier PlayerTrade:GetInternationalYieldModifier(eYield?: integer[YieldTypes]) → FixedPointT<8>
args: eYield — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).
✓ exists at runtime (not called)
ui-cache — 0x6b5b80 —
GetLandRangeRefuel PlayerTrade:GetLandRangeRefuel() → number
touches (inferred from the code): reads Cache::Player::Trade::m_Variants+0x14
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b5b90 0x6b6110
GetNumOutgoingRoutes PlayerTrade:GetNumOutgoingRoutes() → number
touches (inferred from the code): reads Cache::Player::Trade::m_Variants+0x8
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b5be0 0x6b6160
GetOutgoingRouteCapacity UI state: PlayerTrade:GetOutgoingRouteCapacity() → number
gameplay state: PlayerTrade:GetOutgoingRouteCapacity() → number
touches (inferred from the code): reads Cache::Player::Trade::m_Variants+0xc
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x6b5c30 0x6b61b0
GetWaterRangeRefuel PlayerTrade:GetWaterRangeRefuel() → number
touches (inferred from the code): reads Cache::Player::Trade::m_Variants+0x18
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6b5c80 0x6b6200