silentscience
Chieftain
- Joined
- Oct 27, 2016
- Messages
- 41
@astog use this mod when you load a game, you must restart choice repeat route, if not , it will stop when route finish
So i installed version 3.0(have 0 mods that interfere with trading or intarface like quick ui) started a game yesterday and after I got a trader I couldn't send him anywhere, tab menu isn't working at all, after I click it - nothing happens, F4 doesn't work either, than I tried to use a version 2.1 - same problem.
Please help me fix this, cause I can't disable mod(game won't load), but playing without trading is suicide.
Game version 1.0.0.38 and changing local blockPanelInBetweenTurns = false didn't help.
Username is English and path to mods and game is English too.I have the same problem.
I have a suspicion that it happens because invalid characters somewhere in the folder's path. Can you confirm it? In my case, my windows username is in Hebrew.
-- Returns a string of the route in format "[ORIGIN_CITY_NAME]-[DESTINATION_CITY_NAME]"
function GetTradeRouteString( routeInfo:table )
local originPlayer:table = Players[routeInfo.OriginCityPlayer];
local originCity:table = originPlayer:GetCities():FindID(routeInfo.OriginCityID);
local destinationPlayer:table = Players[routeInfo.DestinationCityPlayer];
local destinationCity:table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID);
local s:string = Locale.Lookup(originCity:GetName()) .. "-" .. Locale.Lookup(destinationCity:GetName())
return s;
end
-- Returns a string of the route in format "[ORIGIN_CITY_NAME]-[DESTINATION_CITY_NAME]"
function GetTradeRouteString( routeInfo:table )
local originPlayer:table = Players[routeInfo.OriginCityPlayer];
local originCity:table = originPlayer:GetCities():FindID(routeInfo.OriginCityID);
local destinationPlayer:table = Players[routeInfo.DestinationCityPlayer];
local destinationCity:table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID);
local originCityName:string = "null";
if originCity ~= nil then
originCityName = Locale.Lookup(originCity:GetName());
end
local destinationCityName:string = "null";
if destinationCity ~= nil then
destinationCityName = Locale.Lookup(destinationCity:GetName());
end
local s:string = originCityName .. "-" .. destinationCityName;
return s;
end
This is the exception I'm getting in the logs:
TradeOverview: Better Trade Screen loaded
TradeOverview: Retrieving previous routes PlayerConfig database
Runtime Error: C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:2195: attempt to index a nil value
stack traceback:
C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:2195: in function 'GetTradeRouteString'
C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:1460: in function 'CheckConsistencyWithMyRunningRoutes'
C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:1493: in function 'LoadRunningRoutesInfo'
C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:3041: in function 'Initialize'
C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua:3123: in function '(main chunk)'
[C]: in function '(anonymous)'
Lua callstack:
Runtime Error: Error loading C:\Users\Kyle\Documents\My Games\Sid Meier's Civilization VI\Mods\Better Trade Screen\UI\TradeOverview.lua.
stack traceback:
[C]: in function '(anonymous)'
I found the bug and fixed it.
There's a bug in TradeOverview.lua GetTradeRouteString (lines 2187-2197):
Code:-- Returns a string of the route in format "[ORIGIN_CITY_NAME]-[DESTINATION_CITY_NAME]" function GetTradeRouteString( routeInfo:table ) local originPlayer:table = Players[routeInfo.OriginCityPlayer]; local originCity:table = originPlayer:GetCities():FindID(routeInfo.OriginCityID); local destinationPlayer:table = Players[routeInfo.DestinationCityPlayer]; local destinationCity:table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID); local s:string = Locale.Lookup(originCity:GetName()) .. "-" .. Locale.Lookup(destinationCity:GetName()) return s; end
What happened in my case is the owner of the destination city changed so the lookup of the destinationCity based on the expected destinationPlayer resulted in a Nil value.
I was able to fix this with a simple Nil check (though simple is relative, I had never even heard of the Lua language until now):
Code:-- Returns a string of the route in format "[ORIGIN_CITY_NAME]-[DESTINATION_CITY_NAME]" function GetTradeRouteString( routeInfo:table ) local originPlayer:table = Players[routeInfo.OriginCityPlayer]; local originCity:table = originPlayer:GetCities():FindID(routeInfo.OriginCityID); local destinationPlayer:table = Players[routeInfo.DestinationCityPlayer]; local destinationCity:table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID); local originCityName:string = "null"; if originCity ~= nil then originCityName = Locale.Lookup(originCity:GetName()); end local destinationCityName:string = "null"; if destinationCity ~= nil then destinationCityName = Locale.Lookup(destinationCity:GetName()); end local s:string = originCityName .. "-" .. destinationCityName; return s; end
Surprisingly, this worked brilliantly. The code calling this method was cleanup logic, so the existing logic was able to detect the trade route was no longer valid and removed it. Now my Trade Screen loads again and has my current routes listed!!!! I'm so happy.
These are the new logs I see after making the above change:
TradeOverview: Better Trade Screen loaded
TradeOverview: Retrieving previous routes PlayerConfig database
TradeOverview: Route Ostia-null is no longer running. Removing it.
TradeOverview: Route Aquileia-null is no longer running. Removing it.
TradeOverview: Route Arretium-Mohenjo-Daro is no longer running. Removing it.
TradeOverview: Route Aquileia-Changsha is no longer running. Removing it.
TradeOverview: Route Ostia-Pazyryk is no longer running. Removing it.
TradeOverview: Dumping routes in PlayerConfig database
Try installing the mod into the DLC folder. For some users this seems to fix it.It does not work, follow the instructions on ustanvki. No results. What to do?
already I tried. ineffectuallyTry installing the mod into the DLC folder. For some users this seems to fix it.
False positive. Your AVG is drunkIs there a reason why AVG detects this, TradeOverview.lua, to be a "Trojan horse"?
"Linux/Agent Lua is a malicious application that allows hackers to remotely access your computer system letting them modify files, steal personal information and install more unwanted software. These kinds of threats, called Trojan horse, must be sent to you by someone or carried by another program. They may also arrive thanks to unwanted downloads on infected websites or installed with online games or other internet-driven applications. Most Trojan horses can be detected and removed by AVG."
I also use AVG and have not encountered that.Is there a reason why AVG detects this, TradeOverview.lua, to be a "Trojan horse"?
"Linux/Agent Lua is a malicious application that allows hackers to remotely access your computer system letting them modify files, steal personal information and install more unwanted software. These kinds of threats, called Trojan horse, must be sent to you by someone or carried by another program. They may also arrive thanks to unwanted downloads on infected websites or installed with online games or other internet-driven applications. Most Trojan horses can be detected and removed by AVG."