-
Notifications
You must be signed in to change notification settings - Fork 0
entomb.lua Implement a function that creates a job to haul an item to a coffin. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… a coffin. Only the function has been created; the program's UI has not been updated.
Per discussion at Edit: to be clear, only corpse and corpse-piece items have been tested. |
Actually, would you put me in as a collaborator / contributor ? I'm going to archive (hopefully that will work) or completely delete (sorry) my fork of your fork, as soon as you accept or reject this pull request. I think the way you do this is But I've never done it, and I seemingly can't send myself an invite to test how it works. I think it's filtering out my own account. I'm super unhappy with GitHub right now, because I can't have two forks of the same project. So I can't have a direct fork of Seems like such an obvious thing to do. But no. The error I get is: "No available destinations to fork this repository." GitHub Copilot says:
And Stack Overflow basically agrees, as does GitHub Discussions. Super frustrated, I wrestled with this for like 4 hours and kind of messed up my repositories. Anyway, I'll stop griping, you don't need to hear it. |
Very Important Bugfix. Set the tomb zone field If you've run a previous version of entomb on any fort you care about, go to the console,
|
Another bugfix. Units keep track of the buildings (including civzones) that they own. |
Sorry for the late reply, I've been out of town for the past few days. I'll take a look at everything today and figure out how to add you as a contributor. I'm very new to github so I have to look up everything first before I mess something up. |
entomb.lua
Outdated
@@ -190,6 +190,9 @@ function AssignToTomb(unit, tomb, forceBurial) | |||
else | |||
tomb.assigned_unit_id = unit.id | |||
tomb.assigned_unit = unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the tomb.assigned_unit
before, but they were always empty even for tombs assigned automatically by the game. Do we know what it actually does or if it's alright to leave it empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my current fort, I don't have any tombs that have assigned_unit_id ~= -1
and assigned_unit
== nil.
They all contain (a reference to) the assigned unit.
I can check other forts if you need me to.
From the Lua console:
BZT=df.global.world.buildings.other.ZONE_TOMB
for i,tomb in ipairs(BZT)do if tomb.assigned_unit_id ~= -1 and tomb.assigned_unit == nil then print(i,tomb.id);end;end
No results in my current fort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed something: the field I find in tomb zones are *.assigned_units
(plural), with a reference to an empty vector; there is no field for *.assigned_unit
. I found neither in the actual coffin building itself.
I also checked *.assigned_units
for other zone types e.g. assigned rooms and offices and they were always empty vectors as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. That changed between 0.51.08 and 0.51.13. Didn't know that, as I haven't bothered to upgrade my main fort for a while.
.assigned_unit
was replaced with .owner_unit_cached_index
which you probably should not mess with. (That's presumably the index into df.global.world.units.active
or possibly . )df.global.world.units.all
Okay, reject that particular pull request.
Actually, corpse and corpse-piece item haul to coffin jobs are automatically created by the game as long as:
So a function to haul to coffin isn't necessary for items that the game would naturally put in coffins, but it would be useful for interring arbitrary items. |
Sure, the corpse items will get moved eventually. |
Ah yes, that would indeed be very useful. |
Okay, I tried interring some ballista parts with HaulToCoffin. It doesn't work. They get moved to the coffin's location, but they're left on the ground instead of being placed inside the building. Unfortunate. Well. If you set Subnote: from inspection of a single slaughtered animal, Caveat: weapons and armor which are interred are still listed in the available-for-uniforms vectors |
Probably prudent to remove them from Btw, I already sent you a collaborator invite in case you missed it. |
entomb.lua Very Important Bugfix completely assign unit to tomb. Because this field was removed in DF 0.51.11.
Okay, the pull request seems to have been merged successfully (merge strategy, not rebase strategy). Archiving did not work; I deleted my fork. Things still seem fine in this fork. |
Thanks! I'm currently working in an adapted form of |
Only the function has been created; the program's UI has not been updated.