Page 1 of 1

complicated local defining and making adjustable tables

Posted: 30 Mar 2011, 06:28
by bobthedinosaur
What I am trying to do is get some modoption sliders to adjust categories of units that are somewhat randomly spawned according to their weights. My current method spring dislikes, since my local defining on line 13 with the square brackets is bork. Spring also doen't like using that ugly name definition with the square brackets in the table's since I am trying to modify the tables with a simple name, later on..

Any suggestions from the savvy trick up their sleeve coders?

Re: complicated local defining and making adjustable tables

Posted: 30 Mar 2011, 06:37
by jK
1. use pastebin!
2. list of most obvious lua syntax errors:

remove the outer [] (why did you added them?)

Code: Select all

local crate = [ UnitDefNames['crate'].id ]
note an error still `bad style`

Code: Select all

local gear = {}
gear = {...}
why the "if" at the front?

Code: Select all

if wdef = ( tonumber(Spring.GetModOptions().geardef) or 0 )