Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 175 176 [177] 178 179 ... 243

Author Topic: DFHack 50.12-r3  (Read 807680 times)

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2640 on: October 15, 2020, 04:46:54 pm »

It really doesn't need to be customized or center on the squad, those were "wishes".
Any kind of simple timer/alarm that pauses would be neato.

In that case take a look at "repeat" and "fpause".
Logged
Really hoping somebody puts this in their signature.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2641 on: October 15, 2020, 07:04:39 pm »

I would also suggest taking a look at the Lua announcements API: https://docs.dfhack.org/en/stable/docs/Lua%20API.html#announcements
You can use this to create native DF announcements, that can optionally pause the game and/or show an in-game popup (similar to the cavern discovery message). If you don't need to customize their appearance, this may be an easier approach than warn-starving and gui/hello-world. Pausing announcements also wouldn't need "fpause".

I would definitely recommend "repeat" or the repeat-util module to get something to run e.g. every in-game day.
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.

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2642 on: October 15, 2020, 07:37:12 pm »

I would also suggest taking a look at the Lua announcements API: https://docs.dfhack.org/en/stable/docs/Lua%20API.html#announcements
You can use this to create native DF announcements, that can optionally pause the game and/or show an in-game popup (similar to the cavern discovery message). If you don't need to customize their appearance, this may be an easier approach than warn-starving and gui/hello-world. Pausing announcements also wouldn't need "fpause".

I would definitely recommend "repeat" or the repeat-util module to get something to run e.g. every in-game day.

Looking through the Lua API, I couldn't find anything to return the current day-of-month.  Is there anything like that ?
Logged
Really hoping somebody puts this in their signature.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2643 on: October 15, 2020, 08:25:00 pm »

dfhack.world.ReadCurrentDay()
dfhack.world.ReadCurrentMonth()
dfhack.world.ReadCurrentYear()

These are unfortunately not documented. Looks to me like the day ranges from 1-28 and the month ranges from 0-11 (inclusive).
https://dwarffortresswiki.org/index.php/DF2014:Calendar goes into a bit more detail about how DF handles time.
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.

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2644 on: October 15, 2020, 09:36:16 pm »

Interesting.  With that, the burrows module, and the units module, the only thing missing is a way to check if a unit is a were and somebody could write a script that automatically burrows were-citizens just before the full moon and then automatically releases them afterwords...
Logged
Really hoping somebody puts this in their signature.

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2645 on: October 15, 2020, 09:51:23 pm »

I've never written one, and wouldn't know where to begin, unfortunately.  Perhaps in a couple of weeks after I get some domestic business out of the way, but not sure even then.
Logged
FPS in Gravearmor (850+ dwarves) is 3-6 (v0.47.05 lives on).
"I've never really had issues with the old DF interface (I mean, I loved even 'umkh'!)" ... brewer bob
As we say in France: "ah, l'amour toujours l'amour"... François D.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2646 on: October 16, 2020, 04:50:43 am »

I wouldn't trust a small number of days to get anyone into a burrow that isn't a civilian alert.

Dorfs only go to designated burrow areas when they have a "job" there (where eating/sleeping counts as jobs, but dorf designated lever pulling [probably smashed when turned], or anything that isn't dependent on the dorf's needs is more likely to be taken up). If they don't find any job to perform within the burrow they typically just stand rooted on the spot.

Uninterruptible needs satisfaction activities won't be interrupted by burrows: the buggers will just continue until done. In fact, they can start need satisfaction activities outside of the burrow when burrowing block them from performing their current activity if there is no real job in the burrow, only need satisfaction ones (as an alternative to sprouting roots).

If they're hauling stuff when burrowed and the target isn't in the burrow you're in for cancellation spam until you either give up and remove them from the burrow, or somehow get the morons to drop the stuff hauled.
« Last Edit: October 16, 2020, 04:52:14 am by PatrikLundell »
Logged

Schmaven

  • Bay Watcher
  • Abiding
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2647 on: October 16, 2020, 05:54:45 am »

Forbidding their hauled item gets them to drop it.  But you can't forbid it from their inventory screen, you have to select the item from there, and view its details first.  I do this when I want an item moved out of a dry well cistern or something like that, but don"t want them to haul the item all the way to the atom smasher.
Logged

HungThir

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2648 on: October 18, 2020, 11:36:46 pm »

is there a way to use dfhack to fix the "void tiles" that appear from d-z'ing ice ramps?

the wiki mentions that casting ice on the void tile and channeling it out again can fix it, but i'm hoping for a way to just have the computer do the work...
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2649 on: October 19, 2020, 02:37:42 pm »

is there a way to use dfhack to fix the "void tiles" that appear from d-z'ing ice ramps?

the wiki mentions that casting ice on the void tile and channeling it out again can fix it, but i'm hoping for a way to just have the computer do the work...

https://docs.dfhack.org/en/stable/docs/Plugins.html#tiletypes
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2650 on: October 19, 2020, 04:25:04 pm »

is there a way to use dfhack to fix the "void tiles" that appear from d-z'ing ice ramps?

the wiki mentions that casting ice on the void tile and channeling it out again can fix it, but i'm hoping for a way to just have the computer do the work...

https://docs.dfhack.org/en/stable/docs/Plugins.html#tiletypes

Additionally, the "probe" command will give you some relevant information about any tile you select with "k", which you could use to compare the problematic tile(s) to existing tiles and figure out which attributes to copy. "tiletypes" doesn't yet have a more user-friendly wrapper, unfortunately, but people here might be able to help if you run into issues with it.
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.

HungThir

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2651 on: October 19, 2020, 06:30:01 pm »

great, thanks!  in my current fort i've already repaired the damage by casting ice, but i seem to trip over this every time i play an embark with a frozen winter, so it's very nice to have some tricks up my sleeve for next time

(though, now that i understand what causes it, maybe i won't trip over it so much :-[)
Logged

Rinin_Rus

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2652 on: October 24, 2020, 02:50:17 pm »

Is it any way to implement everyday (ingame) starting of some lua script?

It seems right now scripts could be executed once. Which is still amazing. But some kind of "cron" for dfhack may expand homebrew scripts possibilities to a new level. Am I overlooking any technical problems which prevents developing of such "cron" plugin?
Logged
He has a lot of willpower,  but he has very little linguistic ability

myk

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2653 on: October 24, 2020, 03:15:47 pm »

I don't think there is any barrier to a cron-type plugin. Buildingplan schedules itself to run twice per game day by looking at the tick count. It doesn't run exactly at day start, and ticks advanced while the game is paused throws off the accounting, but buildingplan doesn't need to be very accurate. A cron plugin could run every X tick counts and poll the in-game time and date to be more accurate.

The repeat script might also meet your needs: https://docs.dfhack.org/en/latest/docs/_auto/base.html#repeat
Logged

Rinin_Rus

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2654 on: October 24, 2020, 05:27:23 pm »

Yep, seems "problem" does not exist, it's just me not properly understand LUA and API. It's possible to make "running" script without any extra plugins.
Logged
He has a lot of willpower,  but he has very little linguistic ability
Pages: 1 ... 175 176 [177] 178 179 ... 243