Thalassicus
Bytes and Nibblers
How do I access the XMLschema-turned-sql in Lua? (Or what SQL db statement do I call from Lua to do this?) For example, how do I check what "default" of "AITradeModifier" is set to:
Second question. In languages where false=0 and true=1, a table like this:
someTable = {5, true, 0, -3, false}
Can be looped through like this:
Stuff would be done for elements 1, 2, and 4.
How exactly do I adjust this for lua? Everything I've read about the weird nil system for booleans has just been... weird. I asked my resident Lua expert (brother) but he's only familiar with the Lua implementation in Gary's Mod for HL-2, which is often even weirder. In that version an "if" without a logical expression only checks if a variable exists.
Code:
<GameData>
<!-- Table definition -->
<Table name="Resources">
...
<Column name="AITradeModifier" type="integer" default="0"/>
...
Second question. In languages where false=0 and true=1, a table like this:
someTable = {5, true, 0, -3, false}
Can be looped through like this:
Code:
for someVal in someTable
if someVal
...do stuff...
Stuff would be done for elements 1, 2, and 4.
How exactly do I adjust this for lua? Everything I've read about the weird nil system for booleans has just been... weird. I asked my resident Lua expert (brother) but he's only familiar with the Lua implementation in Gary's Mod for HL-2, which is often even weirder. In that version an "if" without a logical expression only checks if a variable exists.