Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - SeelenJägerTee

Pages: [1] 2 3 ... 7
1
I have noticed that legendary dwarfes can't build display furniture in carpenter's workshop.
After digging into the files I've noticed you've missed the [PERMITTED_REACTION:MAKE WOODEN DISPLAY CASE] token.
I believe the same is true for pedestals but I've not done an extensive search for what is missing and what should (probably) be there.

I've also got some gameplay questions.
What is the toy factory good for? Has it any hard benefit or does it just produce trading items?
Also rock armour. Should I use it or is it better to stick with metal armour?
I think it would be nice if on the introduction post there was some info on the new content and how it works ingame so that new players aren's stumbling around in the dark.
It's a little bit overwhelming (perhaps only if one hasn'f followed development) but there is a lot of stuff so it feels hard for a new player to make right choices.

2
DF Gameplay Questions / Aquatic Invaders
« on: October 19, 2019, 04:14:38 am »
How does swimming work on invaders?
Can invaders dive? Let's assume I have a "floating" wall on top of a lake. Can and will swimming invaders choose to dive under it.

I used to wall off portions of the map to have safe access to wood and grazing fields.
Now that invaders can climb constructed walls, there is of course only one option remaining: casting my perimeter wall out of obsidian and smoothing it.
My current embark site is located on a lake. This raises a totally new problem: how far into the lake do I need to build the wall?
When an invader decides to swim around the wall. Is his capability to swim binary or gradual? What I mean is, will a swimmer get tired after a certain amount of tiles swum and start to drown? If so what are reasonably distances for swimmers to cover.

3
I'm using linux LNP and modest mod.
I hate it when my dwarfen civ has decided that breastplates or helmets are optional,
so I changed the corresponding lines in entity_default for the dwarfen civ.
   [ARMOR:ITEM_ARMOR_BREASTPLATE:FORCED]
   [ARMOR:ITEM_ARMOR_MAIL_SHIRT:FORCED]
   [ARMOR:ITEM_ARMOR_LEATHER:FORCED]
   ...
   [HELM:ITEM_HELM_HELM:FORCED]
   ...
   [GLOVES:ITEM_GLOVES_GAUNTLETS:FORCED]
   ...
   [SHOES:ITEM_SHOES_BOOTS:FORCED]
   ...
   [PANTS:ITEM_PANTS_GREAVES:FORCED]
Somehow this makes it, that all grass types change to a generic grass that can no longer feed my grazers.
Any explanations?
Did I do something wrong?
I've been away from DF for some time now, but I am pretty much sure that I did exactly this change in the past and it has been working fine previously.

4
Pretty sure Lua iterates from 1.
It does.
Nonetheless
Code: [Select]
theUnit.body.physical_attrs[1].value,should be Strength, because strength in DF is ...physical_attrs[0]. DF is written in C++ so it iterates from 0, however I'm using lua right now so I have to use ...physical_attrs[1] to access strength.
Well it isn't ...physical_attrs[1] in the lua script accesses AGILITY which is ...physical_attrs[0] in DFs C++.
This surprised me totally.

5
Ah, thanks for sharing that info.
So at embark screen it is populated only by 7 entries, that I could iterate over with ...active[0] to ...active[6]?

6
It is done. Yay I'm M45ta scriptkiddy5000 !!!!!111!!einself
*clears throat*
Sorry I got a little carried away with this.

I dug into lua and it is now done.
Sort of at least.
While I wanted to be able to run this script on the embark screen and save/load all 7 dwarfs I couldn't figure out how to access them.
Now you have to select the dwarves after embark and call the script on every one of them separately.

Right now the script copies. Attributes (mental and body) and traits. It does NOT copy values, gender, preferences, body-size ...

Also I don't really get how the cultural values work. As the vector only has very few entries compared to existing values. If someone has insight into this please enlighten me.

Usage is explained by running
copyDwarf info
in the DFhack console.

copyDwarf.lua
Code: [Select]
-- By SeelenJägerTee
-- Published under the MIT License (http://opensource.org/licenses/MIT)

-- THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- BY USING THE CODE YOU IMPLICITLY STATE, THAT YOU HAVE SEEN AND UNDERSTOOD
-- THE CODE AND HAVE CORRECTED ANY ERRORS IT MAY CONTAIN.

local sepTab = false -- change separator between "\t" and "\t = " -- sepTab = true currently broken, no clue why
local theUnit=dfhack.gui.getSelectedUnit()
local params = {...}

local i = "default"
i = params[2]

if theUnit == nil then
print("error no unit selected")
return;
end

--ENUMS
local STRENGTH = 0
local AGILITY = 1
local TOUGHNESS = 2
local ENDURANCE = 3
local RECUPERATION = 4
local DISEASE_RESISTANCE = 5

local ANALYTICAL_ABILITY = 0
local FOCUS = 1
local WILLPOWER = 2
local CREATIVITY = 3
local INTUITION = 4
local PATIENCE = 5
local MEMORY = 6
local LINGUISTIC_ABILITY = 7
local SPATIAL_SENSE = 8
local MUSICALITY = 9
local KINESTHETIC_SENSE  = 10
local EMPATHY = 11
local SOCIAL_AWARENESS = 12

local LOVE_PROPENSITY = 0
local HATE_PROPENSITY = 1
local ENVY_PROPENSITY = 2
local CHEER_PROPENSITY = 3
local DEPRESSION_PROPENSITY = 4
local ANGER_PROPENSITY = 5
local ANXIETY_PROPENSITY = 6
local LUST_PROPENSITY = 7
local STRESS_VULNERABILITY = 8
local GREED = 9
local IMMODERATION = 10
local VIOLENT = 11
local PERSEVERENCE = 12
local WASTEFULNESS = 13
local DISCORD = 14
local FRIENDLINESS = 15
local POLITENESS = 16
local DISDAIN_ADVICE = 17
local BRAVERY = 18
local CONFIDENCE = 19
local VANITY = 20
local AMBITION = 21
local GRATITUDE = 22
local IMMODESTY = 23
local HUMOR = 24
local VENGEFUL = 25
local PRIDE = 26
local CRUELTY = 27
local SINGLEMINDED = 28
local HOPEFUL = 29
local CURIOUS = 30
local BASHFUL = 31
local PRIVACY = 32
local PERFECTIONIST = 33
local CLOSEMINDED = 34
local TOLERANT = 35
local EMOTIONALLY_OBSESSIVE = 36
local SWAYED_BY_EMOTIONS = 37
local ALTRUISM = 38
local DUTIFULNESS = 39
local THOUGHTLESSNESS = 40
local ORDERLINESS = 41
local TRUST = 42
local GREGARIOUSNESS = 43
local ASSERTIVENESS = 44
local ACTIVITY_LEVEL = 45
local EXCITEMENT_SEEKING = 46
local IMAGINATION = 47
local ABSTRACT_INCLINED = 48
local ART_INCLINED = 49




function SaveToFile()
local file = io.open("hack\\scripts\\SavedDwarves\\SavedDwarves_"..i..".txt", "w")

local table = { --["caste"..i] = theUnit.caste, -- I disabled sex and caste, as some descriptions are not updated properly.
--["sex"..i] = theUnit.sex, -- I have no clue what else doesn't get updated. Want to avoid pregnant males and such things.
["strength"..i] = theUnit.body.physical_attrs[STRENGTH].value,
["agility"..i] = theUnit.body.physical_attrs[AGILITY].value,
["toughness"..i] = theUnit.body.physical_attrs[TOUGHNESS].value,
["endurance"..i] = theUnit.body.physical_attrs[ENDURANCE].value,
["recuperation"..i] = theUnit.body.physical_attrs[RECUPERATION].value,
["disease_resistance"..i] = theUnit.body.physical_attrs[DISEASE_RESISTANCE].value,

["max_strength"..i] = theUnit.body.physical_attrs[STRENGTH].max_value,
["max_agility"..i] = theUnit.body.physical_attrs[AGILITY].max_value,
["max_toughness"..i] = theUnit.body.physical_attrs[TOUGHNESS].max_value,
["max_endurance"..i] = theUnit.body.physical_attrs[ENDURANCE].max_value,
["max_recuperation"..i] = theUnit.body.physical_attrs[RECUPERATION].max_value,
["max_disease_resist"..i] = theUnit.body.physical_attrs[DISEASE_RESISTANCE].max_value,

["analytical_ability"..i] = theUnit.status.current_soul.mental_attrs[ANALYTICAL_ABILITY].value,
["focus"..i] = theUnit.status.current_soul.mental_attrs[FOCUS].value,
["willpower"..i] = theUnit.status.current_soul.mental_attrs[WILLPOWER].value,
["creativity"..i] = theUnit.status.current_soul.mental_attrs[CREATIVITY].value,
["intuition"..i] = theUnit.status.current_soul.mental_attrs[INTUITION].value,
["patience"..i] = theUnit.status.current_soul.mental_attrs[PATIENCE].value,
["memory"..i] = theUnit.status.current_soul.mental_attrs[MEMORY].value,
["linguisitc_ability"..i] = theUnit.status.current_soul.mental_attrs[LINGUISTIC_ABILITY].value,
["spatial_sense"..i] = theUnit.status.current_soul.mental_attrs[SPATIAL_SENSE].value,
["musicality"..i] = theUnit.status.current_soul.mental_attrs[MUSICALITY].value,
["kinesthetic_sense" ..i] = theUnit.status.current_soul.mental_attrs[KINESTHETIC_SENSE].value,
["empathy"..i] = theUnit.status.current_soul.mental_attrs[EMPATHY].value,
["social_awareness"..i] = theUnit.status.current_soul.mental_attrs[SOCIAL_AWARENESS].value,

["max_analytical_ability"..i] = theUnit.status.current_soul.mental_attrs[ANALYTICAL_ABILITY].max_value,
["max_focus"..i] = theUnit.status.current_soul.mental_attrs[FOCUS].max_value,
["max_willpower"..i] = theUnit.status.current_soul.mental_attrs[WILLPOWER].max_value,
["max_creativity"..i] = theUnit.status.current_soul.mental_attrs[CREATIVITY].max_value,
["max_intuition"..i] = theUnit.status.current_soul.mental_attrs[INTUITION].max_value,
["max_patience"..i] = theUnit.status.current_soul.mental_attrs[PATIENCE].max_value,
["max_memory"..i] = theUnit.status.current_soul.mental_attrs[MEMORY].max_value,
["max_linguisitc_ability"..i] = theUnit.status.current_soul.mental_attrs[LINGUISTIC_ABILITY].max_value,
["max_spatial_sense"..i] = theUnit.status.current_soul.mental_attrs[SPATIAL_SENSE].max_value,
["max_musicality"..i] = theUnit.status.current_soul.mental_attrs[MUSICALITY].max_value,
["max_kinesthetic_sense" ..i] = theUnit.status.current_soul.mental_attrs[KINESTHETIC_SENSE].max_value,
["max_empathy"..i] = theUnit.status.current_soul.mental_attrs[EMPATHY].max_value,
["max_social_awareness"..i] = theUnit.status.current_soul.mental_attrs[SOCIAL_AWARENESS].max_value,

["LOVE_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[LOVE_PROPENSITY],
["HATE_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[HATE_PROPENSITY],
["ENVY_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[ENVY_PROPENSITY],
["CHEER_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[CHEER_PROPENSITY],
["DEPRESSION_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[DEPRESSION_PROPENSITY ],
["ANGER_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[ANGER_PROPENSITY],
["ANXIETY_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[ANXIETY_PROPENSITY],
["LUST_PROPENSITY"..i] = theUnit.status.current_soul.personality.traits[LUST_PROPENSITY],
["STRESS_VULNERABILITY"..i] = theUnit.status.current_soul.personality.traits[STRESS_VULNERABILITY],
["GREED"..i] = theUnit.status.current_soul.personality.traits[GREED],
["IMMODERATION"..i] = theUnit.status.current_soul.personality.traits[IMMODERATION],
["VIOLENT"..i] = theUnit.status.current_soul.personality.traits[VIOLENT],
["PERSEVERENCE"..i] = theUnit.status.current_soul.personality.traits[PERSEVERENCE],
["WASTEFULNESS"..i] = theUnit.status.current_soul.personality.traits[WASTEFULNESS],
["DISCORD"..i] = theUnit.status.current_soul.personality.traits[DISCORD],
["FRIENDLINESS"..i] = theUnit.status.current_soul.personality.traits[FRIENDLINESS],
["POLITENESS"..i] = theUnit.status.current_soul.personality.traits[POLITENESS],
["DISDAIN_ADVICE"..i] = theUnit.status.current_soul.personality.traits[DISDAIN_ADVICE],
["BRAVERY"..i] = theUnit.status.current_soul.personality.traits[BRAVERY],
["CONFIDENCE"..i] = theUnit.status.current_soul.personality.traits[CONFIDENCE],
["VANITY"..i] = theUnit.status.current_soul.personality.traits[VANITY],
["AMBITION"..i] = theUnit.status.current_soul.personality.traits[AMBITION],
["GRATITUDE"..i] = theUnit.status.current_soul.personality.traits[GRATITUDE],
["IMMODESTY"..i] = theUnit.status.current_soul.personality.traits[IMMODESTY],
["HUMOR"..i] = theUnit.status.current_soul.personality.traits[HUMOR],
["VENGEFUL"..i] = theUnit.status.current_soul.personality.traits[VENGEFUL],
["PRIDE"..i] = theUnit.status.current_soul.personality.traits[PRIDE],
["CRUELTY"..i] = theUnit.status.current_soul.personality.traits[CRUELTY],
["SINGLEMINDED"..i] = theUnit.status.current_soul.personality.traits[SINGLEMINDED],
["HOPEFUL"..i] = theUnit.status.current_soul.personality.traits[HOPEFUL],
["CURIOUS"..i] = theUnit.status.current_soul.personality.traits[CURIOUS],
["BASHFUL"..i] = theUnit.status.current_soul.personality.traits[BASHFUL],
["PRIVACY"..i] = theUnit.status.current_soul.personality.traits[PRIVACY],
["PERFECTIONIST"..i] = theUnit.status.current_soul.personality.traits[PERFECTIONIST],
["CLOSEMINDED"..i] = theUnit.status.current_soul.personality.traits[CLOSEMINDED],
["TOLERANT"..i] = theUnit.status.current_soul.personality.traits[TOLERANT],
["EMOTIONALLY_OBSESSIVE"..i] = theUnit.status.current_soul.personality.traits[EMOTIONALLY_OBSESSIVE],
["SWAYED_BY_EMOTIONS"..i] = theUnit.status.current_soul.personality.traits[SWAYED_BY_EMOTIONS],
["ALTRUISM"..i] = theUnit.status.current_soul.personality.traits[ALTRUISM],
["DUTIFULNESS"..i] = theUnit.status.current_soul.personality.traits[DUTIFULNESS],
["THOUGHTLESSNESS"..i] = theUnit.status.current_soul.personality.traits[THOUGHTLESSNESS],
["ORDERLINESS"..i] = theUnit.status.current_soul.personality.traits[ORDERLINESS],
["TRUST"..i] = theUnit.status.current_soul.personality.traits[TRUST],
["GREGARIOUSNESS"..i] = theUnit.status.current_soul.personality.traits[GREGARIOUSNESS],
["ASSERTIVENESS"..i] = theUnit.status.current_soul.personality.traits[ASSERTIVENESS],
["ACTIVITY_LEVEL"..i] = theUnit.status.current_soul.personality.traits[ACTIVITY_LEVEL],
["EXCITEMENT_SEEKING"..i] = theUnit.status.current_soul.personality.traits[EXCITEMENT_SEEKING],
["IMAGINATION"..i] = theUnit.status.current_soul.personality.traits[IMAGINATION],
["ABSTRACT_INCLINED"..i] = theUnit.status.current_soul.personality.traits[ABSTRACT_INCLINED],
["ART_INCLINED"..i] = theUnit.status.current_soul.personality.traits[ART_INCLINED]

      }

for key,value in pairs(table) do print(key,value) end -- print out the table in console for control reasons

for key, value in pairs(table) do
if sepTab == true then
file:write(key.."\t"..value.."\n")
else
file:write(key.."\t= "..value.."\n")
end
end

file:close()
end

function ReadFromFile()
local readfile = assert(io.open("hack\\scripts\\SavedDwarves\\SavedDwarves_"..i..".txt", "r")) -- crash script with assertion if file not found

local buftable = {} -- buffer table, which gets filled with loaded data
while true do
local line = readfile:read("*line")
if line == nil then
break
end
if sepTab == true then
local key, value = line:match('([%w_]+)%s+(.*)')
else
local key, value = line:match('([%w_]+)%s*=%s*(.*)')

buftable[key] = value
readfile.close() -- file can be closed here as scipt crashed if not open
end
end

print("\n\n")
for key,value in pairs(buftable) do print(key,value) end -- print out the table in console for control reasons

-- theUnit.caste = buftable["caste"..i] -- as noted under the write function disabled
-- theUnit.sex = buftable["sex"..i] -- due to unknown behaviour
theUnit.body.physical_attrs[STRENGTH].value = buftable["strength"..i]
theUnit.body.physical_attrs[AGILITY].value = buftable["agility"..i]
theUnit.body.physical_attrs[TOUGHNESS].value = buftable["toughness"..i]
theUnit.body.physical_attrs[ENDURANCE].value = buftable["endurance"..i]
theUnit.body.physical_attrs[RECUPERATION].value = buftable["recuperation"..i]
theUnit.body.physical_attrs[DISEASE_RESISTANCE].value = buftable["disease_resistance"..i]

theUnit.body.physical_attrs[STRENGTH].max_value = buftable["max_strength"..i]
theUnit.body.physical_attrs[AGILITY].max_value = buftable["max_agility"..i]
theUnit.body.physical_attrs[TOUGHNESS].max_value = buftable["max_toughness"..i]
theUnit.body.physical_attrs[ENDURANCE].max_value = buftable["max_endurance"..i]
theUnit.body.physical_attrs[RECUPERATION].max_value = buftable["max_recuperation"..i]
theUnit.body.physical_attrs[DISEASE_RESISTANCE].max_value = buftable["max_disease_resist"..i]

theUnit.status.current_soul.mental_attrs[ANALYTICAL_ABILITY].value = buftable["analytical_ability"..i]
theUnit.status.current_soul.mental_attrs[FOCUS].value = buftable["focus"..i]
theUnit.status.current_soul.mental_attrs[WILLPOWER].value = buftable["willpower"..i]
theUnit.status.current_soul.mental_attrs[CREATIVITY].value = buftable["creativity"..i]
theUnit.status.current_soul.mental_attrs[INTUITION].value = buftable["intuition"..i]
theUnit.status.current_soul.mental_attrs[PATIENCE].value = buftable["patience"..i]
theUnit.status.current_soul.mental_attrs[MEMORY].value = buftable["memory"..i]
theUnit.status.current_soul.mental_attrs[LINGUISTIC_ABILITY].value = buftable["linguisitc_ability"..i]
theUnit.status.current_soul.mental_attrs[SPATIAL_SENSE].value = buftable["spatial_sense"..i]
theUnit.status.current_soul.mental_attrs[MUSICALITY].value = buftable["musicality"..i]
theUnit.status.current_soul.mental_attrs[KINESTHETIC_SENSE].value = buftable["kinesthetic_sense" ..i]
theUnit.status.current_soul.mental_attrs[EMPATHY].value = buftable["empathy"..i]
theUnit.status.current_soul.mental_attrs[SOCIAL_AWARENESS].value = buftable["social_awareness"..i]

theUnit.status.current_soul.mental_attrs[ANALYTICAL_ABILITY].max_value = buftable["max_analytical_ability"..i]
theUnit.status.current_soul.mental_attrs[FOCUS].max_value = buftable["max_focus"..i]
theUnit.status.current_soul.mental_attrs[WILLPOWER].max_value = buftable["max_willpower"..i]
theUnit.status.current_soul.mental_attrs[CREATIVITY].max_value = buftable["max_creativity"..i]
theUnit.status.current_soul.mental_attrs[INTUITION].max_value = buftable["max_intuition"..i]
theUnit.status.current_soul.mental_attrs[PATIENCE].max_value = buftable["max_patience"..i]
theUnit.status.current_soul.mental_attrs[MEMORY].max_value = buftable["max_memory"..i]
theUnit.status.current_soul.mental_attrs[LINGUISTIC_ABILITY].max_value = buftable["max_linguisitc_ability"..i]
theUnit.status.current_soul.mental_attrs[SPATIAL_SENSE].max_value = buftable["max_spatial_sense"..i]
theUnit.status.current_soul.mental_attrs[MUSICALITY].max_value = buftable["max_musicality"..i]
theUnit.status.current_soul.mental_attrs[KINESTHETIC_SENSE].max_value = buftable["max_kinesthetic_sense" ..i]
theUnit.status.current_soul.mental_attrs[EMPATHY].max_value = buftable["max_empathy"..i]
theUnit.status.current_soul.mental_attrs[SOCIAL_AWARENESS].max_value = buftable["max_social_awareness"..i]

theUnit.status.current_soul.personality.traits[LOVE_PROPENSITY] = buftable["LOVE_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[HATE_PROPENSITY] = buftable["HATE_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[ENVY_PROPENSITY] = buftable["ENVY_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[CHEER_PROPENSITY] = buftable["CHEER_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[DEPRESSION_PROPENSITY] = buftable["DEPRESSION_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[ANGER_PROPENSITY] = buftable["ANGER_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[ANXIETY_PROPENSITY] = buftable["ANXIETY_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[LUST_PROPENSITY] = buftable["LUST_PROPENSITY"..i]
theUnit.status.current_soul.personality.traits[STRESS_VULNERABILITY] = buftable["STRESS_VULNERABILITY"..i]
theUnit.status.current_soul.personality.traits[GREED] = buftable["GREED"..i]
theUnit.status.current_soul.personality.traits[IMMODERATION] = buftable["IMMODERATION"..i]
theUnit.status.current_soul.personality.traits[VIOLENT] = buftable["VIOLENT"..i]
theUnit.status.current_soul.personality.traits[PERSEVERENCE] = buftable["PERSEVERENCE"..i]
theUnit.status.current_soul.personality.traits[WASTEFULNESS] = buftable["WASTEFULNESS"..i]
theUnit.status.current_soul.personality.traits[DISCORD] = buftable["DISCORD"..i]
theUnit.status.current_soul.personality.traits[FRIENDLINESS] = buftable["FRIENDLINESS"..i]
theUnit.status.current_soul.personality.traits[POLITENESS] = buftable["POLITENESS"..i]
theUnit.status.current_soul.personality.traits[DISDAIN_ADVICE] = buftable["DISDAIN_ADVICE"..i]
theUnit.status.current_soul.personality.traits[BRAVERY] = buftable["BRAVERY"..i]
theUnit.status.current_soul.personality.traits[CONFIDENCE] = buftable["CONFIDENCE"..i]
theUnit.status.current_soul.personality.traits[VANITY] = buftable["VANITY"..i]
theUnit.status.current_soul.personality.traits[AMBITION] = buftable["AMBITION"..i]
theUnit.status.current_soul.personality.traits[GRATITUDE] = buftable["GRATITUDE"..i]
theUnit.status.current_soul.personality.traits[IMMODESTY] = buftable["IMMODESTY"..i]
theUnit.status.current_soul.personality.traits[HUMOR] = buftable["HUMOR"..i]
theUnit.status.current_soul.personality.traits[VENGEFUL] = buftable["VENGEFUL"..i]
theUnit.status.current_soul.personality.traits[PRIDE] = buftable["PRIDE"..i]
theUnit.status.current_soul.personality.traits[CRUELTY] = buftable["CRUELTY"..i]
theUnit.status.current_soul.personality.traits[SINGLEMINDED] = buftable["SINGLEMINDED"..i]
theUnit.status.current_soul.personality.traits[HOPEFUL] = buftable["HOPEFUL"..i]
theUnit.status.current_soul.personality.traits[CURIOUS] = buftable["CURIOUS"..i]
theUnit.status.current_soul.personality.traits[BASHFUL] = buftable["BASHFUL"..i]
theUnit.status.current_soul.personality.traits[PRIVACY] = buftable["PRIVACY"..i]
theUnit.status.current_soul.personality.traits[PERFECTIONIST] = buftable["PERFECTIONIST"..i]
theUnit.status.current_soul.personality.traits[CLOSEMINDED] = buftable["CLOSEMINDED"..i]
theUnit.status.current_soul.personality.traits[TOLERANT] = buftable["TOLERANT"..i]
theUnit.status.current_soul.personality.traits[EMOTIONALLY_OBSESSIVE] = buftable["EMOTIONALLY_OBSESSIVE"..i]
theUnit.status.current_soul.personality.traits[SWAYED_BY_EMOTIONS] = buftable["SWAYED_BY_EMOTIONS"..i]
theUnit.status.current_soul.personality.traits[ALTRUISM] = buftable["ALTRUISM"..i]
theUnit.status.current_soul.personality.traits[DUTIFULNESS] = buftable["DUTIFULNESS"..i]
theUnit.status.current_soul.personality.traits[THOUGHTLESSNESS] = buftable["THOUGHTLESSNESS"..i]
theUnit.status.current_soul.personality.traits[ORDERLINESS] = buftable["ORDERLINESS"..i]
theUnit.status.current_soul.personality.traits[TRUST] = buftable["TRUST"..i]
theUnit.status.current_soul.personality.traits[GREGARIOUSNESS] = buftable["GREGARIOUSNESS"..i]
theUnit.status.current_soul.personality.traits[ASSERTIVENESS] = buftable["ASSERTIVENESS"..i]
theUnit.status.current_soul.personality.traits[ACTIVITY_LEVEL] = buftable["ACTIVITY_LEVEL"..i]
theUnit.status.current_soul.personality.traits[EXCITEMENT_SEEKING] = buftable["EXCITEMENT_SEEKING"..i]
theUnit.status.current_soul.personality.traits[IMAGINATION] = buftable["IMAGINATION"..i]
theUnit.status.current_soul.personality.traits[ABSTRACT_INCLINED] = buftable["ABSTRACT_INCLINED"..i]
theUnit.status.current_soul.personality.traits[ART_INCLINED] = buftable["ART_INCLINED"..i]


end


if params[1] == "save" then
SaveToFile()
elseif params[1] == "load" then
ReadFromFile()
elseif params[1] == "info" then
print("This script can be used to save dwarves and to load them later on. As of writing this line it can save and restore the attributes and traits of a dwarf. The script takes 2 parameters. The first parameter can be save or load or info. The second parameter is an identifier for the savefile and can be omitted when the first parameter is info. Typing copyDwarf save foo will save the currently selected dwarf in SavedDwarves_foo.txt. copyDwarf load bar5 will impose the values saved in SavedDwarves_bar5.txt onto the currently selected dwarf.")
else
print("For info on the script call it with copyDwarf info.\nTo use script call it with copyDwarf param1 param2. param1 needs to be save load or info. param2 is identifier of save-file.\nMAKE SURE YOU UNDERSTAND THIS SCRIPT BEFORE USING.")
end

7
DF General Discussion / Re: New Dwarven Daycare idea: Flight School
« on: August 19, 2014, 11:39:51 am »
I'm pretty sure that changing the raws after the world has been generated causes problems.
[FLIER]s who are part of your civ spend all of their time hovering along the ground.
Do drawbridges send things vertically?
Depends on what you change.
E.g. adding a child tag to a creature was possible in earlier versions.
I've often done this if I acquired a breeding pair of an awesome creature, that was ... well unable to breed due to a missing child token.
These days you don't need it anymore as toady enabled reproduction for creatures without child tokens.

8
DF Gameplay Questions / Re: Kill Thieves
« on: August 19, 2014, 11:33:19 am »
Someone once had a setup that relied on having magma ABOVE a door.
Lock door. Build floor grates in front and behind door, that lead to a drainage.

Thief can lock doors, he will take the shorter route through the door. When door opens magma falls on his head.

9
DF Gameplay Questions / Re: Temporary water trap
« on: August 19, 2014, 11:29:40 am »
Just pump the water out from above through a floor grate.
As long as the building destroyer can't path to the floor grate he can't destroy/deconstruct it.

10
DF Gameplay Questions / Re: How to prevent Civil War (40.08)
« on: August 18, 2014, 06:42:55 am »
You experienced what is called a tantrum spiral. It is working mostly as intended and is one of the most common ways for fortresses to die. Essentially it starts out with some dwarf getting really unhappy (whether for a legitimate reason or not) and then doing something that makes another dwarf very unhappy. From there it cascades with exponential growth of unhappiness.
Very unlikely. You usually don't get a tantrum spiral from ONE dead dwarf.
The description of ordering the militia to kill the berserk dwarf and civil war afterwards sounds much more like a loyalty cascade.
This doesn't mean that the loyalty cascade has a superimposed tantrums spiral on top of it due to the many deaths in the course of civil war.

Just a heads-up - there's a chance the surviving dwarves (and animals) could end up fighting any new migrants.
To avoid this draft any surviving dwarfs into the militia and station them somewhere (use burrows to get them somewhere) then wall them in.
Either let them create a secondary fortress or die off when new migrants have arrived.
That way you will have lost all of your original fortress, but at least the fortress lives on.

11
DF Gameplay Questions / Re: How to prevent Civil War (40.08)
« on: August 18, 2014, 06:41:38 am »
You experienced what is called a tantrum spiral. It is working mostly as intended and is one of the most common ways for fortresses to die. Essentially it starts out with some dwarf getting really unhappy (whether for a legitimate reason or not) and then doing something that makes another dwarf very unhappy. From there it cascades with exponential growth of unhappiness.
Very unlikely. You usually don't get a tantrum spiral from ONE dead dwarf.
The description of ordering the militia to kill the berserk dwarf and civil war after wards sounds much more like a loyalty cascade.
This doesn't mean that the loyalty cascade has a superimposed tantrums spiral on top of it due to the many deaths in the course of civil war.

Just a heads-up - there's a chance the surviving dwarves (and animals) could end up fighting any new migrants.
To avoid this draft any surviving dwarfs into the militia and station them somewhere (use burrows to get them somewhere) then wall them in.
Either let them create a secondary fortress or die off when new migrants have arrived.
That way you will have lost all of your original fortress, but at least the fortress lives on.

12
Tilesets and Graphics / Re: Duerer tileset v.02[15x15][40.09]
« on: August 18, 2014, 06:34:01 am »
This should be in the starter pack.

13
Time taken in seconds makes no sense at all without knowing FPS. The TIME token would have to be in ticks instead.
It would be nice to have a [TICK_MUL:value] token instead that gives the basinc number of actions this reaction takes. Multiplied by ticks per action (speed od relay or whatever you want to call it, usually 10 ticks per action or less) of an individual, this would give a base time in ticks, which would be reduced by his skill at this labour.
Of course you are totally right with that one. Needs to be ticks not sec.

14
Hello everyone.

Background info:
Spoiler (click to show/hide)
Basically what I want to do is copy the dwarfs on the embark screen to a file. Later load them from this file when in the embark screen.
If I'm not mistaken what would need to be done is go through the entire data structure of the embark-dwarves and copy all their relevant attributes into a file one by one. Or is it possible to write it all at once with something like write(df.world.....embarkDwarves[1]) to dump the whole content of this unit into the file? (Note: I'm totally aware that this syntax especially .embarkDwarves[1] is not correct)

I'm a dabbler in programming. I've basic knowledge about C++, R and python. However no formal education to speak of (I had one semester 2 hours per week bioinformatics, but there you learn only so much).
That said I don't really know DF-hack and I have NO CLUE about Lua so I'm gonna need some (extensive) help with this one.

save dwarf:
Code: [Select]
local file = io.open("SavedDwarves.txt", "w")
local table
for i = 1, 1, numberEmbarkDwarves do
     table = {["Dwarf No"] = i
                 ["caste"..i] = ...EmbarkDwarves[i].unit.caste   -- will this produce the string caste1, caste2 etc or have I misunderstood this?
                 ["sex"..i]    = ...EmbarkDwarves[i].unit.sex
                 -- etc.etc.
                 }
end

file.write(table) -- somehow write the table to file
file:close()

load dwarf:
Code: [Select]
local loadfile = io.open("SavedDwarves.txt", "r")
local table
file.read() -- somehow reconstruct table from file

for i = 1, 1, numberEmbarkDwarves do
       ...EmbarkDwarves[i].unit.caste = table["caste"..i]
       ...EmbarkDwarves[i].unit.sex    = table["sex"..i]
        -- etc.etc.
end

I guess the dwarves on embark screen are held in an array of size 7 (or larger when hacked), so it would be a matter of simply looping through it to get every dwarf. What's the syntax to access it?
Also how would i write the table to a file and restore it from there, preferably in a human readable format.

15
Utilities and 3rd Party Applications / Re: DFHack 0.40.08-r2
« on: August 15, 2014, 03:49:37 pm »
Is there a way to save a dwarfs attributes (traits, soul, sex, caste, etc. etc.) and reload them later onto another dwarf?

Pages: [1] 2 3 ... 7