Merchant of "Town X" never appears in my mod...

Users who are viewing this thread

gamerdude873

Veteran
Hey I was making a mod that split up Calradia into 35 different factions, and right now I'm just using the vanilla character gen. After the character is created, noramally one would duke it out with a bandit and own his face. After that The Merchant of "Town you are At" should appear. Instead, in my mod, a novice fighter appeared who tried to kill me! What gives? I never changed anything that had to do with the merchant directly.

If this helps, I've divided up the factions so that every city is it's own country with a 1-3 castles, and some castles are independent. I'm almost done with this too, so I would love it if someone might explain what happened. Is there some work around that needs to be implemented? Sorry if this has been posted before, but the search function is not very useful (yes I did search.)

Cheers, GD873
 
Update on the issue....

Although the Merchant himself doesn't run out to meet you, I've discovered that if I let myself be beaten, I can then go inside and meet the merchant. But why the dude doesn't come out and meet me is still a mystery.
 
You need to spawn him in mission_templates.py, under alley_fight.
Personally, I modified it so that the merchant's id is stuck in a global variable when you first choose the starting town, and then you don't have to check again in mission_templates.
You should do the same thing for his relative - otherwise since the game can't spawn him, it spawns troop -1, which is you, and reassigns his team, and then you'll have an interesting time being beat up by your own men. Press Ctrl+F5 before you kill the last looter to have a showdown with yourself.
 
I'll admit that I have very little experience with python. But I was able to resolve this problem, only to discover that after collecting 5 men the merchant had disappeared from the tavern altogehter. As such i haven't been able to find and test the possible/probable issue with his relative yet. I will keep looking to see if i can figure this out, but in the meantime help is always appreciated!

Cheers, GD873

Edit: Thanks Somebody for the Global Variable tip, but even though I know what it is and what you did, I have no idea how to do that in python or where to begin with Warband. I'm still finding my way around under the hood. If you wanted, you could post an example, but that's up to you. Thanks again!
 
Sure, why not. Find where it is that you designate the starting town, for example
Code:
 ("town_5",[(eq, "$current_startup_quest_phase", 0),],"take a pilgrimage to Ellis, in the Lion Throne.",
       [
         (assign, "$current_town", "p_town_5"),
         (assign, "$g_starting_town", "$current_town"),
         #(assign, "$g_journey_string", "str_journey_to_ellis"),
         (assign, "$troop_of_merchant", "trp_rhodok_merchant"),
        ...
Assign the troop of the merchant here. There are several places where this is checked, most of which check for $g_starting_town and then reassigns the merchant, which is pointless. Notice I've taken out the global variable for the journey string - this will be reassigned dynamically since there is one merchant per starting town per string, and it is only used once. We put the memory allocation to much better use with the merchant.
Code:
  ("start_phase_2_5",mnf_disable_all_keys,
    "{!}{s16}",
    "none",
    [
      (set_show_messages, 1),
      (troop_equip_items, "trp_player"),
      (str_store_party_name, s1, "$g_starting_town"),
      #get starting string
      (store_sub, ":journey_string", "$troop_of_merchant", startup_merchants_begin),
      (val_add, ":journey_string","str_journey_to_vienna"),
      (str_store_string, s16, ":journey_string"),
    ],
    [
      ("continue",[], "Continue...",
       [
         (jump_to_menu, "mnu_start_phase_3"),
       ]),
    ]
  ),
In case you're wondering what set_show_messages and troop_equip_items are for, I've given the player items based on his choice of starting town, but disabled the message that pops up when you receive the item beforehand. I'm reenabling it here and then making the player troop equip the new items. I've calculated the offset for the string here, based on our preassigned merchant id, since there is a one-one ratio. I've then stored this string into the string register 16, which is displayed in the gamen menu right after this one (mnu_start_phase_3).

In start_phase_4 (where you meet the merchant), you need to define the scene where you two will meet.
Code:
        (try_begin),
          (eq, "$current_town", "p_town_1"),
          (assign, ":town_merchant", "trp_nord_merchant"),
          (assign, ":town_room_scene", "scn_town_1_room"),
        (else_try),  ...
You can reuse similar scenes for different merchants (you'll only meet one merchant), or you can check module_scenes.py for more lists. I've actually used a loop here again for each scene - although you can do whatever you want.
Code:
(store_sub, ":offset", "$troop_of_merchant", startup_merchants_begin),
(store_add, ":town_room_scene", ":offset", "scn_town_1_room"),
...
(set_visitor, 9, "$troop_of_merchant"),

And after that, there are a bunch of stuff you'll want to change in module_mission_templates.py.
Whenever you encounter a code block like
Code:
  # (try_begin),
           # (eq, ":starting_town_faction", "fac_kingdom_1"),
           # (assign, ":troop_of_merchant", "trp_swadian_merchant"),
You can go find ":troop_of_merchant" and replace it with its global equivalent, "$troop_of_merchant".

In addition, the game originally assigned unique robbers and relatives to each merchant, but in the end you'll only encounter the robber and the merchant's brother. Look for "trp_relative_of_merchant" - there will be a code block where his identity is assigned according to the starting town and merchant, etc, and he is then spawned after you defeat his captors. If, for your new factions, he isn't assigned, then the game will spawn you. I've also optimized a bunch of this code where it rechecks him with a local variable and replaced it directly with "trp_relative_of_merchant", but the rest is up to you.
 
Thanks Somebody. I'm having a little trouble processing all this right now because I have a fever right now. I've tried implementing what you said to do, but I still can't find the merchant of "X" (in this case Sargoth) afterward he sends me out to collect five men, in the tavern.
Second, perhaps could I get some more context around:
Code:
(store_sub, ":offset", "$troop_of_merchant", startup_merchants_begin),
(store_add, ":town_room_scene", ":offset", "scn_town_1_room"),
...
(set_visitor, 9, "$troop_of_merchant"),

The thing is I don't know exactly where the "store_Sub" goes. Does it replace the whole "try_begin," just parts of it, or does it come afterward?

I'll keep looking as always for things that need adjusting. If this helps at all, I have kept all the same cities, and turned them into city states. The starting places are as follows: Praven is now faction/ kingdom number 8, Reyvadin is 9, Tulga is 15, Sargoth is 16, Jelkala is 5, Shariz is 20. I think what also might be going on is that I still haven't found all the "fac_kingdom_X" that need to be adjusted for this.
 
Thanks! As soon as I can figure out the damn merchant issues I was thinking about running some playtesting around the forum. I was really frustrated with the original set up of only six factions, because whenever you turned around, you found yourself at war with a half-dozen, powerful, angry factions. I figure that I can change that by splitting up the countries into tiny bits, forcing almost constant, but low key wars that the player can easily opt out of. The big issue with the vanilla for me the difficult problem of getting a kingdom started with almost nothing. Some people say it's easy, I don't agree. Also the tiny factions also allow for a more realistic chance of starting a new kingdom.
 
Well I've made a little progress. I am very certain now that the problem lies in me not finding all the "fac_kingdom_X" in the coding and changing them to their appropriate numbers. Jelkala ended up as faction 5, which is also the vanilla Kingdom of Rhodoks. I realized this and was able to progress a little farther than the other normal factions and was able to complete the quest, "Gather 5 men." However, after defeating the bandits, I never recieved a dialogue about where the bandits were hiding the merchant's relative. I probably left a little something out of Somebody's suggestion. My Ibuprofen has kicked in so I might be able to think clearly now.
 
Create a check list of what to do. Do thing in small bit, test it, if it's good then progress to the next step. If you try to do everything at once, you will be confused and you don't know what cause the bug. Also, you forget things that need to be done when you are distracted.

Add the faction first. Forget about the starting quest. The 6 old faction quests still work as long as you choose to start with those. Enter the game and check out how your new factions work. Is the king there? Does he get troops? Are the lord spawning correctly? Are the centers assigned correctly? When testing, enable cheat mode and edit mode in the configure menu and use cheat menus (turn it on and off if you want to).

Here is small check list to start with:
- Add the factions and culture in module_factions
- Create their troops, including kings, lords, ladies, merchant troops... in module_troops
- Create their reinforce template in module_party_templates
- Setting the factions in module_scripts in "game_start" script:
* Assign troop tier to culture
* Assign culture to faction
* Assign king to faction
* Assign king renown
* Assign kingdom banner
* Assign banner to lords (I would skip this until I can set up a better script for it)
* Assign center (walled center only) to faction.
* Assign center to lord (must assign one for the king at the least)
* Optional: assign dispute center
* Assign kingdom adjectives. Need to add the adjective to module_strings
* Initialize faction troop types in script "initialize_faction_troop_types"
* initialze aristocrates. This may be needed later on because the changes you made to troops' faction

You can "clone factions" to make it easier for testing. For example, set generic troops and troop tier of a new kingdom to swadian ones so that you don't have to create troops for all new factions. However, the heroes need to be set up correctly. Sort of creating a template so you can fill in the details later.

Once, you have all new factions set up correctly, lots of other things will work based on the constants range as long as you stay within the range.

For the start merchants:
- Check all menu where the merchants are assign based on the starting town choice.
- Check the tavern menu and add the merchants for the starting town above.
- Check the dialogs
- Make sure the merchant are added to the mission templates correctly.
 
From what your saying Phoenix, it would probably be best to start over. I have more or less followed that checklist, but in the end I feel that what I need most right now is a clean slate. I've learned a lot about what needs doing though. Ah, well, the only real writing is re-writing, as they say. The same applies to the aggravating art of modding :evil:. Time to take a break from this and grab some homebaked cookies. Start again later with fresh mind...
 
Deactivating the first part would also lead to less AARs starting with the merchant quest.
I would also add to the list of items to add stuff in game_quick_start, defining troops, banners, then items for the custom battle and multiplayer. In addition, open up module_meshes and assign faction "arms", as well as reusing encounter pictures in certain cases. Otherwise the faction notes display will only show the kingdom banner, as long as you've defined it that is. If you search for fac_kingdom_x there is usually a list of assignments for each faction in many files, simply add yours below it.
In addition to the kingdom adjectives, you'll want to add faction_titles, which are attached to lord's names when they defect.
 
Its great to have an active forum for this game. Thanks, I'll look into that as soon as I remotivate myself to go back to work. :grin:
 
This topic is close to the problem I'm having (actually I had the exact same problem which is why it turned up in my search, but the info here fixed it, thanks), so I thought I'd post here instead of starting a new thread. I got the merchant quest to work, but when I go to the hideout to rescue the brother it ends up in a field (which I don't mind) and my troops don't help fight or even follow orders to get out of my way (which I do mind) and when I killed the bandits the brother never showed up. I should be able to figure out the problem if only I knew exactly where in all the files to find the part that controls this part of the quest, can anyone point it out for me?
 
HannibalTheCannibal said:
This topic is close to the problem I'm having (actually I had the exact same problem which is why it turned up in my search, but the info here fixed it, thanks), so I thought I'd post here instead of starting a new thread. I got the merchant quest to work, but when I go to the hideout to rescue the brother it ends up in a field (which I don't mind) and my troops don't help fight or even follow orders to get out of my way (which I do mind) and when I killed the bandits the brother never showed up. I should be able to figure out the problem if only I knew exactly where in all the files to find the part that controls this part of the quest, can anyone point it out for me?

I got this as well, the only solution I could find was removing the quest altogether.
 
Back
Top Bottom