title: How do you access a value of an inside-array by a given key name? (Lua)
body: <p>I'd like to be able to do this</p>
  <pre><code>local aoe_radius = userconfig[chosenconfig].radius --chosenconfig is a variable where value could be &quot;small&quot;,&quot;normal&quot; or &quot;big&quot;
  local aoe_damage = userconfig[chosenconfig].damage
  </code></pre>
  <p>where userconfig array would something like:</p>
  <pre><code>local userconfig = {{name=&quot;small&quot;,radius=&quot;5&quot;,damage=&quot;50&quot;},
  {name=&quot;normal&quot;,radius=&quot;8&quot;,damage=&quot;100&quot;},
  {name=&quot;big&quot;,radius=&quot;15&quot;,damage=&quot;200&quot;}}
  </code></pre>
  <p>How do you access radius and damage of a given &quot;name&quot;?</p>
  <p>I'd like to avoid writing it like this:</p>
  <pre><code>if chosenconfig == &quot;small&quot; then
    local aoe_radius = 5
    local aoe_damage = 50
  elseif chosenconfig == &quot;normal&quot; then
  ...
  end
  </code></pre>
  <p>I'm new in Lua so I welcome redesign of above.
  Thanks.</p>