Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1073331 times)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #105 on: June 27, 2014, 08:19:12 am »

And by substituting the filename I can use a separate non-conflicting single file, yes? Thanks!
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #106 on: June 27, 2014, 08:21:19 am »

That script is referring to "onload.init" in the main DF folder (not a region folder), although the name doesn't make a difference.
« Last Edit: June 27, 2014, 08:24:11 am by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

indyofcomo

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #107 on: June 27, 2014, 08:44:06 am »

What's the simplest way(probably on the wiki) to find out what string I should be using with workflow?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #108 on: June 27, 2014, 06:06:53 pm »

I had thought of the first, and I plan to do this eventually - but it's a real pain, with way more special cases than I want to consider.  The second could work - I'd have to check how selectively the windows GUI copies those folders over.  On the other hand, it makes all the issues with propagating settings even worse if I want to use it for more that always-on bugfixing. 

Serious questions to dfhack people:  how hard would it be to have a single Onload.init in the same place as dfhack.init? 

This would be a huge plus for my setup in the Starter Pack.  If keeping the current function is desired, it could be overridden when an in-save-folder init file is found.

Not that hard, but Lethosor's solution is better. You can do it with dfhack.init as is.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #109 on: June 27, 2014, 06:07:38 pm »

One more: I tried running the blooddel command to test if it works, and it won't delete blood barrels from an already arrived caravan. Is it intended behaviour? Is it only effective on future caravans?

Yes, only future caravans.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #110 on: June 27, 2014, 08:14:33 pm »

One more: I tried running the blooddel command to test if it works, and it won't delete blood barrels from an already arrived caravan. Is it intended behaviour? Is it only effective on future caravans?

Yes, only future caravans.

Correct. The script removes bloods etc. from the list of extracts that a civ can bring. This will also prevent you from embarking with or requesting blood barrels. Items that already exist on the map are not affected. The script only needs to be run once per world, as the change appears to be saved in the world data.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #111 on: June 27, 2014, 09:35:09 pm »

What's the simplest way(probably on the wiki) to find out what string I should be using with workflow?
If you mean the item/material tokens, they can be found at http://dwarffortresswiki.org/index.php/DF2012:Item_token and http://dwarffortresswiki.org/index.php/DF2012:Material_token, respectively. The createitem page may also be useful.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #112 on: June 27, 2014, 11:36:59 pm »

Alternately use the much more friendly workflow GUI script.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #113 on: June 28, 2014, 02:03:59 pm »

This should work in dfhack.init:
Code: [Select]
:lua dfhack.onStateChange.onloadscript = function(state) if state == SC_WORLD_LOADED then dfhack.run_command('script onload.init') end end
What is the syntax, if I want to run a script at embark/after embark. Will the script only act on the active world, or any saves?

What is an "embark offset patch"?  Because I'm getting an "embark offset patch not found" when trying to use "embark anywhere" or "embark nano".
Yeah, the embark script does that, use the embark-tools instead: enable embark-tools in the console, then you get a GUI option.

What's the simplest way(probably on the wiki) to find out what string I should be using with workflow?
Use this as a base, copypaste into dfhack, or add to dfhack.init or onload.init.

Riemann

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #114 on: June 28, 2014, 05:43:14 pm »

Hey all, I've learned me some Ruby in the last couple days and am working on a DFHack script. Could use some help:

I have a reference to a Unit object and want to get the string name for that units Profession.

been poking at this for a while and I cannot figure out the syntax for working with the classes that contain things that kind of look like Enums (such as Profession)


this is what I have so far
Code: [Select]
def OutputDorfInfo(dorf)
    str = "#{dorf.name}" if dorf.name.has_name

    if dorf.custom_profession != ""
        str << " the #{dorf.custom_profession}"
    else
        str << dorf.profession.inspect()
    end

    str << " member of the militia squad #{dorf.military.squad_tg.name}" if dorf.military.squad_id != -1

    str << ". \nBorn in the year #{dorf.relations.birth_year}."

    if dorf.relations.spouse_id != -1
        str << "\nMarried to #{dorf.relations.spouse_tg.name}."
    end

    if dorf.relations.lover_id != -1
        str << "\nLover of #{dorf.relations.lover_tg.name}."
    end

    artifactName = dorf.status.artifact_name.to_s()
    if artifactName && artifactName.length > 0
        str << "\nCreator of the artifact #{artifactName}."
    end
   
    puts str
end


dorfs = DFHack.unit_citizens

dorfs.each { |d|
    OutputDorfInfo(d)
    puts ""
}
Logged

Riemann

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #115 on: June 28, 2014, 06:20:17 pm »

Found it!

the syntax I was looking for is DFHack::Profession::Caption[dorf.profession]
Logged

Riemann

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #116 on: June 28, 2014, 10:52:42 pm »

Does anyone know of how to generate the physical description of a dorf in Ruby?
Logged

esarbe

  • Escaped Lunatic
    • View Profile
Building for Fedora 20
« Reply #117 on: June 30, 2014, 11:54:44 am »

Hi there,

i've cloned the dfhack repo and I'm trying to build dfhack for fedora 20. I'm stuck at the configure build step, however:

Code: [Select]
CMake Error at depends/protobuf/CMakeLists.txt:60 (MESSAGE):
   Could not find a working hash map implementation.  Please install GCC >=
   4.4, and all necessary 32-bit C++ development libraries.

I'm at a loss here. The libstdc++ package is installed. Which hash map implementation is required?

(gcc version 4.8.3)

Cheers,
esarbe
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #118 on: June 30, 2014, 12:59:53 pm »

Make sure you have a 32-bit GCC or multilib enabled.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r5
« Reply #119 on: June 30, 2014, 01:32:17 pm »

https://github.com/expwnent/dfhack/commit/596ab0e1b85dff4107a65847247d4b7ec1eafa12

All the scripts I've added are in there. They should be safe for the current version. There are a lot of them, so go check them out! I also added a few convenience things like the "repeat" command / repeatUtil / etc.

I added an onReport event that happens when a combat report happens (much more often than you think: it doesn't have to be visible to the user). More exciting is the onStrike event which triggers when any unit hits another. For convenience, it also tries to compute whether they hit the target with a weapon or with a unit attack. It needs testing, so let me know how it goes.

I would recommend renaming hackWish to something more descriptive like gui/createitems or something along those lines.
Pages: 1 ... 6 7 [8] 9 10 ... 360