Mrblbshrtz
Chieftain
- Joined
- Jul 29, 2014
- Messages
- 53
My mod requires modification of BNW's trade routes system, but in order to do so, I need to figure out what Player:GetTradeRoutes() is. It returns tables, so far I have figured this out by analysing the TradeRoutesOverview.lua:
It returns a table, it has one entry for each trade route, though you can't index it by using ints, I had to use ipairs (something I don't quite understand). Each entry is a table. It has in it this (so far what I have gleaned):
One thing I'm looking for is some kind of unique identifier of that trade route, as each trade routes position in the table will change as trade routes expire/ are removed. Another thing, is what is the contents of that city table?
If you guys could answer any of the questions, that'd be great, but I thought I'd put this up mainly if anyone else may have use for it - I certainly did.
It returns a table, it has one entry for each trade route, though you can't index it by using ints, I had to use ipairs (something I don't quite understand). Each entry is a table. It has in it this (so far what I have gleaned):
- FromCity: Returns a table- how can I find out the contents of this table without knowing the keys- will this require ipairs?
- ToCity: As above
- FromID
- ToID
- Domain: Land or water
- FromCiv
- ToCiv
- ToCityName: Returns the Name! Yay
- FromCityName: Same as above
- From*: GPT, Production, Food, Religion, Pressure, Science
- To*: GPT, Production, Food, Religion, Pressure, Science
- TurnsLeft
One thing I'm looking for is some kind of unique identifier of that trade route, as each trade routes position in the table will change as trade routes expire/ are removed. Another thing, is what is the contents of that city table?
If you guys could answer any of the questions, that'd be great, but I thought I'd put this up mainly if anyone else may have use for it - I certainly did.