Skip to content

Instantly share code, notes, and snippets.

Turning out data tricks since 2006! thistleknot

Block or report user

Report or block thistleknot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View temp.lua
TraitArrayBins = {}
TraitArrayBins.__index = TraitArrayBins
function TraitArrayBins.create(name, traitMin, traitMed, traitMax)
local trait = {}
setmetatable(trait,TraitArrayBins)
trait.name = name
trait.traitMin = traitMin
View temp.lua
-- Bugs
-- --------------------------------------------------------------------------
-- Classes
TraitArrayBins = defclass(TraitArrayBins)
TraitArrayBins.ATTR = {
name = "",
traitMin = 0,
traitMed = 0,
traitMax = 0
View gist:6153673
-- Bugs
-- --------------------------------------------------------------------------
-- Functions
function boostAttributes(selectedUnitCaste, unit)
--[[ these were not easy to get, see code...
df.physical_attribute_type
0 STRENGTH
1 AGILITY
View gist:6152724
-- Bugs
--[[
...rk\MasterworkDF v3e\Dwarf Fortress\hack\scripts/test.lua:199: Cannot read fie
ld unit_attribute[].6: index out of bounds.
stack traceback:
[C]: in function '__index'
...rk\MasterworkDF v3e\Dwarf Fortress\hack\scripts/test.lua:199: in func
tion 'boostValue'
...rk\MasterworkDF v3e\Dwarf Fortress\hack\scripts/test.lua:61: in funct
View gist:6146236
unit = dfhack.gui.getSelectedUnit()
PlusPlus = {700, 1200, 1400, 1500, 1600, 1800, 2500}
Plus = {450, 950, 1150, 1250, 1350, 1550, 2250}
Normal = {200, 700, 900, 1000, 1100, 1300, 2000}
Minus = {150, 600, 800, 900, 1000, 1100, 1500}
Mental_Attribute_Names = {
Mental_PlusPlus = {"FOCUS", "SPATIAL_SENSE"},
Mental_Plus = {"ANALYTICAL_ABILITY", "FOCUS", "CREATIVITY", "PATIENCE", "MEMORY"},
View gist:6146077
unit = dfhack.gui.getSelectedUnit()
PlusPlus = {700, 1200, 1400, 1500, 1600, 1800, 2500}
Plus = {450, 950, 1150, 1250, 1350, 1550, 2250}
Normal = {200, 700, 900, 1000, 1100, 1300, 2000}
Minus = {150, 600, 800, 900, 1000, 1100, 1500}
PhysicalPlus = {"STRENGTH", "TOUGHNESS", "ANALYTICAL_ABILITY", "FOCUS", "CREATIVITY", "PATIENCE", "MEMORY"}
You can’t perform that action at this time.