Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 291 292 [293] 294 295 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1441172 times)

Suds Zimmerman

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4380 on: August 10, 2013, 11:53:28 am »

Is it possible to remove reactions from workshops at the individual workshop level (i.e. bone polishing workshop 1 stripped of all reactions whilst all others can still be operated normally.) Failing that, is it possible to spawn and despawn workshops? Preferably whilst keeping their preferences intact. (Storing and loading them, perhaps?) For clarity's sake, I'm talking about custom workshops only.

Does nobody know whether this is possible?
Logged
You don't need a weatherman to know which way the wind blows
DORFAMUNDA - NECROMUNDA DF MOD

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4381 on: August 10, 2013, 02:52:51 pm »

You could forbid the building's material to disable the building.

b = getSelectedBuilding()
b.contained_items[0].item.flags.forbid = true
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4382 on: August 11, 2013, 01:03:43 am »

Another idea, which came to me from hiding/unhiding magma-workshops.

Can a flag be toggled for the visibility of workshops in the menu, without any magma? For example "hide workshop kitchen" would result in the kitchen disappearing in the menu. Even if the workshop and reactions themselves are still there, maybe this helps total conversions to get rid of vanilla workshops.

I could also use it for my research system. Scientific discovery has been made, a workshop is now available, and is then shown in the workshop menu. So people would start out with a short list of buildings, and it gets longer and longer the more the research.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4383 on: August 11, 2013, 01:13:57 am »

There aren't any flags, but I'm sure there's code that can be run that will remove said option from a menu whenever the menu comes up.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4384 on: August 12, 2013, 01:08:55 am »

Hi :)

I have this code, which makes a dwarf under the cursor legendary in a selected skill.

Code: [Select]
-- This script will modify skills, or a single skill, of a unit
-- usage is:  target a unit in DF, and execute this script in dfhack
-- via ' lua /path/to/script skillname '
-- the skill will be increased to 20 (Legendary +5)
-- arguments 'list', 'classes' and 'all' added
-- by vjek, version 3, 20130123, for DF(hack) 34.11 r2
-- Praise Armok!

function make_legendary(skillname)
local skillnamenoun,skillnum
unit=dfhack.gui.getSelectedUnit()

if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

if (df.job_skill[skillname]) then
skillnamenoun = df.job_skill.attrs[df.job_skill[skillname]].caption_noun
else
print ("The skill name provided is not in the list.")
return
end

if skillnamenoun ~= nil then
utils = require 'utils'
skillnum = df.job_skill[skillname]
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = skillnum, rating = 20 }, 'id')
print (unit.name.first_name.." is now a Legendary "..skillnamenoun)
else
print ("Empty skill name noun, bailing out!")
return
end
end

function PrintSkillList()
local i
for i=0, 115 do
print("'"..df.job_skill.attrs[i].caption.."' "..df.job_skill[i].." Type: "..df.job_skill_class[df.job_skill.attrs[i].type])

end
print ("Provide the UPPER CASE argument, for example: PROCESSPLANTS rather than Threshing")
end

function BreathOfArmok()
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end
local i
utils = require 'utils'
for i=0, 115 do
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = i, rating = 20 }, 'id')
end
print ("The breath of Armok has engulfed "..unit.name.first_name)
end

function LegendaryByClass(skilltype)
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

utils = require 'utils'
local i
local skillclass
for i=0, 115 do
skillclass = df.job_skill_class[df.job_skill.attrs[i].type]
if skilltype == skillclass then
print ("Skill "..df.job_skill.attrs[i].caption.." is type: "..skillclass.." and is now Legendary for "..unit.name.first_name)
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = i, rating = 20 }, 'id')
end
end
end

function PrintSkillClassList()
local i
for i=0, 8 do
print(df.job_skill_class[i])
end
print ("Provide one of these arguments, and all skills of that type will be made Legendary")
print ("For example: Medical will make all medical skills legendary")
end

--main script operation starts here
----
local opt = ...
local skillname

if opt then
if opt=="list" then
PrintSkillList()
return
end
if opt=="classes" then
PrintSkillClassList()
return
end
if opt=="all" then
BreathOfArmok()
return
end
if opt=="Normal" or opt=="Medical" or opt=="Personal" or opt=="Social" or opt=="Cultural" or opt=="MilitaryWeapon" or opt=="MilitaryAttack" or opt=="MilitaryDefense" or opt=="MilitaryMisc" then
LegendaryByClass(opt)
return
end
skillname = opt
else
print ("No skillname supplied.  Pass argument 'list' to see a list, 'classes' to show skill classes, or use 'all' if you want it all!")
return
end

make_legendary(skillname)

I want to run it with autosyndrome, but it says that no unit is selected, because there is no cursor... autosyndrome targets the worker, but somehow the two scripts dont interact well. Now I dont want to instantly make dwarves legendary, but I'd like this script to add 1 skill point to an existing skill. 1 level... and to a pet in the workshop.

Autosyndrome allows me to target a pet in a workshop with [SYN_CLASS:\COMMAND][SYN_CLASS:\LOCATION][SYN_CLASS:\ALLOW_MULTIPLE_TARGETS][SYN_CLASS:\REACTION_INDEX], and adds a syndrome to the target. Can anyone think of an idea how to make it target the pet with the above script, and change it from legendary to +1 skill?

I would like my animal-trainers to actually train the animals skills, improve dodging, fighting, biting and all that, one reaction = one skill point. That way you can make legendary guard animals. :)

This would be really really cool, I hope someone likes the idea enough to have a go at it.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4385 on: August 12, 2013, 01:58:38 am »

Here, try this:

Code: [Select]
-- This script will modify skills, or a single skill, of a unit
-- usage is:  target a unit in DF, and execute this script in dfhack
-- via ' lua /path/to/script skillname '
-- the skill will be increased to 20 (Legendary +5)
-- arguments 'list', 'classes' and 'all' added
-- by vjek, version 3, 20130123, for DF(hack) 34.11 r2
-- Praise Armok!

function make_legendary(skillname,unit)
local skillnamenoun,skillnum

if unit==nil then
print ("No unit selected!  Aborting with extreme prejudice.")
return
end

if (df.job_skill[skillname]) then
skillnamenoun = df.job_skill.attrs[df.job_skill[skillname]].caption_noun
else
print ("The skill name provided is not in the list.")
return
end

if skillnamenoun ~= nil then
utils = require 'utils'
skillnum = df.job_skill[skillname]
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = skillnum, rating = rating or 1 }, 'id')
print (unit.name.first_name.." is now a Level ".. rating .." ".. skillnamenoun)
else
print ("Empty skill name noun, bailing out!")
return
end
end

--main script operation starts here
----
local opt = {...}
local skillname

local unit      = df.global.world.units.all[opt[1]] --I HAVE NO IDEA IF THIS WILL WORK
      skillname = opt[2]
 
if not opt[1] or not opt[2] then
print("Your syntax is wrong. To be exact...")
if not opt[1] then
print("You forgot to declare a unit!")
end
if not opt[2] then
print("You forgot to say what skill you wanted!")
end
end
make_legendary(skillname,unit)

Syntax:

First argument is the unit
Second is the skill

I have included in the form of comments any trepidation in my decisions
« Last Edit: August 12, 2013, 12:29:47 pm by Putnam »
Logged

0cu

  • Bay Watcher
  • Losing is fun!
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4386 on: August 12, 2013, 04:41:59 am »

What do the commands autodump-destroy actually do?

I have lots of items laying around in my river because of the suicide merchants jumping down the waterfall. Can I destroy those items with DFhack? It's a lot and really starts to hurt my FPS.
Logged

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4387 on: August 12, 2013, 09:47:47 am »

What do the commands autodump-destroy actually do?

I have lots of items laying around in my river because of the suicide merchants jumping down the waterfall. Can I destroy those items with DFhack? It's a lot and really starts to hurt my FPS.

I don't know how to explain it better than https://github.com/peterix/dfhack/blob/master/Readme.rst
But here goes.

d-b-d mass dump the stuff you want to get rid of.  Then "autodump destroy" in the console will delete all the items.  It's equivalent to setting a garbage zone under an atom smasher.  With less labor.
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4388 on: August 12, 2013, 02:25:44 pm »

Has DFhack found anything related to how the game gives units items when it spawns them? I was wondering if it might be possible to hack it so males stop spawning in dresses.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4389 on: August 12, 2013, 03:29:02 pm »

You have something against dresses, punk?
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4390 on: August 12, 2013, 03:36:45 pm »

It does kind of kill the tension when you get ambushed by bandits sporting beards and shaven heads and they're all wearing skirts.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4391 on: August 12, 2013, 04:48:51 pm »

Spoiler: Is that so? (click to show/hide)
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4392 on: August 12, 2013, 05:12:42 pm »

Skirts and dresses, not kilts. And depending on the mod, bras.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

moondowner

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4393 on: August 13, 2013, 02:38:09 pm »

I seem to misunderstand some basics about how to use DFHack on linux  :( When I run dfhack script in terminal, it starts Dwarf Fortress and the terminal output is captured not by DFHack, but by DF itself (same as if I would launch ./df). It wouldn't let me enter any commands, obviously. 'pgrep dfhack' says dfhack is running, though. What am I doing wrong?
Logged

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4394 on: August 13, 2013, 09:47:45 pm »

I seem to misunderstand some basics about how to use DFHack on linux  :( When I run dfhack script in terminal, it starts Dwarf Fortress and the terminal output is captured not by DFHack, but by DF itself (same as if I would launch ./df). It wouldn't let me enter any commands, obviously. 'pgrep dfhack' says dfhack is running, though. What am I doing wrong?
Are you running [PRINTMODE:TEXT] ?
Logged
Pages: 1 ... 291 292 [293] 294 295 ... 373