Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
86e636f
Add entomb.lua and docs/entomb.rst
amade-w Jul 15, 2025
f684542
Update changelog.txt to add new tool: entomb
amade-w Jul 15, 2025
07594b5
Apply revisions to entomb.lua according to PR comments
amade-w Jul 16, 2025
0f75b56
Apply 2nd revision to entomb.lua: improve PutInCoffin()
amade-w Jul 16, 2025
36b7771
entomb.lua Implement a function that creates a job to haul an item to…
SilasD Jul 18, 2025
b359cba
entomb.lua Very Important Bugfix completely assign unit to tomb.
SilasD Jul 19, 2025
6a185fd
entomb.lua Update the unit's owned buildings with the newly-assigned …
SilasD Jul 20, 2025
a2f4548
Undo commit b359cbaa4c7ea3b62da9ccea24ca3fdf6e025581
SilasD Jul 23, 2025
3c62cda
Merge pull request #1 from SilasD/entomb
SilasD Jul 23, 2025
25714bf
Add function to validate moving items, separate job removal into own …
amade-w Jul 25, 2025
7952e13
Assign new name to unnamed tombs during assignment
amade-w Jul 25, 2025
f484912
Move logic to call HaulToCoffin() and TeleportToCoffin() into new fun…
amade-w Jul 25, 2025
ba5e5d1
Implement add-item option, revise Main() logic, switch to use argpars…
amade-w Jul 28, 2025
e11d968
Disable teleport function, update documentation
amade-w Jul 28, 2025
8f4feca
Fix argparse short-form conflict
amade-w Jul 29, 2025
785741b
Fix documentation
amade-w Jul 29, 2025
062ef18
Assign only active tomb zones and make it unavailable for auto assigm…
amade-w Aug 13, 2025
5f1c7b7
Remove duplicated code in IterateTombZones()
amade-w Aug 13, 2025
c343176
Merge branch 'master' into entomb
amade-w Aug 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions entomb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,24 @@ end
-- Iterate through all available tomb zones.
local function IterateTombZones(unit_id)
for _, building in ipairs(df.global.world.buildings.other.ZONE_TOMB) do
if CheckTombZone(building, unit_id) then return building end
if unit_id == -1 then
-- Use only active (unpaused) zones when assigning unassigned tomb zones.
if building.spec_sub_flag.active then
if CheckTombZone(building, unit_id) then return building end
end
else
if CheckTombZone(building, unit_id) then return building end
Comment thread
amade-w marked this conversation as resolved.
Outdated
end
end
return nil
end
Comment thread
amade-w marked this conversation as resolved.

-- Use when user inputs coffin building ID instead of tomb zone ID.
function GetTombFromCoffin(building)
if #building.relations > 0 then
for _, v in ipairs(building.relations) do
if df.building_civzonest:is_instance(v) and v.type == df.civzone_type.Tomb then
return v
for _, zone in ipairs(building.relations) do
if df.building_civzonest:is_instance(zone) and zone.type == df.civzone_type.Tomb then
return zone
end
end
end
Expand Down Expand Up @@ -134,6 +141,7 @@ function AssignToTomb(unit, tomb)
local incident = df.incident.find(incident_id)
-- Corpse will not be interred if not yet discovered,
-- which never happens for units not belonging to player's civ.
-- Only needed for units that have a death incident.
incident.flags.discovered = true
end
local burialItemCount = FlagForBurial(unit, corpseParts)
Expand All @@ -145,6 +153,9 @@ function AssignToTomb(unit, tomb)
if not utils.linear_index(unit.owned_buildings, tomb) then
unit.owned_buildings:insert('#', tomb)
end
-- Make tomb zone unavailable for automatic assignment to other dead units.
tomb.zone_settings.tomb.flags.no_pets = true
tomb.zone_settings.tomb.flags.no_citizens = true
print(string.format(strBurial, strUnitName, strTomb))
print(string.format(strCorpseItems, burialItemCount, strPlural, strPlural))
end
Expand Down