"blabla" and 'blabla' is exactly the same thing. "..." and '...' are used to delimit a string. In PHP they are slightly different ("..." lets you insert variables on the fly like : "my max health is $MaxHP"), not sure about Lua but afaik they are stricly the same.
The difference between
DAMAGE_COLOR and
[DAMAGE_COLOR] is that [] are used to define a table index so it's likely that
[DAMAGE_COLOR] = stuff is part of a table, where
DAMAGE_COLOR = stuff is just a variable defined with name
DAMAGE_COLOR
Example without table :
Code:
DAMAGE_COLOR = "red"
HEAL_COLOR = "green"
BUFF_COLOR = "yellow"
Example with table :
Lua Code:
local Colors = {} -- create an empty table
Colors.DAMAGE_COLOR = "red"
Colors.HEAL_COLOR = "green"
Colors.BUFF_COLOR = "yellow"
Or
Lua Code:
local Colors = {} -- create an empty table
Colors["DAMAGE_COLOR"] = "red"
Colors["HEAL_COLOR"] = "green"
Colors["BUFF_COLOR"] = "yellow"
Which is the same thing.
Then you can access your colors with either i.e.
Colors.DAMAGE_COLOR or
Colors["DAMAGE_COLOR"].
Now for [DAMAGE_TYPE_NONE] without quotes this is different because the thing will return you the value with index of the DAMAGE_TYPE_NONE value.
Example :
Lua Code:
local Colors = {"red", "green", "blue"}
local MY_SUPER_INDEX = 2
print(Colors[MY_SUPER_INDEX]) -- "green"
MY_SUPER_INDEX = 4
print(Colors[MY_SUPER_INDEX]) -- nil
To sum up : ".." or '..' is for string. [] is for table indexes. ["MyIndex"] is for value with index "MyIndex" and [MyIndex] is for value with index *content of MyIndex* - if that makes sense
because with [MyIndex] the MyIndex is not considered an index but a variable.
Another silly example :
Lua Code:
local index1 = "color1"
local index2 = "color2"
local index3 = "color3"
local Colors = {[index1] = "red", [index2] = "green", [index3] = "blue"}
print(Colors["color3"]) -- "blue"
print(Colors.color3) -- "blue"
print(Colors.index3) -- nil
About your first question : I think TargetHPBar[1] turns out nil because ZO_TargetUnitFramereticleover IS nil. Did you check for a typo ?
Lua is case-sensitive.