Sid Meier's Civilization V

Sid Meier's Civilization V

Barbarians Evolved
Moriasa 2016 年 11 月 27 日 下午 7:09
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



< >
正在显示第 1 - 8 条,共 8 条留言
Moriasa 2016 年 11 月 27 日 下午 7:12 
looks like "bBarbMajorAllyExists" doesnt exist in your 'savaData' under whatever circumstances
Moriasa 2016 年 11 月 27 日 下午 7:18 
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?
最后由 Moriasa 编辑于; 2016 年 11 月 27 日 下午 7:19
Moriasa 2016 年 11 月 27 日 下午 7:30 
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
最后由 Moriasa 编辑于; 2016 年 11 月 27 日 下午 7:31
Moriasa 2016 年 11 月 27 日 下午 7:35 
I still love your mod btw
Charsi  [开发者] 2016 年 12 月 2 日 下午 5:41 
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.
最后由 Charsi 编辑于; 2016 年 12 月 2 日 下午 5:46
Moriasa 2016 年 12 月 5 日 下午 2:37 
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  [开发者] 2016 年 12 月 10 日 下午 4:09 
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 2023 年 11 月 28 日 上午 1:03 
引用自 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..
< >
正在显示第 1 - 8 条,共 8 条留言
每页显示数: 1530 50