Adding more claimants for the same throne

Users who are viewing this thread

A while ago I've come across a tutorial (or discussion) on the forum here on adding more claimants for the same nation. One of the replies was that it was a matter of simply creating the new claimants in mod_troops, and copy-pasting and editing their conversations in mod_strings. However, trying that I came to the realization that there's more to it, in particular because the claimant strings only accommodate a single claimant for each faction. That is, trying to talk to the new claimants only had them tell you the base claimant's story. For instance, I wanted to add more claimants for Swadia, but each new claimant would start telling me Isolla's story. Additionally, digging around mod_scripts I've also come across other bits that deal with claimants, for example their "home town".
So, does anybody know if it's at all possible to add more than one claimant, and if so, may I have a tutorial or some tips?
Thank you.
 
Last edited:
Solution
There is more behind it as you already found out. The best way for you is basically to first sketch out how the normal claimants are working, how their dialogs and connections are done. Analysing the code for them opens up the spots which you need to edit to implement multiple claimants per faction.
As an example, it was the first thing I have found orientating on the string "str_swadian_rebellion_pretender_intro", you can look into module_dialogs.py (using here of course the Native module system, line 5540):
Rich (BB code):
#Rebellion changes begin
  [anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (eq, "$g_talk_troop", "$supported_pretender"),
     ],
   "I await your counsel, {playername}."...
There is more behind it as you already found out. The best way for you is basically to first sketch out how the normal claimants are working, how their dialogs and connections are done. Analysing the code for them opens up the spots which you need to edit to implement multiple claimants per faction.
As an example, it was the first thing I have found orientating on the string "str_swadian_rebellion_pretender_intro", you can look into module_dialogs.py (using here of course the Native module system, line 5540):
Rich (BB code):
#Rebellion changes begin
  [anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (eq, "$g_talk_troop", "$supported_pretender"),
     ],
   "I await your counsel, {playername}.", "supported_pretender_talk", [
     ]],

  [anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
     (assign, "$pretender_told_story", 0),
     (eq, "$g_talk_troop_met", 0),
     (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
     ],
   "Do I know you?.", "pretender_intro_1", []],
  [anyone|plyr ,"pretender_intro_1", [], "My name is {playername}. At your service.", "pretender_intro_2", []],
  [anyone|plyr ,"pretender_intro_1", [], "I am {playername}. Perhaps you have heard of my exploits.", "pretender_intro_2", []],

  [anyone ,"pretender_intro_2", [(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
                                 (val_sub, ":rebellion_string", "fac_kingdom_1"),
                                 (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_intro"),
                                 (str_store_string, 48, ":rebellion_string"),],
   "{s48}", "pretender_intro_3", []],
Here you need to find out how the different dialogs are getting selected for each claimant. I marked the relevant lines in red: First the slot is getting taken which gives us the information what the original faction of the claimant is. It's an integer which should simply be the faction number but gives the initial value. We are substracting next this value with -1, setting the base for the next step which is basically adding the id-number of the string "str_swadian_rebellion_pretender_intro".
This way one does not need to set up the dialog for each single claimant but it gets assigned automatically: If the original faction is faction 3 (Khergits), minus 1 for "fac_kingdom_1", plus the id of "str_swadian_rebellion_pretender_intro" gives you the id of the string "khergit_rebellion_pretender_intro" which is then getting used in this dialog.
Now you already see the flaw for your plan to add multiple claimants per faction: The relevant variable here is the original faction of the claimant. If there are multiple claimants of the same faction the result for "rebellion_string" is always the same. For your workaround you now need to find out the best way to get your new claimants into the system. If you add a new pretender intro string behind the ones of the others, you need to find an if-clause which takes it into account at specific conditions. Here you should first determine how many new claimants you want to implement and how many for which factions it are since all of that affects this calculation and the needed if-clauses at it.

The same systematic is getting used for all other stuff involving the claimants. So the best is really first to note down how the normal claimants work, at which positions the code snippets are all and then analyse them step for step.

In module_strings.py search for swadian_rebellion_pretender_intro. This gives all the pretenders/claimants backstory in four blocks - intro, story_1, story_2 and story_3
Directly underneath these are two more blocks of dialogue - monarch_response_1 and monarch_response_2

If you want all their dialogue options I suggest you do a full search for instances of pretender, liege and monarch.

I hope I could help you with the informations given here.
 
Upvote 0
Solution
There is more behind it as you already found it. The best way for you is basically to first sketch out how the normal claimants are working, how their dialogs and connections are done. Analysing the code for them opens up the spots which you need to edit to implement multiple claimants per faction.
As an example, it was the first thing I have found orientating on the string "str_swadian_rebellion_pretender_intro", you can look into module_dialogs.py (using here of course the Native module system, line 5540):
Code:
#Rebellion changes begin
  [anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (eq, "$g_talk_troop", "$supported_pretender"),
     ],
   "I await your counsel, {playername}.", "supported_pretender_talk", [
     ]],

  [anyone ,"start",
   [
     (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
     (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
     (assign, "$pretender_told_story", 0),
     (eq, "$g_talk_troop_met", 0),
     (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
     ],
   "Do I know you?.", "pretender_intro_1", []],
  [anyone|plyr ,"pretender_intro_1", [], "My name is {playername}. At your service.", "pretender_intro_2", []],
  [anyone|plyr ,"pretender_intro_1", [], "I am {playername}. Perhaps you have heard of my exploits.", "pretender_intro_2", []],

  [anyone ,"pretender_intro_2", [(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction),
                                 (val_sub, ":rebellion_string", "fac_kingdom_1"),
                                 (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_intro"),
                                 (str_store_string, 48, ":rebellion_string"),],
   "{s48}", "pretender_intro_3", []],
Here you need to find out how the different dialogs are getting selected for each claimant. I marked the relevant lines in red: First the slot is getting taken which gives us the information what the original faction of the claimant is. It's an integer which should simply be the faction number but gives the initial value. We are substracting next this value with -1, setting the base for the next step which is basically adding the id-number of the string "str_swadian_rebellion_pretender_intro".
This way one does not need to set up the dialog for each single claimant but it gets assigned automatically: If the original faction is faction 3 (Khergits), minus 1 for "fac_kingdom_1", plus the id of "str_swadian_rebellion_pretender_intro" gives you the id of the string "khergit_rebellion_pretender_intro" which is then getting used in this dialog.
Now you already see the flaw for your plan to add multiple claimants per faction: The relevant variable here is the original faction of the claimant. If there are multiple claimants of the same faction the result for "rebellion_string" is always the same. For your workaround you now need to find out the best way to get your new claimants into the system. If you add a new pretender intro string behind the ones of the others, you need to find an if-clause which takes it into account at specific conditions. Here you should first determine how many new claimants you want to implement and how many for which factions it are since all of that affects this calculation and the needed if-clauses at it.

The same systematic is getting used for all other stuff involving the claimants. So the best is really first to note down how the normal claimants work, at which positions the code snippets are all and then analyse them step for step.



I hope I could help you with the informations given here.
Oh damn, I forgot to made the edits in mod_dialogues! ?
Thanks for the reply! :smile:
 
Upvote 0
Back
Top Bottom