View Single Post
05/30/14, 03:10 AM   #10
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
Originally Posted by Sharlikran View Post
Lua Code:
  1. Harvest.DataStore_en_auridon_base
  2. Harvest.DataStore.en.auridon.base
Ok I am confused. What is the difference between the two lines. ESO told me I was trying to access a nil value with the line that has the dots in it. Do this dots make Lua think it's a function? The other line works.
The second are table references, the first is a single variable.

Essentially:

Code:
Harvest.DataStore.en.auridon.base
is
Code:
Harvest = {}
Harvest["DataStore"] = {}
Harvest["DataStore"]["en"] = {}
Harvest["DataStore"]["en"]["auridon"] = {}
Harvest["DataStore"]["en"]["auridon"]["base"] = {}
Code:
Harvest.DataStore_en_auridon_base
is
Code:
Harvest = {}
Harvest["DataStore_en_auridon_base"] = {}
You have to create the table before you can add further items to it otherwise you'll get a nil reference.

I suggest you read up on Lua, PiL is a good resource to learn the syntax of Lua
  Reply With Quote