Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: can I add an elven trader position to existing save?  (Read 1073 times)

Syndic

  • Bay Watcher
    • View Profile
can I add an elven trader position to existing save?
« on: October 25, 2021, 12:41:58 pm »

If I slap a trader position into the entity:forest in my save folder's entity_default.txt, something like this:

Quote
   [POSITION:TRADER]
      [NAME:trader:traders]
      [NUMBER:1]
      [RESPONSIBILITY:TRADE]
      [APPOINTED_BY:LEADER]
      [PRECEDENCE:80]
      [DO_NOT_CULL]
      [COLOR:7:0:1]
      [MENIAL_WORK_EXEMPTION]
      [SLEEP_PRETENSION]
      [PUNISHMENT_EXEMPTION]
      [ACCOUNT_EXEMPT]
      [DUTY_BOUND]

would the existing elven civilization have their queen appoint one and send it to me? Or would that need to be present during world generation already?
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: can I add an elven trader position to existing save?
« Reply #1 on: October 25, 2021, 12:50:11 pm »

Positions can't just be added to the raws for an existing world, because the raws are only used when dynamically creating new civilizations during worldgen - if you want to add a position to an existing civilization, you have to add it in-memory.

Fortunately, you wouldn't have to start from scratch - if you have DFHack, you can edit the "hack/scripts/fix/merchants.lua" script and modify it to apply to Elves instead of Humans (and probably also skip the "ESTABLISH_COLONY_TRADE_AGREEMENTS" responsibility, since I think that was there due to a misunderstanding when I initially wrote it).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #2 on: October 26, 2021, 04:13:15 am »

Ah, thanks. Checking that script...

it seems that it identifies the human civ by looking for the MERCHANT_NOBILITY tag. Elves have... hmm, subterranean animal people also have wood weapons and armor. But elves are the only civ with AT_PEACE_WITH_WILDLIFE, so I could use that one.

I'll try it later, after backing up my save. Thanks for pointing me in the right direction!
Logged

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #3 on: October 26, 2021, 07:39:27 am »

for future reference (my own or that of others trying to do this^^):

In the interest of keeping it simple, I merely I changed this line
Code: [Select]
if ent.type == df.historical_entity_type.Civilization and ent.entity_raw.flags.MERCHANT_NOBILITY then
to
Code: [Select]
if ent.type == df.historical_entity_type.Civilization and (ent.entity_raw.flags.MERCHANT_NOBILITY or ent.entity_raw.flags.AT_PEACE_WITH_WILDLIFE) then
dfhack said it had further civilizations modified, I'll report on whether it worked next spring.
Logged

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #4 on: October 28, 2021, 09:16:40 am »

update: a guild representative came. No elven diplomat though. I already have an agreement with them, but I guess if one starts the game like this, no way to annoy the elves by cutting trees would exist?

Good enough for me, the elves will bring me giant grizzly bears (sadly they don't seem to have any giant great cats this time) with the next caravan so I may breed them.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: can I add an elven trader position to existing save?
« Reply #5 on: October 28, 2021, 02:54:15 pm »

update: a guild representative came. No elven diplomat though. I already have an agreement with them, but I guess if one starts the game like this, no way to annoy the elves by cutting trees would exist?

Good enough for me, the elves will bring me giant grizzly bears (sadly they don't seem to have any giant great cats this time) with the next caravan so I may breed them.
The stock raws should already have Diplomats, but they don't arrive at the same time as the caravan - they show up a bit earlier or later, and they also only show up once you have a Baron.

Also, if you wanted the Trader position to be named something other than "Guild Representative" (which is appropriate for Human civilizations but probably not the Elves), you could've renamed it in the script before running it.
« Last Edit: October 28, 2021, 02:55:58 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #6 on: October 30, 2021, 12:14:39 pm »

Oh, maybe the diplomat will come later then, thought he also came with the caravan. I'll keep an eye out! (I already had a diplomat visit during this save, so the requirements are met. I do have a baron.)

And I don't mind the trader being named after the human ones. Since elves apparently don't have them natively, I can just pretend that the humies spread their culture (and guilds) to elven lands. Works for me!

I *am* a bit disappointed in the "no giant lions" bit though. Maybe I should contact some other elven civs...
From what I've read, that would mean sending out a dwarf on a mission to one of their sites, yelling "Yo! Give us Tribute!", them responding "Or what, shorty?" and him then cleverly segueing into "Or at least a trade caravan, obviously!"
Logged

Schmaven

  • Bay Watcher
  • Abiding
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #7 on: October 30, 2021, 10:58:21 pm »

I *am* a bit disappointed in the "no giant lions" bit though. Maybe I should contact some other elven civs...
From what I've read, that would mean sending out a dwarf on a mission to one of their sites, yelling "Yo! Give us Tribute!", them responding "Or what, shorty?" and him then cleverly segueing into "Or at least a trade caravan, obviously!"

That's how I do it.  Elves are easy because without wagons, they all can share a single trade depot.  When you go to trade, it gives you a list to choose which 1 to trade with.
Logged

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #8 on: October 31, 2021, 07:28:43 am »

Oh, that's neat with the "choose which one to talk to"!

Also, good point. If I ever get multiple human/dwarf caravans, they might block each others' pathing with their wagons. Multiple trade depots and entrances to them might be needed at that point.
Logged

Syndic

  • Bay Watcher
    • View Profile
Re: can I add an elven trader position to existing save?
« Reply #9 on: October 31, 2021, 07:33:13 am »

update: just got a visit from the diplomat. Guess he skipped a year to make his new schedule fit? (he arrived just *before* the caravan and the trader)
Logged