Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 187 188 [189] 190 191 ... 194

Author Topic: DFHack 0.47.05-r1  (Read 415136 times)

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2820 on: February 19, 2021, 07:00:18 pm »

So, my problem was a lack of understanding of gui/gm-editor, I thought it was only used for editing unit personalities and things like that.
Ah, you might have been thinking of gui/gm-unit. They have similar names, but gui/gm-editor came first.

Quote
I think it isn't a big deal if it has explanatory documentation; I just thought from the name it was something that would be somehow more meaningful, while after looking at what it contains it just has stuff about units

What would be cool to have documentation on is what you and patrik just told me; though I guess that probably exists and I just am not great at google and didn't even know what I was trying to find.
There are a couple places where unit-related data is stored: besides the "unit" type, there are also "historical_figure" and "nemesis_record", with references between each other. "identity" might also be relevant sometimes. I was mostly thinking that it would be worth documenting the reasons why some of them only exist sometimes (a wild animal typically only has a "unit" instance, for example), and in certain cases, which source overrides the others (for things like names). I don't have a great source on why "nemesis_record" exists at the moment, but there is a reason.

Quote
EDIT: found where to solve the problem, was very easy after you mentioned df.historical_entity.find(unit.civ_id) (though I actually changed for the site entity rather than the civilization entity)
If it's something presentable, sharing it here might be useful to others :)
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.

javascripter

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2821 on: February 19, 2021, 11:56:18 pm »

Ah, you might have been thinking of gui/gm-unit. They have similar names, but gui/gm-editor came first.

That is exactly what i was thinking


Quote
If it's something presentable, sharing it here might be useful to others :)

So first you need to find the civilization entity ID or site entity ID (I think first one affects new forts while second affects current forts, but have only done it for site entity ID), if you go to nemesis record, for example:
gui/gm-editor dfhack.units.getNemesis(dfhack.gui.getSelectedUnit())
then there is an entry entity_links, which all your dwarves should have two memberst entries, one for civilization entity ID and one for site entity ID. Your nobles/administrators should have a positionst entry for your site ID, while I would expect a monarch to have a positionst entry for the civilization ID
I'm sure there are other ways to find civlization ID / site ID

then with gui/gm-editor df.historical_entity.find(ID), there will be an entry for positions, which has an entity "own" (maybe "site" for the civilization level ID, not sure)
that is a list of all positions, each has the name, an ID, and then what i care about is appointed_by and appointed_by_civ fields, in my case they were empty and I needed to add (alt+i) to the first one an entry with no name (leave blank) and value of the ID of another position in my fort and for the second one an entry with no name and value of the ID of the site entity (not sure if this was neccessary, but all the other positions had it)
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2822 on: February 24, 2021, 01:42:56 am »

So, my problem was a lack of understanding of gui/gm-editor, I thought it was only used for editing unit personalities and things like that.
Ah, you might have been thinking of gui/gm-unit. They have similar names, but gui/gm-editor came first.

Quote

Yeah it was supposed to be a suite of "Game Master" tools for editing everything like you would be in DnD or GURPS pen and paper rpg.

jecowa

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2823 on: February 28, 2021, 12:37:24 am »

Something in DFHack reveals information that is supposed to be hidden to the player. (Vampire true name).

source: https://www.reddit.com/r/dwarffortress/comments/ltzu82/if_i_wasnt_sure_i_found_the_vampire_before/gp3mycq/
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2824 on: February 28, 2021, 12:45:41 am »

Looking at the rest of the thread, that's a feature of the "confirm" plugin, specifically a feature new in https://github.com/DFHack/dfhack/issues/1593. Looks like it's just reading "unit.name", so likely a call to getVisibleName() would fix it. I'll open an issue.

Edit: fixed it in https://github.com/DFHack/dfhack/commit/1b2eed7c5e4878f057aab13e2adb7c8293af45d6
« Last Edit: February 28, 2021, 01:08: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.

xordae

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2825 on: February 28, 2021, 01:55:21 am »

Spoiler (click to show/hide)
After what PatrikLundell said in another thread maybe this is a DF bug after all.

I also stole some dude's script and adapted it to untag all in_job flagged objects, fixing instruments that are stuck with TSK after aborted performances. Maybe someone finds this useful.

fixjobs.lua
Code: [Select]
for i, item in ipairs (df.global.world.items.all) do
    if item.flags.in_job then
     item.flags.in_job = false
        dfhack.println ("Job Flags Unset!")
     end
  end
« Last Edit: February 28, 2021, 03:56:49 am by xordae »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2826 on: February 28, 2021, 04:12:33 am »

I don't think the bug concerning flying stuff sometimes falling through floors is the reason hacked floors don't work correctly, but rather a failure somewhere in the hacking to fill in all the info that's should be filled in.

The fixjobs script is not a good one, as it will remove all items that are tasked for jobs from their tasks. If you're lucky, it will just result in occasional cancellation message that items are lost or destroyed when they targeted again by someone else (such as e.g. the boulder targeted for building a wall gets hauled away to a stone stockpile, failing the construction job). If you're unlucky it will have worse consequences.

Items are marked as tasked for a reason, namely because that stops the items from being considered for usage by other tasks. The only case where you want to forcibly remove the flag is when it remains erroneously (such as for the dropped instruments). In order to determine that you'd have to find out which items are marked for tasks that no longer exist. At a guess, it might be possible to iterate through the two(?) jobs lists for each tasked item to see if they're targeted by any job, and remove the flags only for the ones that aren't targeted by any jobs, but there may be cases where things are targeted without any explicit jobs being posted (picking up/sorting owned/assigned items?).
Logged

xordae

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2827 on: February 28, 2021, 04:22:32 am »

I ran it a bunch and only got job cancellations.

But if anyone is up for doing a more indepth instrument fix then by all means. ;)
I think just narrowing the type to "instruments" would also be enough to make the script harmless for all intents and purposes.
« Last Edit: February 28, 2021, 05:22:28 am by xordae »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2828 on: February 28, 2021, 01:04:30 pm »

I don't think the bug concerning flying stuff sometimes falling through floors is the reason hacked floors don't work correctly, but rather a failure somewhere in the hacking to fill in all the info that's should be filled in.

To comment on this, I was able to get hacked floors to work properly (for multi-level buildings) but there was a whole list of things/flags that need to be set (you can't just change the tiletype or artificially construct a floor). IIRC it had something to do with setting the occupancy and walkable settings of the tiles (and maybe some other things)
Logged

xordae

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2829 on: March 01, 2021, 01:02:53 am »

If you could lay out your steps so that I can try it, that'd be awesome.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2830 on: March 02, 2021, 07:37:21 am »

How much do we know about the interaction between ballista bolts and trees? Could be useful for an updated script that destroys trees.
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)?

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2831 on: March 02, 2021, 01:00:00 pm »

How much do we know about the interaction between ballista bolts and trees? Could be useful for an updated script that destroys trees.
Are you sure ballista bolt tree removal is a good model itself? Unless something has changed recently, tree obliteration still leaves holes in water, for instance, and I don't know if anyone has investigated whether it might cause falling tree cave-ins if you channel away the tile it stood on (and I'd investigate that on a tree that didn't stand in an underground lake for ease of testing).

As a minimum you'd have to remove the tree from the list of plants associated with the tile block (I think the list is in the top left corner 16*16 block of the MLT it belongs to, with the lists for the other tiles being empty), replace the tree tile with the underlying surface tile (and there you could chose between the actual underlying surface or use the soil type DF would produce), and you'd probably have to mark one or more of these structures as modified to trigger DF to update them.
  You might also have to go through the upper levels of the tree to process any items stuck there to get DF to realize they should now start to fall down (this obviously has to be done before you destroy the tree object).
Logged

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2832 on: March 02, 2021, 08:30:45 pm »

I use digcircle all the time, but I can't see how (if possible) to make it use "Marker Only" mode, which I would find tremendously helpful.
Logged
- Loge Lolortunom, Ghostly Planter: I have become a parent.  I'm very fond. ... DF
- Vucari AdasdodĒk, Engraver: "I was accosted by worms.  I'm really starting to panic." ... DF
- Ingiz Etesoddom, Surgeon "Is deliberately cruel to those unfortunate enough to be subject to their sadism." ... DF

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2833 on: March 02, 2021, 10:21:15 pm »

I use digcircle all the time, but I can't see how (if possible) to make it use "Marker Only" mode, which I would find tremendously helpful.

It doesn't look possible currently, but there is support for priorities, so it might not be too hard to add. I opened a request for it at https://github.com/DFHack/dfhack/issues/1783

You might be able to use DF's existing "toggle marker mode" (d-M) for this, though. If you're designating a circle in an unmarked area, you could fairly easily convert it to marker mode after designating it. This becomes more complicated if there are already designations in the area, but you could still work around it if they're all one type (marker or non-marker). For instance, if you have only non-marker designations that you want to preserve, you could convert them to markers with d-M, then run "digcircle", then toggle everything with d-M, leaving just your circle as a marker. The same would work if the existing designations are only markers.

That is rather complicated, though, and hopefully a "-m" option to the dig commands wouldn't be too hard. I probably can't get to it any time soon, but I'd be willing to point someone in the right direction.
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.

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.04-r5 | 0.47.05-beta1 (dev)
« Reply #2834 on: March 02, 2021, 10:30:13 pm »

Thanks for the quick reply!  Yes, I use d-M to change the circles to marker-only, but indeed it can be a messy proposition.  Thank you for opening a request  :)
Logged
- Loge Lolortunom, Ghostly Planter: I have become a parent.  I'm very fond. ... DF
- Vucari AdasdodĒk, Engraver: "I was accosted by worms.  I'm really starting to panic." ... DF
- Ingiz Etesoddom, Surgeon "Is deliberately cruel to those unfortunate enough to be subject to their sadism." ... DF
Pages: 1 ... 187 188 [189] 190 191 ... 194