Future Worlds

Why im always having this error
[1136.514] Runtime Error: C:\Users\DK\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6) A2\Lua\CityNearbyMapDatasV4.lua:1105: attempt to index field '?' (a nil value)
I thought the future era was fully compatible with enlightenment era (it was just working at first, it always crashed around renaissance era or enlightenment era).
I was suspecting that error was the cause, but that error appeared even when i played the future era only. Tho, it aint crash the game.
 
Last edited:
Why im always having this error
[1136.514] Runtime Error: C:\Users\DK\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6) A2\Lua\CityNearbyMapDatasV4.lua:1105: attempt to index field '?' (a nil value)
I thought the future era was fully compatible with enlightenment era (it was just working at first, it always crashed around renaissance era or enlightenment era).
I was suspecting that error was the cause, but that error appeared even when i played the future era only. Tho, it aint crash the game.

I doubt that's gonna have anything to do with EE; it'll be an issue relating to LeeS' utility.
 
I doubt that's gonna have anything to do with EE; it'll be an issue relating to LeeS' utility.
I know, that error was coming from the utility of FW.
I mean, every time i turned on the EE and FW, the game ll crash in renaissance era or enlightenment era.
 
Problem with mod, tech tree not showing any of the new tecnologies
I've tried running this mode without anything else and to un-install and reinstall the game but I always have this error.
 

Attachments

  • Database.txt
    18.5 KB · Views: 219
Problem with mod, tech tree not showing any of the new tecnologies
I've tried running this mode without anything else and to un-install and reinstall the game but I always have this error.
Whats your version?
Mine is 1.0.3.279 (GnK and BNW)
 
Was there ever a good workaround figured out to use FW in conjunction with civs that have Worker UUs (Tomatekh's Harappa and Caral, ryanjames's Trypillia, etc.)? I know this came up in the CBR2, and I found recently that even up-to-date v6 didn't let these UUs build the new improvements.

Other issue I wanted to mention: when playing with JFD's Cultural Diveristy, I found myself hoping for the Future Era splash screen to be different by culture. I went looking to see if there was good art that could be used for such a circumstance, and found a fair number of possibilities. I've dumped them in a spoiler on the off-chance you're interested in implementing such a thing. Admittedly, I'm not sure whether this would be better handled on your end or JFD's, but so it goes.

Spoiler :

Aboriginal: https://www.artstation.com/artwork/P29K1
Central Europe: https://www.artstation.com/artwork/X1Q90
Classical: https://www.artstation.com/artwork/BmmXA (was used in an older version of CulDiv)
Great Plains: http://joanpiquellorens.deviantart.com/art/Flying-City-530921276
Himalayan: https://www.artstation.com/artwork/agLEz
Islamic: http://eddie-mendoza.deviantart.com/art/Neo-Arabia-420136526
Katuje: https://www.artstation.com/artwork/5XqlE
Mesopotamic: http://fstarno.deviantart.com/art/MATTE-PAINTING-Babel-Myth-80030248
Oceanic: http://danielwachter.deviantart.com/art/Living-on-the-Ocean-335997375
Oriental: http://jjcanvas.deviantart.com/art/Neo-Hong-Kong-Cityline-521195265
or http://jjcanvas.deviantart.com/art/Neo-Hong-Kong-Sunset-497297100
Oriental-Japan: http://jjcanvas.deviantart.com/art/Neo-Tokyo-Commission-309545088
Pacific (PNW): http://merl1ncz.deviantart.com/art/Colony-revision-177141757
Polar: https://mik2121.artstation.com/projects/6veEn
Southern Europe: http://eddie-mendoza.deviantart.com/art/The-Ledge-487320415
Steppe: https://www.artstation.com/artwork/rJwE
Totalitarian: http://steve-burg.deviantart.com/art/Arcology-Daybreak-179184375
Western Europe: http://aksu.deviantart.com/art/City-Towers-43139901

generic ones that could conceivably be used for other cultures:
http://eddie-mendoza.deviantart.com/art/Arrival-411560886
http://eddie-mendoza.deviantart.com/art/Tower-12-411561585
http://eddie-mendoza.deviantart.com/art/Hacker-City-452152934
http://eddie-mendoza.deviantart.com/art/Misty-Dawn-411561898
http://eddie-mendoza.deviantart.com/art/Neo-Noir-198626866
http://kimmokaunela.deviantart.com/art/Castles-In-The-Sky-310173528
http://tomwalks.deviantart.com/art/Space-Station-Blender-Gimp-376223010
http://tryingtofly.deviantart.com/art/City-Route-393146494
http://darkhikarii.deviantart.com/art/Garden-City-411201882
http://bartzis.deviantart.com/art/Mega-Rail-Station-Orbital-03-639880029
https://www.artstation.com/artwork/4EKBq
https://www.artstation.com/artwork/qNJ9P
http://antifan-real.deviantart.com/art/Speedpaint-Future-City-58452645
http://firefly2347.deviantart.com/art/Sci-fi-city-77483121
http://jadrienc.deviantart.com/art/Sci-fi-City-Downtown-343647806
 
Was there ever a good workaround figured out to use FW in conjunction with civs that have Worker UUs (Tomatekh's Harappa and Caral, ryanjames's Trypillia, etc.)? I know this came up in the CBR2, and I found recently that even up-to-date v6 didn't let these UUs build the new improvements.

It'd be easiest for this to be done on their end; but since that's pretty inviable, this would be a rudimentary fix...

Code:
CREATE TRIGGER C15_FW_WorkerFixYesItsMessyButWeCantDoMuchBetterTbh
AFTER INSERT ON Unit_Builds
WHEN (SELECT Class FROM Units WHERE Type = NEW.UnitType) IN ('UNITCLASS_WORKER' , 'UNITCLASS_JFD_WORKER', 'UNITCLASS_JFD_SLAVE') AND (SELECT COUNT(UnitType) FROM Unit_Builds WHERE UnitType = NEW.UnitType) = 1 AND NEW.BuildType NOT IN (/*List the FW Builds*/)
BEGIN
INSERT INTO Unit_Builds
(UnitType, BuildType)
SELECT NEW.UnitType, Type
FROM Builds WHERE Type IN (/*List the FW Builds*/);
END;

Blatant flaws include the fact that units that don't replace the Worker but want to be able to build all improvements won't work. Now we simply wait for LeeS to explain to us all the other things I've done wrong... :p
 
I really like your mod, such unique and interesting ideas. I really love how you often have to make hard decision because many buildings exclude each other. I am currently running a game as india where i startet with a triple salt city and got early awesome petra city with many hills and sheep which now has the Helios microwave power satelite to boost it even more. round 370 and i now have 100 citys on normal game speed, looking forward to going full Network backbone and Autoplant to stack the effect still need some techs to complete to test everything, however i found a bug and have some suggestions

You allowed the hydroponic dome to be built on forest but it needs to remove the forest to actually built the dome. If its not a tundra/snow/desert tile under the forest this means that after the forest is chopped down by the worker it simply stops.

Yeah, it's a bug I really should fix... by default, most improvements include Forest (along with Jungle and Marsh) in the BuildFeatures table... so you can start building them on those features and it'll get removed automatically. But since Forests can be on a terrain that Hydroponics Domes can't be built on, the game sees the Forest, says "It's okay to build!" and then when the Forest is gone realizes the mistake. XD

I've taken the Hydroponics Dome out of the BuildFeatures table to avoid the issue, so once I get a new patch out it should fix the problem.

The other thing is that you give us a lot of science right before the tech tree ends, do you have plans to work in some mechanic for the last future tech that only gives points? Some weak but repeatable stuff so science isnt useless after you have everything. If possible with some variety to choose from

That might be a bit complex to implement... I'll have to take a look at how the end techs work to see if there's something I can do with repeating techs. I'm not sure what kinds of effects would be good... production bonuses?

I dont know if that is what you had in mind when doing it but the national wonder "Central comand" which needs information Hubs in all cities is impossible to built when you have just one city which then Network backbone as it excludes the information hub. Its and interesting design if there would be a national wonder which needs network backbones in all cities, so you you get kind of a bonus if you stick to one. As i see it now the Network backbone is the better route for wide empires and the information hub is better for tall ones, maybe you can work that into the national wonders

The "Hub" line of buildings was intended to try and favor tall empires (thus, most of them have population-related yields), and the Central Command was intended to play into that by trying to give a bonus for having them in all cities. It's a question as to whether the yields from the Central Command is worth giving up having any of the Network Backbone line? :p

The Aquaculture lab is extremely inferior to the undersea mining platform. I think the aquaculture lab should give every ocean and coast tile food and gold, not just sea ressource to be on par with the platform.

Yeah, I've been trying to balance them, and it's tricky. One problem is that the Undersea Mining Platform comes a bit later in the tech tree. Plus, I do like the idea of one being a more generic widespread bonus with the other being more specific to resources. But given the general lack of sea resources in some cities... perhaps a smaller bonus per tile, with some additional bonuses on resources? One idea I'd considered was having the Aquaculture Lab actually cause sea resources to start spreading...

How exactly does the brain uploading facility works? I tested it and deleted it after, and built it again in the same city and it stopped giving me a bonus. If I have 40 people in my city and built it and get 10 people uploaded will every 4th new citizen that grows in this city get uploaded too?

Looking forward to see how the community patch AI works with your new units, up now it looks like everything is compatible and nicely working

I can't remember how I got the Brain Uploading facility to work, but its initial effect should only fire once. (Otherwise, you could just keep rebuilding it to convert your entire population?) I think the uploaded citizens should remain, even if the building is removed, but since their bonuses are pretty invisible that might be why it looks like you don't get any additional bonus. The facility has a 25% chance of uploading any new citizens that appear in the city - it was easier to implement a random 25% chance than to add a counter to track every 4th citizen. :p

Glad you're enjoying the mod!

BUG: There is no theme bonus from virtual idol wonder.

I thought I fixed this? Maybe it got rolled back at some point... I'll take a look into it.

It'd be easiest for this to be done on their end; but since that's pretty inviable, this would be a rudimentary fix...

Code:
CREATE TRIGGER C15_FW_WorkerFixYesItsMessyButWeCantDoMuchBetterTbh
AFTER INSERT ON Unit_Builds
WHEN (SELECT Class FROM Units WHERE Type = NEW.UnitType) IN ('UNITCLASS_WORKER' , 'UNITCLASS_JFD_WORKER', 'UNITCLASS_JFD_SLAVE') AND (SELECT COUNT(UnitType) FROM Unit_Builds WHERE UnitType = NEW.UnitType) = 1 AND NEW.BuildType NOT IN (/*List the FW Builds*/)
BEGIN
INSERT INTO Unit_Builds
(UnitType, BuildType)
SELECT NEW.UnitType, Type
FROM Builds WHERE Type IN (/*List the FW Builds*/);
END;

Blatant flaws include the fact that units that don't replace the Worker but want to be able to build all improvements won't work. Now we simply wait for LeeS to explain to us all the other things I've done wrong... :p

I was suspecting there must be a way to account for Worker UUs with SQL, but I'm still such a noob with it I had no clue how to start. I'll have to give this a try!
 
That might be a bit complex to implement... I'll have to take a look at how the end techs work to see if there's something I can do with repeating techs. I'm not sure what kinds of effects would be good... production bonuses?
Consider the four repeating techs at the end of C-evo, perhaps?
 
Why im always having this error
[1136.514] Runtime Error: C:\Users\DK\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6) A2\Lua\CityNearbyMapDatasV4.lua:1105: attempt to index field '?' (a nil value)
I thought the future era was fully compatible with enlightenment era (it was just working at first, it always crashed around renaissance era or enlightenment era).
I was suspecting that error was the cause, but that error appeared even when i played the future era only. Tho, it aint crash the game.

I solve this problem for me, that was a improvement who have a null value to "description" so a function in the script can't index this field.
I look into the database (search in the forum if you don't know how to do) in the "improvements" table and found that CiD add a dummy improvement for machu pichu who do not have description. Maybe another mod for you do the same thing.
So after, with my poors but existing programmer skills, I found that :
In the line 88 of "CityNearbyMapDatasV4.lua" you have this query : ("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS'")
that query select improvements and send them to the function who index the "description" field and make the error.

So if you found a improvement with a description value to null you must add it in exception into the query like that :
("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Type !='NAME_OF_THE_IMPROVEMENT'")
and to be sure in line 84 modify the other query :
("SELECT ID, Description, Type FROM Improvements WHERE DestroyedWhenPillaged = 0 AND PillageGold > 0 AND Type !='NAME_OF_THE_IMPROVEMENT'")

I guess you can also found and modify the improvement to add it a description.

But if you say you have this same error without another mod that's really weird because to the line 1105 you do not have another function and the only function index two fields Type and Description, to know that Type can't be null.
I can not guarantee that will fix you crash to, I still have CTD after this fix every ~200 turns with Future Worlds (and a lot of other mods in same time) but not game breaking CTD, reloading 2/3 turns back 1 to 3 times and game continue, annoying but playable.
 
Fwiw if the issue here is to do with Description returning null, then you can either have the query be
Code:
("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Description NOT NULL")
to catch all Improvements that'll give this issue, or you can modify the Lua to only make use of the Description variable (for whatever it's used for) if it's not nil.
 
Chrisy always here for help !
Thanks for the advice, my SQL is very... nooby ?^^ You're query is better, no need to search into the database.
 
So if you found a improvement with a description value to null you must add it in exception into the query like that :
("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Type !='NAME_OF_THE_IMPROVEMENT'")
and to be sure in line 84 modify the other query :
("SELECT ID, Description, Type FROM Improvements WHERE DestroyedWhenPillaged = 0 AND PillageGold > 0 AND Type !='NAME_OF_THE_IMPROVEMENT'")

I guess you can also found and modify the improvement to add it a description.

But if you say you have this same error without another mod that's really weird because to the line 1105 you do not have another function and the only function index two fields Type and Description, to know that Type can't be null.
I can not guarantee that will fix you crash to, I still have CTD after this fix every ~200 turns with Future Worlds (and a lot of other mods in same time) but not game breaking CTD, reloading 2/3 turns back 1 to 3 times and game continue, annoying but playable.
Yes, i have the reforest improvement mod which makes the worker able to grow forest. Its working like building improvement, but it ll be gone as soon as the worker finished it (the improvements replaced by forest tile).

Fwiw if the issue here is to do with Description returning null, then you can either have the query be
Code:
("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Description NOT NULL")
to catch all Improvements that'll give this issue, or you can modify the Lua to only make use of the Description variable (for whatever it's used for) if it's not nil.
AND Description NOT NULL <-- AGREED :thumbsup:
 
I seem to be having issues with FW, used in conjunction with JFDLC, as well as several other mods that add civs.

LUA: https://pastebin.com/871VahHC

Database: https://pastebin.com/7VNWWgVN

Basically, after showing
Spoiler :
[947973.765] Runtime Error: C:\Users\Light\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6)\Lua/FutureLua.lua:235: attempt to call global 'GetCityMapDatas' (a nil value)
a few times, the game crashes.

I am running:
Rise to Power V33
With Claims over City-States disabled​
ExCE V18
Cultural Diversity V10
Community Patch V88
Barbarians: Unlimited Exp
Future Worlds V6
Infoaddict V22
Leadership Reformation V4
Longer Eras: Historic V8
More Luxuries V155
More Pantheons V122
Events and Decisions V3
YNAEMP V24

as well as several mods that add new civilizations.

EDIT:

Applied the changes below:

Fwiw if the issue here is to do with Description returning null, then you can either have the query be
Code:
("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Description NOT NULL")
to catch all Improvements that'll give this issue, or you can modify the Lua to only make use of the Description variable (for whatever it's used for) if it's not nil.

Still crashing, here's the new logs.

LUA: https://pastebin.com/VQnu1mAC

Database: https://pastebin.com/tGsVAaRJ
 
Last edited:
Yo gotta change the line 84 and 88 of "CityNearbyMapDatasV4.lua". Have you done for both lines?
I just paste "AND Description NOT NULL" into both of them, like this, right? I've added the change to line 84 - I only had line 88 before. Sorry about that, I should've paid more attention to the instructions.

Code:
or Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE DestroyedWhenPillaged = 0 AND PillageGold > 0 AND Description NOT NULL") do
    tPillageableImprovements[Improvement.ID] = { Type=Improvement.Type, Description=Locale.ConvertTextKey(Improvement.Description)}
end
--for Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITADEL' AND Type != 'IMPROVEMENT_CITY_RUINS' AND Type != 'IMPROVEMENT_FORT'") do
for Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Description NOT NULL")") do

Nothing else was modified.

EDIT: I must've made the edit wrong, because it's still crashing. Here are the new logs.

LUA: https://pastebin.com/TC5FPzER

Database: https://pastebin.com/T6r5xqNJ

EDIT: The crashes seem to be coming from the futurelua file.

Code:
[1085508.531] Runtime Error: C:\Users\Light\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6)\Lua/FutureLua.lua:235: attempt to call global 'GetCityMapDatas' (a nil value)

EDIT: Here's the function where the file attempts to call getcitymapdatas.

Code:
function FWBuildingImprovementBonuses(iPlayer)
    local pPlayer = Players[iPlayer]
    local tMyWheatPlotsThisTurn = {}
    for pCity in pPlayer:Cities() do
        local tNearbyDatas = GetCityMapDatas(pCity)
        if pCity:IsHasBuilding(iBuildingGeneLab) then
            local iNumFarms = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementFarm)
            print("Num Farms: " .. iNumFarms)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_GENE_LAB_DUMMY"], iNumFarms)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_GENE_LAB_DUMMY"], 0)
        end
        --if pCity:IsHasBuilding(iBuildingCloneLab) then
        --    local iNumPastures = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementPasture)
        --    pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_CLONE_LAB_DUMMY"], iNumPastures)
        --else
        --    pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_CLONE_LAB_DUMMY"], 0)
        --end
        if pCity:IsHasBuilding(iBuildingSanctuary) then
            local iNumPreserves = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementPreserve)
            print("Num Preserves: " .. iNumPreserves)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SANCTUARY_DUMMY"], iNumPreserves)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SANCTUARY_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingNetworkBackbone) then
            local tCommArrayPlots = GetCityImprovementPlots(tNearbyDatas, iImprovementCommArray, "Plots")
            local iNumCommArrays = #tCommArrayPlots
            print("Num CommArrays: " .. iNumCommArrays)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_NETWORK_BACKBONE_DUMMY_3"], iNumCommArrays)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_NETWORK_BACKBONE_DUMMY_3"], 0)
        end
        if pCity:IsHasBuilding(iBuildingDroneHive) then
            local tGeneratorPlots = GetCityImprovementPlots(tNearbyDatas, iImprovementGenerator, "Plots")
            local iNumGenerators = #tGeneratorPlots
            print("Num Generators: " .. iNumGenerators)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_1"], iNumGenerators)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_1"], 0)
        end
        if pCity:IsHasBuilding(iBuildingSimulationServer) then
            local tCorePlots = GetCityImprovementPlots(tNearbyDatas, iImprovementCore, "Plots")
            local iNumCores = #tCorePlots
            print("Num Cores: " .. iNumCores)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SIMULATION_SERVER_DUMMY_2"], iNumCores)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_2"], 0)
        end
        if pCity:IsHasBuilding(iBuildingDistributionHub) then
            local iNumIndustrialSites = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementIndustrialSite)
            --if (pPlayer:GetBuildingClassCount(iBuildingCentralCommandClass) > 0) then
            --    iNumIndustrialSites = iNumIndustrialSites * 2
            --end
            print("Num Industrial Sites: " .. iNumIndustrialSites)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DISTRIBUTION_HUB_DUMMY"], iNumIndustrialSites)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DISTRIBUTION_HUB_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingMetroplexHub) then
            local iNumArcologies = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementArcology)
            --if (pPlayer:GetBuildingClassCount(iBuildingCentralCommandClass) > 0) then
            --    iNumArcologies = iNumArcologies * 2
            --end
            print("Num Arcologies: " .. iNumArcologies)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_METROPLEX_HUB_DUMMY"], iNumArcologies)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_METROPLEX_HUB_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingVerticalFarm) then
            local iNumDomes = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementDome)
            print("Num Domes: " .. iNumDomes)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_VERTICAL_FARM_DUMMY"], iNumDomes)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_VERTICAL_FARM_DUMMY"], 0)
        end
    end
end

EDIT: Started a new game with the same major mods, aside from changing up some civs. This time, it lasted until turn 237, 22 turns longer than the previous attempt. Here is the LUA and Database. The runtime error is the same as before.


LUA: https://pastebin.com/20naAy1w

Database: https://pastebin.com/aS9jhT6r
 
Last edited:
I just paste "AND Description NOT NULL" into both of them, like this, right? I've added the change to line 84 - I only had line 88 before. Sorry about that, I should've paid more attention to the instructions.

Code:
or Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE DestroyedWhenPillaged = 0 AND PillageGold > 0 AND Description NOT NULL") do
    tPillageableImprovements[Improvement.ID] = { Type=Improvement.Type, Description=Locale.ConvertTextKey(Improvement.Description)}
end
--for Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITADEL' AND Type != 'IMPROVEMENT_CITY_RUINS' AND Type != 'IMPROVEMENT_FORT'") do
for Improvement in DB.Query("SELECT ID, Description, Type FROM Improvements WHERE BarbarianCamp = 0 AND Goody = 0 AND PromptWhenComplete = 0 AND Type != 'IMPROVEMENT_CITY_RUINS' AND Description NOT NULL")") do

Nothing else was modified.

EDIT: I must've made the edit wrong, because it's still crashing. Here are the new logs.

LUA: https://pastebin.com/TC5FPzER

Database: https://pastebin.com/T6r5xqNJ

EDIT: The crashes seem to be coming from the futurelua file.

Code:
[1085508.531] Runtime Error: C:\Users\Light\Documents\My Games\Sid Meier's Civilization 5\MODS\Future Worlds (v 6)\Lua/FutureLua.lua:235: attempt to call global 'GetCityMapDatas' (a nil value)

EDIT: Here's the function where the file attempts to call getcitymapdatas.

Code:
function FWBuildingImprovementBonuses(iPlayer)
    local pPlayer = Players[iPlayer]
    local tMyWheatPlotsThisTurn = {}
    for pCity in pPlayer:Cities() do
        local tNearbyDatas = GetCityMapDatas(pCity)
        if pCity:IsHasBuilding(iBuildingGeneLab) then
            local iNumFarms = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementFarm)
            print("Num Farms: " .. iNumFarms)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_GENE_LAB_DUMMY"], iNumFarms)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_GENE_LAB_DUMMY"], 0)
        end
        --if pCity:IsHasBuilding(iBuildingCloneLab) then
        --    local iNumPastures = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementPasture)
        --    pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_CLONE_LAB_DUMMY"], iNumPastures)
        --else
        --    pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_CLONE_LAB_DUMMY"], 0)
        --end
        if pCity:IsHasBuilding(iBuildingSanctuary) then
            local iNumPreserves = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementPreserve)
            print("Num Preserves: " .. iNumPreserves)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SANCTUARY_DUMMY"], iNumPreserves)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SANCTUARY_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingNetworkBackbone) then
            local tCommArrayPlots = GetCityImprovementPlots(tNearbyDatas, iImprovementCommArray, "Plots")
            local iNumCommArrays = #tCommArrayPlots
            print("Num CommArrays: " .. iNumCommArrays)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_NETWORK_BACKBONE_DUMMY_3"], iNumCommArrays)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_NETWORK_BACKBONE_DUMMY_3"], 0)
        end
        if pCity:IsHasBuilding(iBuildingDroneHive) then
            local tGeneratorPlots = GetCityImprovementPlots(tNearbyDatas, iImprovementGenerator, "Plots")
            local iNumGenerators = #tGeneratorPlots
            print("Num Generators: " .. iNumGenerators)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_1"], iNumGenerators)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_1"], 0)
        end
        if pCity:IsHasBuilding(iBuildingSimulationServer) then
            local tCorePlots = GetCityImprovementPlots(tNearbyDatas, iImprovementCore, "Plots")
            local iNumCores = #tCorePlots
            print("Num Cores: " .. iNumCores)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_SIMULATION_SERVER_DUMMY_2"], iNumCores)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DRONE_HIVE_DUMMY_2"], 0)
        end
        if pCity:IsHasBuilding(iBuildingDistributionHub) then
            local iNumIndustrialSites = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementIndustrialSite)
            --if (pPlayer:GetBuildingClassCount(iBuildingCentralCommandClass) > 0) then
            --    iNumIndustrialSites = iNumIndustrialSites * 2
            --end
            print("Num Industrial Sites: " .. iNumIndustrialSites)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DISTRIBUTION_HUB_DUMMY"], iNumIndustrialSites)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_DISTRIBUTION_HUB_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingMetroplexHub) then
            local iNumArcologies = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementArcology)
            --if (pPlayer:GetBuildingClassCount(iBuildingCentralCommandClass) > 0) then
            --    iNumArcologies = iNumArcologies * 2
            --end
            print("Num Arcologies: " .. iNumArcologies)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_METROPLEX_HUB_DUMMY"], iNumArcologies)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_METROPLEX_HUB_DUMMY"], 0)
        end
        if pCity:IsHasBuilding(iBuildingVerticalFarm) then
            local iNumDomes = GetNumCityWorkingImprovementPlots(tNearbyDatas, iImprovementDome)
            print("Num Domes: " .. iNumDomes)
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_VERTICAL_FARM_DUMMY"], iNumDomes)
        else
            pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_FW_VERTICAL_FARM_DUMMY"], 0)
        end
    end
end

EDIT: Started a new game with the same major mods, aside from changing up some civs. This time, it lasted until turn 237, 22 turns longer than the previous attempt. Here is the LUA and Database. The runtime error is the same as before.


LUA: https://pastebin.com/20naAy1w

Database: https://pastebin.com/aS9jhT6r

I have no idea. Anyone please...

But im noticing you are still doing it wrong at line 88
.....AND Description NOT NULL")") do
It should be
.....AND Description NOT NULL") do

And, its nothing to do with futureLua.lua
That thing is doing well. The "getcitymapdatas" is coming from CityNearbyMapDatasV4.lua line 960
 
@Andy0132, you could try using the compatibility patch.
I found multiple compatibility issues between the 3 major eras mods so I made that patch.

Unfortunately a side effect of having additional era mods is balancing. Research speeds, production requirements and the rate at which time passes all need to be fine tuned, however I do not have the time to do so.
But I made it easy for anyone to tune them. If interested, details are here.

Good luck
 
Top Bottom