Posted 07 October 2012 - 11:19 AM
Syntax Issues
Lua is still fairly new to me and i was wondering if i could get some syntax help, the lua flexibility can be confusing at times, im used to rigid languages like java
Lua is still fairly new to me and i was wondering if i could get some syntax help, the lua flexibility can be confusing at times, im used to rigid languages like java
displacement = vector.new(0,0,0)
listOfVectors = { a = nil, b = nil, c = nil, d = nil, e = nil}
--- So i have two problems the first is doing something like this
---will produce a syntax error
displacement.x = displacement.x + 1
-- Now that i have written that i think i could solve it with:
displacement[1] = displacement[1] + 1
--But my other issue is
listOfVectors.a = displacement
print(listOfVectors.a:toString())
--This will get mad at me for trying to print nil