A bunch of people have probably figured this all out by now, since everything is in the game files, but I thought I might as well post this up for reference.
Trade Routes:
It's pretty simple to get info about trade routes, it's just "pPlayer:GetTradeRoutes()", this gives you a table of trade routes owned by that particular player. Each trade route is another table containing the following.
ToGPT 200
ToFood 0
FromID 0
FromCity table: 78C02A48
TurnsLeft 27
FromScience 200
FromTourism 50
ToProduction 0
ToCivilizationType 4
ToCityName Thebes
ToReligion 1
FromReligion 3
FromCityName Bagan
FromPressure 12
ToID 7
ToPressure 7
ToCity table: 78C02C28
ToTourism 0
Domain 0
ToScience 0
FromGPT 1036
Domain appears to have the value "0" for sea routes and "2" for land routes (or just compare the values directly with "DomainTypes.DOMAIN_SEA" and "DomainTypes.DOMAIN_LAND").
All yields are multiplied by 100 (I'm unsure about tourism however). Religious pressure is exactly as is.
Also note that "from" is information about the owner. So in this case, the owner is player 0, civtype 45 (Burma, please ignore), he is receiving 10.4 GPT and 2 BPT, etc. "to" is information about the player to whom the trade route is going to.
You can do stuff like "iDomain = v.Domain" to grab specific info from the table of course.
Great Works:
Great Works are similar, you use "pPlayer:GetGreatWorks(iGreatWorkType)" to grab a player's list of Great Works of a particular type; 1,2,3 and 4 representing Art, Artifacts, Writings and Music respectively. Each individual Great Work also has a table, albeit a much shorter one:
Era 4
Creator 0
Index 1
You can use the Index, which is entirely unique for each Great Work, regardless of type, to grab more information. For example, if you wanted to print the name of the Great Work, you can use "print (Locale.Lookup(Game.GetGreatWorkName(v.Index)))". Look here for more.
Trade Routes:
Code:
local tTradeRoutes = pPlayer:GetTradeRoutes()
for iKey,tTradeRoute in ipairs(tTradeRoutes) do
for sKey, iVal in pairs(tTradeRoute) do print(sKey, iVal) end
end
It's pretty simple to get info about trade routes, it's just "pPlayer:GetTradeRoutes()", this gives you a table of trade routes owned by that particular player. Each trade route is another table containing the following.
ToFood 0
FromID 0
FromCity table: 78C02A48
TurnsLeft 27
FromScience 200
FromTourism 50
ToProduction 0
ToCivilizationType 4
ToCityName Thebes
ToReligion 1
FromReligion 3
FromCityName Bagan
FromPressure 12
ToID 7
ToPressure 7
ToCity table: 78C02C28
ToTourism 0
Domain 0
ToScience 0
FromGPT 1036
Domain appears to have the value "0" for sea routes and "2" for land routes (or just compare the values directly with "DomainTypes.DOMAIN_SEA" and "DomainTypes.DOMAIN_LAND").
All yields are multiplied by 100 (I'm unsure about tourism however). Religious pressure is exactly as is.
Also note that "from" is information about the owner. So in this case, the owner is player 0, civtype 45 (Burma, please ignore), he is receiving 10.4 GPT and 2 BPT, etc. "to" is information about the player to whom the trade route is going to.
You can do stuff like "iDomain = v.Domain" to grab specific info from the table of course.
Great Works:
Code:
for iGreatWorkType = 1, 4, 1 do
local tGreatWorks = pPlayer:GetGreatWorks(iGreatWorkType)
for i,v in ipairs(tGreatWorks) do
for str,val in pairs(v) do print(str,val) end
end
end
Great Works are similar, you use "pPlayer:GetGreatWorks(iGreatWorkType)" to grab a player's list of Great Works of a particular type; 1,2,3 and 4 representing Art, Artifacts, Writings and Music respectively. Each individual Great Work also has a table, albeit a much shorter one:
Creator 0
Index 1
You can use the Index, which is entirely unique for each Great Work, regardless of type, to grab more information. For example, if you wanted to print the name of the Great Work, you can use "print (Locale.Lookup(Game.GetGreatWorkName(v.Index)))". Look here for more.