lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am fairly new to lua.  I have a C++ simulation application I am
working on, that I am using lua to read in and configure the nodes in
the sim.  However, I have hit a snag.  I try to read the following:

Node {
  id = 1,
  name = "test 1",
  position = {
    x = 4.0,
    y = 2.0,
    z = 4000.0
  }
}

Node {
  id = 2,
  name = "test 2",
  position = {
    x = 9.0,
    y = 4.0,
    z = 4000.0
  }
}

...


The problem is when I tell lua to read the file, I get the following
error:

attempt to call global `Node' (a nil value)

I am new enough that I don't know if my file is proper.  I am assuming
that I would need to do something like:

Node = {
...
}

but when I declare another node, I would think this would overwrite
the first instance.

Anyone have any thoughts on the best way to do this kind of
initialization, or is it not possible in lua?

Steve Woolsey