Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Removing All the Trader Flags  (Read 61 times)

Leonidas

  • Bay Watcher
    • View Profile
Removing All the Trader Flags
« on: July 04, 2020, 08:08:43 pm »

DFHack's gui/gm-editor will remove the trader flag one item at a time. The Librarian Script is a more efficient option for books. I'm wondering if there's anything faster, like a script that'll set the trader flag to false on every item in the fortress.

Here's why I need it:

1) Some adventurers acquired a couple hundred books from a local library and a necromancer tower. They're considering acquiring a couple thousand more from other libraries and towers. They've been depositing these books into a retired fortress that is destined to be the great library of its age. But on that fort's unretirement, it turned out that many of these books had been marked with the trader flag. I figure it's like a sticker that says "Property of the Snarlingsummer Public Library".

2) I've also had the situation where a caravan gets spooked and dumps many dozens of items, which become unmovable. Picking through those with gui/gm-editor would be slow and tedious.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Removing All the Trader Flags
« Reply #1 on: July 05, 2020, 05:16:41 am »

Assuming you're somewhat knowledgeable about DFHack scripts, here's a script I use monthly:
Spoiler (click to show/hide)
It does report the status of a number of things and removes the Trader flag from scrolls on the ground (specifically), to claim the scrolls dropped when visitors die (of old age when entering and realizing they're past their expiration date, killed by invaders, visitors dying [typically of old age] in the cavern, etc.
Logged

Leonidas

  • Bay Watcher
    • View Profile
Re: Removing All the Trader Flags
« Reply #2 on: July 05, 2020, 10:02:34 am »

This is the sort of base that I was hoping for. Thanks, Patrik!
Logged