Sid Meier's Civilization V

Sid Meier's Civilization V

Barbarians Evolved
Moriasa 27 Nov, 2016 @ 7:09pm
Next Turn Crash - Runtime Error
Hi.
There is a crash with your mod when i click "next turn" after round 308.
it crashes right afer my turn, so the crash should happen between player 2' turn.

Here is the corresponding excerpt of lua.log (Lines 89 to EndOfFile):
[1887.081] BarbariansEvolved: -------------------- Barbarians Evolved Load Start --------------------
[1887.081] BarbariansEvolved: -- LOADING DEFAULTS FROM FILE --
[1887.081] BarbariansEvolved: Loading settings from file BEsetVanilla...
[1887.081] BarbariansEvolved: BE settings detected: [1]
[1887.081] BarbariansEvolved: -- LOADING SETTINGS FROM SAVE GAME --
[1887.081] BarbariansEvolved: READ: bConservativeMode [0]
[1887.081] BarbariansEvolved: READ: iBaseTurnsPerBarbEvolution [20]
[1887.097] BarbariansEvolved: READ: bDisableBarbHealing [0]
[1887.097] BarbariansEvolved: READ: bDisableBarbSpawn [0]
[1887.097] BarbariansEvolved: READ: bDisableBarbSpawnForAlly [0]
[1887.097] BarbariansEvolved: READ: bDisableBarbSpawnForMe [1]
[1887.097] BarbariansEvolved: READ: bDisableSponsoredSpawns [0]
[1887.097] BarbariansEvolved: READ: iSpawnChance [4]
[1887.097] BarbariansEvolved: READ: bDisableBarbEvolution [0]
[1887.097] BarbariansEvolved: READ: bBarbEvolveSettlers [0]
[1887.097] BarbariansEvolved: READ: bBarbEvolveCityStates [0]
[1887.097] BarbariansEvolved: READ: bDisableBarbCapture [0]
[1887.097] BarbariansEvolved: READ: bRequireMeleeCapture [0]
[1887.097] BarbariansEvolved: READ: bDisableGlobalUpgrade [0]
[1887.097] BarbariansEvolved: READ: bDisableGlobalUpgradeForMe [1]
[1887.097] BarbariansEvolved: READ: sBarbLiberateTo [CIVILIZATION_BARBARIAN]
[1887.097] BarbariansEvolved: READ: bBarbDisperseOnLiberate [1]
[1887.097] BarbariansEvolved: READ: sBarbMajorAlly [CIVILIZATION_BARBARIAN_MAJOR]
[1887.097] Runtime Error: C:\Users\Mile\Documents\My Games\Sid Meier's Civilization 5\MODS\Barbarians Evolved (v 5)\include\BarbariansEvolvedSharedFunctions.lua:96: attempt to concatenate a nil value
stack traceback:
C:\Users\Mile\Documents\My Games\Sid Meier's Civilization 5\MODS\Barbarians Evolved (v 5)\include\BarbariansEvolvedSharedFunctions.lua:96: in function 'BEReportRead'
C:\Users\Mile\Documents\My Games\Sid Meier's Civilization 5\MODS\Barbarians Evolved (v 5)\include\BarbariansEvolvedSharedFunctions.lua:143: in function 'BEReadData'
C:\Users\Mile\Documents\My Games\Sid Meier's Civilization 5\MODS\Barbarians Evolved (v 5)\lua\BarbariansEvolved.lua:2289: in main chunk
=[C]: ?
[1887.097] Runtime Error: Error loading C:\Users\Mile\Documents\My Games\Sid Meier's Civilization 5\MODS\Barbarians Evolved (v 5)\lua\BarbariansEvolved.lua.
[1887.097] WonderRaceDialog: ***[ Wonder Race v6 loaded ]***
[1887.097] WonderRaceDialog: Options: WRNotifyTurnDiff = false, WRNotifyCompetitorID = false, WRNotifyOnDetectWonder = false, WRRepeatLosingNotification = false, WREnableLogging = true, WRDebug = false
[1887.237] AdvisorInfoPopup: Closing Advisor Info
[1887.237] Demographics: Dequeuing demographics
[1887.237] Demographics: Dequeuing demographics
[1892.416] InfoAddictHooks: INFO: Changing InfoAddict button visibility to LeaderHead contexts
[1894.725] WonderRaceDialog: Processing Player 1's turn
[1895.084] WonderRaceDialog: Processing Pedro II's turn




error with concat nil value in this line:
print("READ: " .. datastring .. " [" .. dataobj.GetValue(datastring) .. "]")

maybe you should check for empty values given :o



< >
Showing 1-8 of 8 comments
Moriasa 27 Nov, 2016 @ 7:12pm 
looks like "bBarbMajorAllyExists" doesnt exist in your 'savaData' under whatever circumstances
Moriasa 27 Nov, 2016 @ 7:18pm 
After looking at it further, i guess this happens:
The information "bBarbMajorAllyExists" is not existing in my save, when you ask for it.
So dataobj.getValue(datastring) returns nil.

Could you expand that funtion by asking for the value to be non-empty?
If it is not,
- fill the SaveData with a default value and continue
If it is,
- continue

smt like that?
Last edited by Moriasa; 27 Nov, 2016 @ 7:19pm
Moriasa 27 Nov, 2016 @ 7:30pm 
i "fixed" it for now:

BarbariansEvolvedSharedFunctions.lua - Line 95:

function BEReportRead(dataobj, datastring)
retval = dataobj.GetValue(datastring)
if (retval == nil) then
retval = "-nil-"
end

print("READ: " .. datastring .. " [" .. retval .. "]")


(...)

end


This still produces a nil value, but it prints it now, isntead of crashing:
[3721.528] BarbariansEvolved: READ: bBarbMajorAllyExists [-nil-]



So there is still some issue with "bBarbMajorAllyExists" to be fixed...

Workaround ftw :D
Last edited by Moriasa; 27 Nov, 2016 @ 7:31pm
Moriasa 27 Nov, 2016 @ 7:35pm 
I still love your mod btw
Charsi  [developer] 2 Dec, 2016 @ 5:41pm 
For some reason the value isn't written to the save file so the read comes up nil. Is it an old savegame?

Sorry about the slow reply - it's harder to see new discussion threads at a glance.

I can fix beReportRead to account for nils; I just never expected it to fail. Sloppy coding I guess.
Last edited by Charsi; 2 Dec, 2016 @ 5:46pm
Moriasa 5 Dec, 2016 @ 2:37pm 
I created the savegame a few days ago.

The value wasnt nil the first 300 turns (or it should have crashed), so i think you actually delete the value somehow.
I also experienced a problem with loading saves while currently playing. I havent looked into it, but maybe there is something up with your value-saving.

Sloppy coding Happens to the best. :)
Charsi  [developer] 10 Dec, 2016 @ 4:09pm 
I've got a fix - but it's not really a fix until I get the root cuase. I'll have a poke around the save routine to see if I typo'd something somewhere.
Killer Tamashi 28 Nov, 2023 @ 1:03am 
Originally posted by Moriasa:
i "fixed" it for now:

BarbariansEvolvedSharedFunctions.lua - Line 95:

function BEReportRead(dataobj, datastring)
retval = dataobj.GetValue(datastring)
if (retval == nil) then
retval = "-nil-"
end

print("READ: " .. datastring .. " [" .. retval .. "]")


(...)

end


This still produces a nil value, but it prints it now, isntead of crashing:
[3721.528] BarbariansEvolved: READ: bBarbMajorAllyExists [-nil-]



So there is still some issue with "bBarbMajorAllyExists" to be fixed...

Workaround ftw :D
Shot in the dark but how do I implement this? My game is also crashing after a specific turn of the AI..
< >
Showing 1-8 of 8 comments
Per page: 1530 50