Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What controls monarchs migrating to your fortress?  (Read 1452 times)

GoblinCookie

  • Bay Watcher
    • View Profile
What controls monarchs migrating to your fortress?
« on: March 09, 2015, 01:17:01 pm »

I am thinking about modding Forgotten Realms to make the default creatures playable but while I can track down the mechanism by which barons, counts and dukes are created I cannot track down the mechanism by which monarchs migrate to sufficiantly large and advanced fortresses.

It would seem the mechanism is hard-coded and not alterable in any way.  I need to know how it works however in order to properly set things up, does it work in either of the following ways.

1. The game looks for a position with MONARCH file name and then it brings the monarch over with his family.

2.  The game simply looks for nobles that are neither SITE nor LAND_HOLDER, gathers them together and chucks them at your fort in one group with their families.

3. The game takes the noble with priority 1 and brings him over with his family.

4. The game takes the noble with the highest priority and brings him over with his family.
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #1 on: March 10, 2015, 07:33:09 am »

My best guess would be the [RULES_FROM_LOCATION] tag, but that is just a guess.
Logged

GoblinCookie

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #2 on: March 10, 2015, 12:58:01 pm »

My best guess would be the [RULES_FROM_LOCATION] tag, but that is just a guess.

That would be very bad guess as  RULES_FROM_ LOCATION has no function in Fortress Mode at all.  It actually decides where characters are deployed in AI settlements.

Trouble with this whole thing is that it is massive pain to test.  I know that FORCED_ADMINISTRATOR has a special function, maybe MONARCH does as well.  I guess we shall never know and we must work on the assumption that MONARCH is special. 
« Last Edit: March 10, 2015, 01:11:24 pm by GoblinCookie »
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #3 on: March 10, 2015, 01:26:46 pm »

As I said a guess.
Logged

Trainzack

  • Bay Watcher
  • The universe is, and we are.
    • View Profile

vjmdhzgr

  • Bay Watcher
  • Hehehe
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #5 on: March 11, 2015, 10:05:49 pm »

I'm fairly certain it's http://dwarffortresswiki.org/index.php/DF2014:Entity_token#LAND_HOLDER_TRIGGER.
Land holder trigger is for barons, counts, and dukes, not monarchs. As for what causes it, MONARCH is definitely not an exception in the code as it works just fine with copies of the monarch that have been renamed. So it's probably one of those other three guesses and it would be interesting to test it, but of course that requires making several fortresses that all need to reach 140 population which would take quite a while.
Logged
Its a feature. Impregnating booze is a planned tech tree for dwarves and this is a sneak peek at it.
Unless you're past reproductive age. Then you're pretty much an extension of your kids' genitalia

Eldin00

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #6 on: March 12, 2015, 01:10:14 am »

So correct me if I'm wrong here, but when the monarch moves in, so does the outpost liason, but not any generals/lieutenants/captains, right? (I haven't actually tried to get a monarch in my fort in .40.xx yet, so it's been a while since I've had one move in) So given that pattern, I'm going to guess that it selects any positions which lack the [SITE] tag, and have either of [RESPONSIBILITY:ESTABLISH_COLONY_TRADE_AGREEMENTS] or [RULES_FROM_LOCATION], and then throws in their spouses (and children?) and a suitable squad of guards.
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #7 on: March 12, 2015, 06:21:12 am »

[RULES_FROM_LOCATION] a horrible guess, I think not.
Logged

Eldin00

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #8 on: March 12, 2015, 03:28:15 pm »

Well, looking through the raws, the tags which the monarch has and no other non-site noble has are:

[RESPONSIBILITY:MILITARY_GOALS]
[PRECEDENCE:1]
[RULES_FROM_LOCATION]

Additionally, the following 2 tags are shared only by the FORCED_ADMINISTRATOR position:
[EXPORTED_IN_LEGENDS]
[DETERMINES_COIN_DESIGN]

So it seems likely to me that one of those tags (or some combination of them) is involved in the selection process.

It may be worth noting that the elven LEADER position (the queen, the only other 'ruler of a civilization' position we see in the raws) has

[RESPONSIBILITY:MILITARY_GOALS]
[RULES_FROM_LOCATION]
[EXPORTED_IN_LEGENDS]

in common with the list for the dwarven MONARCH position, but since elves aren't designed to be playable, it may not be relevant.
Logged

Trainzack

  • Bay Watcher
  • The universe is, and we are.
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #9 on: March 15, 2015, 01:04:08 am »

Out of all those, [RULES_FROM_LOCATION] looks the most likely.

Edit: Wait, expedition leader has that too. So most likely [PRECEDENCE:1]?
« Last Edit: March 15, 2015, 01:08:15 am by Trainzack »
Logged

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: What controls monarchs migrating to your fortress?
« Reply #10 on: March 15, 2015, 10:21:22 am »

RESPONSIBILITY:LAW_MAKING is the tag used for determining which noble is the 'ruler' of their particular group.  The SITE tag ties them to a particular site, otherwise they will be appointed at civ-level and live at the capital (and presumably show up at your fortress if it becomes the capital).  So the civ's 'leader' is probably any noble with the LAW_MAKING responsibility, and no SITE tag.  Not sure what happens if multiple nobles fit this criteria.

I don't think RULES_FROM_LOCATION is even needed for rulership, from what I understand this just ensures that they will live in the 'royal building' (mead halls, home tree, etc.) if one is available.

Precedence has very little 'strong' behaviors associated with it, it basically determines whether a noble with SLEEP_PRETENSION will get upset if someone lower than them has a nicer room.  I think it also affects the order that nobles are listed on the noble screen.

Eldin00

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #11 on: March 16, 2015, 01:11:53 am »

In the vanilla entry for dwarves, the land holder positions (baron, count, duke) have RESPONSIBILITY:LAW_MAKING, and do not have the [SITE] tag. So it could be part of the equation, but I don't see how it could be the only determining factor.
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #12 on: March 16, 2015, 11:50:00 am »

Well, the land holders also have LAND_HOLDER, so the monarch not having LAND_HOLDER could do the rest.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

EuchreJack

  • Bay Watcher
  • Lord of Norderland - Lv 20 SKOOKUM ROC
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #13 on: March 16, 2015, 08:57:05 pm »

If your site is the last bastion of your dwarven civilization, it automatically becomes the capital and a random person becomes the king/queen.

I've had it happen with extremely small populations that lost their last non-playable site in the first couple of years of play.

GoblinCookie

  • Bay Watcher
    • View Profile
Re: What controls monarchs migrating to your fortress?
« Reply #14 on: March 17, 2015, 10:58:51 am »

If your site is the last bastion of your dwarven civilization, it automatically becomes the capital and a random person becomes the king/queen.

I've had it happen with extremely small populations that lost their last non-playable site in the first couple of years of play.

Yes that makes sense though I have never seen it happen, probably because it happens annually and the fort from an extinct civilization I created once accidentally went save-game corrupt in a year. 

As I understand it, the monarch is not special as such.  You simply become the capital instead of the place that previously was the capital when the hardcoded conditions are met and all non-site, non-landholder positions head to your fort.  This I guess is what I shall be working on the assumption is the case. 
Logged