Sub-Sub-Sub table question

Is this at all possible (the bit in the stars):

local style = “projector”
local class = “barrel”
local name = “High Expansive Gas”
local properties = {}
properties.property1 = “lolz”
properties.property2 = “lolz2”
properties.property3 = “lolz3”
properties.property4 = “lolz4”

*bigtable[style][class][name] = properties

and so would it then be possible to:

MsgN(bigtable.projector.barrel[“High Expansive Gas”].property1)

Yup. :clint:

Yes :science:

I have a problem:

“autorun/Warhead_Explosive.lua:18: attempt to index field ‘?’ (a nil value)”

Code is:

if GCOMBATII and gcb2addons then
local style = “projector”
local class = “warhead”
local name = “High Explosive”
local weptable = {}
weptable.effect = “effect name here”
local damagetype = {}
damagetype.func = gcb2.ExplosiveDamage
damagetype.damage = 300
damagetype.radius = 150
damagetype.angle = 360
damagetype.block = true
damagetype.pierce = 1

    weptable.hit = damagetype

gcb2addons[style][class][name] = weptable --------LINE 18 - ERROR WITH THIS CODE!! ---------

end

make sure that both gcb2addons[style] and gcb2addons[style][class] are tables before doing that.

ahhhh…
so add

if !gcb2addons[style] then
gcb2addons[style] = {}
end
if !gcb2addons[style][class] then
gcb2addons[style][class] = {}
end

yes

Coolio