Why does ESO tell me I am attempting to index a nil value when I am declaring a constant? Here is a screen shot. Line 275 is a "}" closing or end brace.
Main File is Cosechador.lua and in it I have a COS = {}. The main part of the mod works fine. It is a lite version of Esohead with only Harvest, Fishing, Provisioning, and Chests. It works fine, saves the data, everything is perfect. Then I try to add, with permission, code from HarvestMap and Undiscovered for localization of the Map Names. I am going to import and export data to and from both Esohead and HarvestMap.
I copy the same exact file I am using, without error from HarvestMap to my Mod Cosechador and name it CosechadorLoc.lua. The only thing I changed in it was the prefix.
I didn't have it in an Init function so I added it and that didn't eliminate the error.
Lua Code:
function COS.Initialize()
-- Set Localization
COS.MapNameData ={}
COS.localization ={}
COS.allLocalizations ={}
COS.savedVars ={}
COS.debugDefault =0
COS.dataDefault ={
data ={}
}
COS.name =""
COS.time=0
COS.isHarvesting =false
COS.action =""
end
I do not have to add COS.allLocalizations = {} or COS.localization = {} to HarvestMap as Harvest.{{array}} = {}. What is also weird is, as you will notice, I have some of the commented out in the Cosechador.txt file for testing. All I did was copy the same localization folder from HarvestMap to my mod and change the prefix. All 6 files work with HarvestMap without throwing that error.
In one of the other files named CosechadorData-de.lua it errors on this line
Lua Code:
if COS.MapNameData ==nilthen COS.MapNameData ={}end
In HarvestMap I have that same line like this, and it does not error.
Lua Code:
if Harvest.MapNameData ==nilthen Harvest.MapNameData ={}end
Nevermind I'm an idiot. I have to put the files in this order.
Main File is Cosechador.lua and in it I have a COS = {}.
If I understand correctly, you create global table COS in "Localization/CosechadorLoc.lua" (first file in manifest) and then you overwrite it in "Cosechador.lua". I think that is the reason why COS.allLocalizations does not exist.
Just remove COS = {} from the "Cosechador.lua" and it should work.
If I understand correctly, you create global table COS in "Localization/CosechadorLoc.lua" (first file in manifest) and then you overwrite it in "Cosechador.lua". I think that is the reason why COS.allLocalizations does not exist.
Just remove COS = {} from the "Cosechador.lua" and it should work.
I changed my post. It was the order in which I had the files listed in the Manefest file. I was wondering what the txt file was called. A Manefest file, got it.