Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 297 298 [299] 300 301 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1455797 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4470 on: August 28, 2013, 06:53:59 pm »

Well, neither do I. I had 4 hungry creatures with the correct creature_class pastured nearby, 3 tiles away, tested, nothing... then pastured them on the workshop, tested, nothing.

I always feel dumb if I cant get this stuff to work, although half of the time its the script that doesnt work. ^^ And I hate bothering other people, but believe me, I know less about fovcommand then you do ;)

I only know that I have a stables-building and some reactions set up to feed animals, and have to wait till someone finds time to make this script happen. I initially had high hopes for the NO_EAT, but it doesnt work. Transformations are a way, but thats over the top... fully healing a creature just to feed 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 :::

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4471 on: August 29, 2013, 12:12:24 am »

to get a unit by id
Code: (lua) [Select]
local utils = require 'utils'
local unit = utils.binsearch(df.global.world.units.all, id, 'id')
if unit then
    ...
end

or

Code: (lua) [Select]
local unit = df.unit.find(id)
if unit then
    ...
end

I think the df.unit.find method is the fastest way as it uses compiled code, and it is easier to use.

Also on the feeding front, in addition to setting unit.counters2.hunger_timer = 0 ; unit.counters2.stomach_content and stomach_food probably ought to get some attention.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4472 on: August 29, 2013, 01:02:46 am »

I've found that the hunger counter is good enough to stave hunger for a good while, but you're right and oh well here's the super-simple script fixed this time.
Code: [Select]
local unit = df.unit.find(tonumber(...))

unit.counters2.hunger_timer=0

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4473 on: August 29, 2013, 01:20:38 am »

Ok, I tested both again. Thanks both of you.

Kurik Amudnils version does spit out an errorlog about a number being required. I assume thats the viewrange.

Putnams... does work. :) All pets that were hungry are reset to non-hungry. I have to see how far the range goes, and if it goes through walls and such, but all in all its great. Even that it targets every pet, and not just one, because that would make micromanagement very hardcore.

Now I can add my stables to the game. :)
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 #4474 on: August 29, 2013, 01:23:47 am »

Kurik's version is an example of how to search by id, not an actual script :P

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4475 on: August 29, 2013, 01:34:37 am »

I did add the hunger-counter line to it all by myself. :P Probably why it didnt work. :P

But seriously, I have a 11x11 workshop now that allows indoor feeding of animals with plants, seeds or hay. Hay being a custom tool that you can buy. Edit: Make that buy or make from pigtail grass, longland grass or cave wheat grass. And feed them with leaves. That should cover everything. :)

EDIT: Works.
« Last Edit: August 29, 2013, 02:38:59 am by Meph »
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 :::

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4476 on: August 29, 2013, 04:05:49 am »

Does anyone know of or have a way to turn off the announcement ticker at the bottom of the screen? 

Besides the aesthetic issues, I also find that it often covers the happiness stats and generally gets annoying eventually.  There's also this lovely new announcement tool, which displays a filterable and configurable view of the gamelog and combat reports in another window - and it would be nice if it was possible to disable the default when using it. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4477 on: August 29, 2013, 04:08:31 am »

Have a look at data/init/announcements.txt, you can disable and enable what you want to show up. If you disable all, there wont be announcements. Dont know if the announcement ticker will still recognize them though.
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 :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4478 on: August 29, 2013, 04:12:04 am »

<...> I also find that it often covers the happiness stats and generally gets annoying eventually.  <...>

Lol @ vanilla feature interfering with tool feature, kind of makes me want to say "back in my day..." :D

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4479 on: August 29, 2013, 05:56:09 am »

Have a look at data/init/announcements.txt, you can disable and enable what you want to show up. If you disable all, there wont be announcements. Dont know if the announcement ticker will still recognize them though.

I tried deleting all instances of D_D or D_DISPLAY "the announcement will be displayed in the main dwarf announcement log (and at the bottom)" - while this did prevent them popping up at the bottom, they also never make it into the gamelog, so it's a self-defeating kind of move.  The same tag controls the ticker and the gamelog, hence the hack-question. 

Lol @ vanilla feature interfering with tool feature, kind of makes me want to say "back in my day..." :D
Heh, I started playing in 0.31; the various tools were what got me back into 0.34.  Automation and UI improvement; most of the complaints I hear are solved by various hacks and that's why I started my LNP. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Noobshock

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4480 on: September 01, 2013, 04:21:27 pm »

I've heard the crash on pushing e at the wrong time in military screen is somehow related to a dfhack search function. Is this true and is there anything I can do about this crash? I save and reload regularly in feat of crashing my game there :(
Logged

Spacebat

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4481 on: September 02, 2013, 12:39:57 am »

Could somebody please direct me to where I might figure out how to write a plugin for DFhack? The only API I see is the LUA api, but all the plugins are  in C++.

EDIT: Just realized I should also note that I'm already fluent in C++, so I don't need any guidance on the fundamentals of programming.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4482 on: September 02, 2013, 12:50:20 am »

I don't think there is a tutorial anywhere on how to write the Lua plugins, but it's pretty simple to figure out.  I just used some of the other Lua scripts as examples of where to put the file and how to handle arguments.  Past that it's all just a matter of using whatever Lua statements you want in the script.  If you want to do simple manipulation of units it's pretty straightforward if you've used the command line interpreter at all.

Speaking of which, the structures on Github can be hard to read, so I usually just use the printall() command inside the interpreter to see what fields are available on a given structure.
Logged
Through pain, I find wisdom.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4483 on: September 02, 2013, 01:13:22 am »

Could somebody please direct me to where I might figure out how to write a plugin for DFhack? The only API I see is the LUA api, but all the plugins are  in C++.

EDIT: Just realized I should also note that I'm already fluent in C++, so I don't need any guidance on the fundamentals of programming.
There are few "types" of plugins. Depending of the type you are recommended (or don't have a choice in some cases) to use either lua/ruby or C++.
Here is my view on it:
  • Needs a lot of performance (like messing with the WHOLE map of the area): C++
  • Needs to do vmethod interpose: C++ only
  • Gui programming: Lua (has a lot of stuff already made)
  • Some sort of additional functionality (like using sockets): C++
  • Simple stuff (like cheats, simple hacks, modifications of various variables): lua/ruby
  • Hacking df at binary level: binpatches
As for official C++ api there is none (afaik) but the code is documented well and usually you can pick it up quite fast. Although you will need a huge understanding of what happens in DF to do anything complicated. Whereas in lua/ruby you can start coding almost instantly and with help of lua api + generated headers + irc channel make a lot of things.

falconne

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4484 on: September 02, 2013, 02:54:27 am »

I've heard the crash on pushing e at the wrong time in military screen is somehow related to a dfhack search function. Is this true and is there anything I can do about this crash? I save and reload regularly in feat of crashing my game there :(

If you get the latest bundle of plugins linked in my sig, it includes a fixed search plugin.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.
Pages: 1 ... 297 298 [299] 300 301 ... 373