Problem with excessive indictments & renunciations OSP Special Merchant

Users who are viewing this thread

gdwitt

Knight at Arms
Note: Go to page 2 middle to see the Indictments thread info
The top thread is a tutorial for creating special merchants.
////////////////////////////////////////////////////////////////////
Goal:  Add special characters who sell special, even magical, items to player.
Not using the operator troop_add_merchandise_with_faction, because it pulls in garbage that has not been assigned to factions.
Make special characters able to sell special items through the common trade window rather than the current dialog-description process in Brytenwalda.

Challenges: troop_add_merchandise_with_faction is troublesome. Even if 90% of items have a faction, it will make sure that at least half the items are non-faction items.
Imitating the booksellers don't work because they sell books. Other characters will dress in the gear you give them, making it unavailable.
Spawning new characters in scenes in a complicated process.
************Discovery Log*****************************
I decided to add special merchants with exclusive imported goods to BW.
I have finally succeeded in locating these new troops in at least 1 assigned town (there should be 7 in 7 specific towns).
I gave each merchant his own faction and appended that faction to the special items.
However, when I ask for the inventory, I am getting the gear of a weaponsmith.
Here is my script so far which merges the normal refresh_weaponsmith with refresh_armorer and refresh_bandit_merchant (I show it at bottom):
("refresh_special_merchants1",
Code:
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 230),
    #(try_for_range, ":cur_merchant", special_merchants_begin, special_merchants_end),
	  #(store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      #(val_add, ":cur_town", towns_begin), try_begin), 
      #(this_or_next|eq, ":cur_merchant", trp_specialmerch1),
      #(eq, ":cur_merchant",trp_specialmerch7),
	  #(troop_clear_inventory, ":cur_merchant"),
	  (troop_clear_inventory, "trp_specialmerch7"),
	  (troop_clear_inventory, "trp_specialmerch1"),
      #(party_get_slot, fac_merchants1, ":cur_town", slot_center_original_faction),
      #(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_one_handed_wpn, 4),#gdw
      (troop_add_merchandise_with_faction, "trp_specialmerch7", "fac_merc1", itp_type_two_handed_wpn, 4),#gdw
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 4),#gdw
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 5),#gdw
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 3),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 5),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", "fac_merc1", itp_type_body_armor, 10),#gdw
      (troop_add_merchandise_with_faction, ":cur_merchant", "fac_merc2", itp_type_body_armor, 10),#gdw
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_head_armor, 1),
	  #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_foot_armor, 7),#gdw
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_hand_armor, 1),#gdw
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"), 
      (store_troop_gold, reg6, ":cur_merchant"),
      (lt, reg6, 1500),#gdw
                       (store_random_in_range,":new_gold",1300,2300), #oro inicial chief cambiado#gdw
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    #(try_end),
  ]),

("cf_refresh_bandit_merchants",#gdw read for Krag
Code:
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 100),
      (troop_clear_inventory, "trp_brigand_hideout_merchant"),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_one_handed_wpn, 5),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_two_handed_wpn, 5),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_polearm, 5),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_shield, 6),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_bow, 4),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_crossbow, 1),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_thrown, 5),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_bolts, 1),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_pistol,1), #chief sling
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_bullets,1),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_body_armor, 6),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_head_armor, 6),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_foot_armor, 6),                                              
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_hand_armor, 3),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_horse, 5),
      (troop_add_merchandise_with_faction, "trp_brigand_hideout_merchant", "fac_outlaws", itp_type_goods, 5),                                   
      (troop_sort_inventory, "trp_brigand_hideout_merchant"),
      (store_troop_gold, reg6, "trp_brigand_hideout_merchant"),
      (lt, reg6, 1000),
      (store_random_in_range,":new_gold",1000,2000), #oro inicial chief cambiado
      (call_script, "script_troop_add_gold", "trp_brigand_hideout_merchant", ":new_gold"),
  ]),

***********************************Cutting to the point, the solution I chose:
In the end, the chests were not necessary.
I didn't use add merchandise with faction.
Nor could I figure out a way to keep the merchants from autoequipping their gear.
This is my working setup:
Add troops in enclosed scenes. I had problems when they were in the town center as you saw in the bug thread.
To do this, visit the town and find buildings with separated scenes, like taverns or merchant buildings.
Hit control-e in edit mod and "Add object" Entry point to the place where the merchant will stand.
Record the number of the new entry point for the troops file.
Save the scene and be sure that it is included in any archive files to replace the old scene object.

Now in module_troops, add or repurpose the troops with the new scene and entry  point like this:
Code:
["specialmerch1","Harenbili","Harenbili",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_1_store|entry(1), reserved, fac_commoners,[itm_leather_aprontunic,itm_ankleboots,],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch2","Maonirn","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_11_store|entry(1), 0, fac_merc1,[itm_leather_aprontunic,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch3","Uormuin","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_26_store|entry(2), 0, fac_merc1,[itm_ptunic3,   itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch4","Godgyfu","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_10_store|entry(1), 0, fac_merc1,[itm_leather_tunic1,  itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch5","Dounerth","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_28_store|entry(1), 0, fac_merc1,[itm_ptunic3,         itm_ankleboots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch6","Aed","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_29_store|entry(1), 0, fac_merc1,[itm_arena_tunic_green,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch7","Fogartach","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_40_store|entry(2), 0, fac_merc1,[itm_leather_aprontunic,itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],

Script the addition of items with add_items
("refresh_special_merchants1",
Code:
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 230),
    #(try_for_range, ":cur_merchant", special_merchants_begin, special_merchants_end),
	  #(store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      #(val_add, ":cur_town", towns_begin), try_begin), 
      #(this_or_next|eq, ":cur_merchant", trp_specialmerch1),
      #(eq, ":cur_merchant",trp_specialmerch7),
      (troop_clear_inventory, "trp_specialmerch1"),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor11res,2),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor14res,1),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor15res,1),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor18res,1),
	  (troop_add_items, "trp_specialmerch1", itm_saxonhelmt4face,1),
	  (troop_add_items, "trp_specialmerch1_chest", itm_noblearmor1res, 4),
	  (troop_clear_inventory, "trp_specialmerch2"),
	  (troop_add_items, "trp_specialmerch2", itm_longmail_coat_kingred,1),
	  (troop_add_items, "trp_specialmerch2", itm_noblearmor8res, 1),
	  (troop_add_items, "trp_specialmerch2", itm_goat_nobleman_helm, 1),
	  (troop_add_items, "trp_specialmerch2", itm_resanglehelmet_gold,1),
	  (troop_add_items, "trp_specialmerch2", itm_noblearmor21res,1),

Add a trigger:
Code:
(0.0, 0, 228.0, [],
  [
    (call_script, "script_refresh_special_merchants1"),
  ]),

Dialog:
Code:
[anyone, "start", [(is_between, "$g_talk_troop", special_merchants_begin, special_merchants_end,),],
   "Good day {sir/madam}, what do you want? I'm quite busy", "special_merchant_talk", []],
  [anyone|plyr, "special_merchant_talk", [], "I was told you have some of the finest gear in Brytenwalda. What makes your goods so special?", "herrero_buy", []],
  #[anyone,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I only sell the noblest of the noble. Are you sure you qualify?", "herrero_buy2", []], 
  [trp_specialmerch1,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "Haven't you hard that the Lorica is the latest must-have in Paris? I have an exclusive connection to merchants in Paris who import from all over Europe", "herrero_buy2", []],
          
  [trp_specialmerch2,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "The warlords of Mierce prefer Red when leading in battle. Red is for victory!", "herrero_buy2", []],
  [trp_specialmerch3,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I have one of the best purple dyes from a secret Greek Island. Leaders come to me for Royal armor or tunics.", "herrero_buy2", []],
  [trp_specialmerch4,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I import scale armor from a merchant in Byzantium. Both women and men enjoy these for their spaciousness and comfort.", "herrero_buy2", []],
  [trp_specialmerch5,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "White and Gold were the colors of King Arthur's court. See the armor of Christian nobles.", "herrero_buy2", []],
  [trp_specialmerch6,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I use the finest purple imported from Italy. Purple Armor on the battlefield will make you a leader.", "herrero_buy2", []],
  [trp_specialmerch7,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "Blue is the traditional color of leadership on these islands while green is a mark of virtue.", "herrero_buy2", []],
  #[anyone|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch1_chest"),]],

  [trp_specialmerch1|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch1"),]],##works
  [trp_specialmerch2|plyr, "herrero_buy2", [], "I certainly want to be victorious like Penda.","herrero_window",[(change_screen_trade, "$g_talk_troop"),]], ##works
  [trp_specialmerch3|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[[change_screen_trade]]], ##works
  [trp_specialmerch4|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, trp_specialmerch4_chest),]], ##works
  [trp_specialmerch5|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch5_chest"),]], ##works
  [trp_specialmerch6|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, trp_specialmerch6),]], ##works
  [trp_specialmerch7|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch7"),]], ##works
  #[anyone|plyr, "herrero_buy2", [], "I am certainly. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch7"),]], ##works
  [anyone,"herrero_buy", [], "Sorry, friend, but my work is for prestigious men only (450 renown). Come back when you improve your renown.", "close_window",[]],
  [anyone,"herrero_window", [], "Good Luck. Remember my name if you need something. Farewell.", "close_window",[]],

Notice that this worked 6 different ways with the screen_trade command!
Even when I put trp_specialmerch4_chest, it still showed the gear from trp_specialmerch4!!
Why is that? It completely ignored the gear I was assigning to the trp_chests.
 
Couldn't you just kinda clone the way book merchants work in WB?

Code:
# Tavern traveler.
  ["tavern_bookseller_1","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots,
               itm_book_tactics, itm_book_persuasion, itm_book_wound_treatment_reference, itm_book_leadership, 
               itm_book_intelligence, itm_book_training_reference, itm_book_surgery_reference],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2],
  ["tavern_bookseller_2","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots,
               itm_book_wound_treatment_reference, itm_book_leadership, itm_book_intelligence, itm_book_trade, 
               itm_book_engineering, itm_book_weapon_mastery],def_attrib|level(5),wp(20),knows_common,merchant_face_1, merchant_face_2],

Code:
  #script_update_booksellers
  # INPUT: none
  # OUTPUT: none
  ("update_booksellers",
    [(try_for_range, ":town_no", towns_begin, towns_end),
       (party_set_slot, ":town_no", slot_center_tavern_bookseller, 0),
     (try_end),
     
     (try_for_range, ":troop_no", tavern_booksellers_begin, tavern_booksellers_end),
       (store_random_in_range, ":town_no", towns_begin, towns_end),
       (party_set_slot, ":town_no", slot_center_tavern_bookseller, ":troop_no"),
     (try_end),
	 

	 
     ]),

Dunno if this is all of it, but their the example "unique merchants" that you're looking for I think.
 
I was looking at that but I wanted these special merchants to have a refreshable inventory of at least 12 items each.
Have you noticed that when you buy a book from a bookseller and sell them something, they keep that something for the rest of the game?

Update merchants wouldn't be needed because they would be at a fixed location.

This could become a great OSP pack if someone chips in.
The idea is to have special clothes, armors and weapons from Arabia or Byzantium for the backwards dark age lands.
It would also make it unnecessary to visit every town on the map 20 times if you really just want one special item for your troop.

Once I figure this out, I would fix the broken bandit merchant and add a monastery merchant.

I'm sure this has been done in some mod somewhere.
 
gdwitt said:
I was looking at that but I wanted these special merchants to have a refreshable inventory of at least 12 items each.
Have you noticed that when you buy a book from a bookseller and sell them something, they keep that something for the rest of the game?

Update merchants wouldn't be needed because they would be at a fixed location.

This could become a great OSP pack if someone chips in.
The idea is to have special clothes, armors and weapons from Arabia or Byzantium for the backwards dark age lands.
It would also make it unnecessary to visit every town on the map 20 times if you really just want one special item for your troop.

Once I figure this out, I would fix the broken bandit merchant and add a monastery merchant.

I'm sure this has been done in some mod somewhere.

just add these two things to the dialog with that special troop: clean inventory, refresh special items
 
Yeah, somewhere in here might be some clues:

Code:
  # script_refresh_center_inventories
  ("refresh_center_inventories",
  [   	
    (set_merchandise_modifier_quality,150),
    (reset_item_probabilities,100),	    

    # Add trade goods to merchant inventories
    (try_for_range,":cur_center",towns_begin, towns_end),
      (party_get_slot,":cur_merchant",":cur_center",slot_town_merchant),
      (reset_item_probabilities,100),
      (assign, ":total_production", 0),
      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
        (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
		(assign, ":cur_production", reg0),

        (try_for_range, ":cur_village", villages_begin, villages_end),
		  (party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"),
          (call_script, "script_center_get_production", ":cur_village", ":cur_goods"),
		  (val_div, reg0, 3),
		  (val_add, ":cur_production", reg0),
		(try_end),		

		(val_max, ":cur_production", 1),
		(val_mul, ":cur_production", 4),

		(val_add, ":total_production", ":cur_production"),
      (try_end),

	  (party_get_slot, ":town_prosperity", ":cur_center", slot_town_prosperity),
	  (assign, ":number_of_items_in_town", 25),

	  (try_begin), #1.0x - 2.0x (50 - 100 prosperity)
	    (ge, ":town_prosperity", 50),
		(store_sub, ":ratio", ":town_prosperity", 50),
		(val_mul, ":ratio", 2),
		(val_add, ":ratio", 100),
		(val_mul, ":number_of_items_in_town", ":ratio"),
		(val_div, ":number_of_items_in_town", 100),
	  (else_try), #0.5x - 1.0x (0 - 50 prosperity)
		(store_sub, ":ratio", ":town_prosperity", 50),
		(val_add, ":ratio", 100),
		(val_mul, ":number_of_items_in_town", ":ratio"),
		(val_div, ":number_of_items_in_town", 100),
	  (try_end),

	  (val_clamp, ":number_of_items_in_town", 10, 40),	

	  (try_begin),
	    (is_between, ":cur_center", castles_begin, castles_end),
	    (val_div, ":number_of_items_in_town", 2),
      (try_end),

      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
        (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
		(assign, ":cur_production", reg0),

        (try_for_range, ":cur_village", villages_begin, villages_end),
		  (party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"),
          (call_script, "script_center_get_production", ":cur_village", ":cur_goods"),
		  (val_div, reg0, 3),
		  (val_add, ":cur_production", reg0),
		(try_end),		

		(val_max, ":cur_production", 1),
		(val_mul, ":cur_production", 4),

        (val_mul, ":cur_production", ":number_of_items_in_town"),
		(val_mul, ":cur_production", 100),
		(val_div, ":cur_production", ":total_production"),
        (set_item_probability_in_merchandise, ":cur_goods", ":cur_production"),						  
      (try_end),

	  (troop_clear_inventory, ":cur_merchant"),
      (troop_add_merchandise, ":cur_merchant", itp_type_goods, ":number_of_items_in_town"),

      (troop_ensure_inventory_space, ":cur_merchant", 20),
      (troop_sort_inventory, ":cur_merchant"),
      (store_troop_gold, ":cur_gold",":cur_merchant"),
      (lt,":cur_gold",1500),
      (store_random_in_range,":new_gold",500,1000),
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end), 	
  ]), 

  # script_refresh_center_armories
  ("refresh_center_armories",
  [
    (reset_item_probabilities, 100),
	(set_merchandise_modifier_quality, 150),    
	(try_for_range, ":cur_merchant", armor_merchants_begin, armor_merchants_end),    
	  (store_sub, ":cur_town", ":cur_merchant", armor_merchants_begin),
	  (val_add, ":cur_town", towns_begin),
	  (troop_clear_inventory, ":cur_merchant"),
	  (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),    
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_body_armor, 16),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_head_armor, 16),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_foot_armor, 8),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_hand_armor, 4),
	  (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
	  (troop_sort_inventory, ":cur_merchant"),
	  (store_troop_gold, reg6, ":cur_merchant"),
	  (lt, reg6, 1000),
	  (store_random_in_range, ":new_gold", 250, 500),
	  (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (end_try),
  ]),

  # script_refresh_center_weaponsmiths
  ("refresh_center_weaponsmiths",
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 150),
    (try_for_range, ":cur_merchant", weapon_merchants_begin, weapon_merchants_end),
	  (store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      (val_add, ":cur_town", towns_begin), 
	  (troop_clear_inventory, ":cur_merchant"),
      (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"), 
      (store_troop_gold, reg6, ":cur_merchant"),
      (lt, reg6, 1000),
      (store_random_in_range, ":new_gold", 250, 500),
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end),
  ]),

  # script_refresh_center_stables
  ("refresh_center_stables",
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 150),
    (try_for_range, ":cur_merchant", horse_merchants_begin, horse_merchants_end),
	  (troop_clear_inventory, ":cur_merchant"),
      (store_sub, ":cur_town", ":cur_merchant", horse_merchants_begin),
      (val_add, ":cur_town", towns_begin),
      (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_horse, 5),
      (troop_ensure_inventory_space, ":cur_merchant", 65),
      (troop_sort_inventory, ":cur_merchant"),
      (store_troop_gold, ":cur_gold", ":cur_merchant"),
      (lt, ":cur_gold", 600),
      (store_random_in_range, ":new_gold", 250, 500),
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end),
  ]),
 
Here is my faulty working script for the special merchant:
("refresh_special_merchants1",
Code:
 [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 230),
    #(try_for_range, ":cur_merchant", special_merchants_begin, special_merchants_end),
	  #(store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      #(val_add, ":cur_town", towns_begin), try_begin), 
      #(this_or_next|eq, ":cur_merchant", trp_specialmerch1),
      #(eq, ":cur_merchant",trp_specialmerch7),
	  (troop_clear_inventory, "trp_specialmerch7"),
	  (troop_clear_inventory, "trp_specialmerch6"),
	  (troop_clear_inventory, "trp_specialmerch1"),
      #(party_get_slot, fac_merchants1, ":cur_town", slot_center_original_faction),
      #(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_one_handed_wpn, 4),#gdw
      (troop_add_merchandise_with_faction, "trp_specialmerch6", "fac_merc1", itp_type_two_handed_wpn, 4),#gdw
      (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_two_handed_wpn, 4),#gdw
      (troop_add_merchandise_with_faction, "trp_specialmerch6", "fac_merc1", itp_type_one_handed_wpn, 4),#gdw
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 3),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 5),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
      (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_body_armor, 10),#gdw
      (troop_add_merchandise_with_faction, "trp_specialmerch6", "fac_merc1", itp_type_body_armor, 10),#gdw
	  (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_head_armor, 1),
	  (troop_add_merchandise_with_faction, "trp_specialmerch6", "fac_merc1", itp_type_head_armor, 1),
	  #(troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_foot_armor, 7),#gdw
	  (troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_hand_armor, 1),#gdw
	  (troop_add_merchandise_with_faction, "trp_specialmerch6", "fac_merc1", itp_type_hand_armor, 1),#gdw
      (troop_ensure_inventory_space, "trp_specialmerch1", merchant_inventory_space),
      (troop_ensure_inventory_space, "trp_specialmerch6", merchant_inventory_space),
      (troop_sort_inventory, "trp_specialmerch1"),
      (troop_sort_inventory, "trp_specialmerch6"), 
      (store_troop_gold, reg6, "trp_specialmerch6"),
      (store_troop_gold, reg6, "trp_specialmerch1"),
      (lt, reg6, 3500),#gdw
      (store_random_in_range,":new_gold",11300,19300), #oro inicial chief cambiado#gdw
      (call_script, "script_troop_add_gold", "trp_specialmerch6", ":new_gold"),
      (call_script, "script_troop_add_gold", "trp_specialmerch1", ":new_gold"),

There are other components in the source files as well, but this is the main thing.

I will eventually write this up into a tutorial, but several things are not working:
1) There are 7 of these guys with unique inventories. Does that mean the each need their own faction for this script?
2) Should I write seven versions of this script, or can i combine them all into one like I did for the 2 above?
3) How to prevent them from including merchandise that's not assigned to any faction?
They do indeed show 1-2 of the specially assigned items, but 90% is misc junk from the rest of module_items.

4) Why can't these troops show up in most town shop scenes. I've added entry points to nearly all the town shops in-game and only about 9 of them succeed in showing the new troops?
Am I doing something wrong?
What is there about scenes that seems to require additional set up?
See below:
Code:
["specialmerch1","Harenbili","Aed the Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_1_store|entry(1), 0, fac_merc1,[itm_leather_aprontunic,itm_ankleboots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch2","Maonirn","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_11_store|entry(1), 0, fac_merc1,[itm_arena_tunic_green,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch3","Uormuin","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_26_store|entry(2), 0, fac_merc1,[itm_ptunic3,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch4","Godgyfu","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_17_store|entry(1), 0, fac_merc1,[itm_leather_tunic1,  itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch5","Dounerth","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_28_store|entry(1), 0, fac_merc1,[itm_ptunic3,           itm_ankleboots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch6","Aed","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_29_store|entry(1), 0, fac_merc1,[itm_arena_tunic_green,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch7","Fogartach","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_40_store|entry(2), 0, fac_merc1,[itm_ptunic3,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],

Thank you for any help in advance.
 
gdwitt said:
3) How to prevent them from including merchandise that's not assigned to any faction?
They do indeed show 1-2 of the specially assigned items, but 90% is misc junk from the rest of module_items.

never tried that. The operations are clearly not meant for that user case. So you will probably have to hack a solution using Python (similar to BW system that adds slots with weapons data - weight, ... - or the non-swing script)

Remember that native only had 6 factions, and the engine API you are using was created for that game.
 
Have you seen it in any games?
I'd be happy at a 40% success rate.
Isn't "troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_one_handed_wpn"
Supposed to add gear from that faction primarily? What %?
What if I did this: troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_unique"

GDW
 
like I said the operations were not created to do what you want, so hack your own solution or you will have to live with the low % of products.

You probably have tons of items without a faction listed.
 
I don't quite understand that last answer to "hack" a solution.
Why wouldn't itp_unique replace itp_onehanded or armor if it is essentially unused?
Or why can't I create my own itp-flag like special_merchandise and add it selectively?

Yes, I realize there are probably 100 armors without factiona and maybe 20 with the new faction.

I've been searching around for answer.
One contributor suggested this old post: http://forums.taleworlds.com/index.php/topic,67936.msg1756576.html#msg1756576
Any merit there?

Thanks!
 
It doesn't replace it because it's not in the range of valid flags for that parameter. Just write your own code to add items to the inventory without using the merchandise operations.
 
Please explain:
"It doesn't replace it because it's not in the range of valid flags for that parameter."
Are you referring to my itp-unique suggestion?
What about another ITP or changing the parametr itself?

How would you go about "writing your own code to add items to the inventory without using the merchandise operations."
Do you recommend any operations that other mods have tried to use?
Any insight into how other mods handle this?

Thank you in advance for any advice,
GDW
 
@kalarhan. That hack didn't work sadly. But Rongar did answer some questions. Very informative.
Apparently, if I am to use troop_add_merchandise_with_faction, "trp_specialmerch1", "fac_merc1", itp_type_one_handed_wpn....
I will have to accept that 50-80% of the gear that the merchant will have will be factionless junk like sticks and shoes.
The only way to prevent this is to add a faction to EVERY item in module_items.

This isn't worth it for me at this point as many items need to be shared among factions and module_items is messy enough without 600 more faction lines.

The best solution is to add items manually to the inventory of that special merchant like I do with booksellers.
So I added 6 special items to the merchandise of each merchant in module_troops.
The problems I now have are:
1) The merchant wears the special items even when I try to force armature on the assigned leather apron.
2) The inventory screen shows the gear of a typical weaponseller, not the troop's personal inventory

Here is the dialog currently for the special merchants:
Code:
[anyone,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 450),], "I only sell the noblest of the noble. Are you sure you qualify?", "herrero_buy2", []],
  [anyone|plyr, "herrero_buy2", [], "Let me have a look.","herrero_window",[[change_screen_trade]]], # Reduced renown req from 700. TML. F123 - Submod -> 1.41
  [anyone,"herrero_buy", [], "Sorry, friend, but my art is for prestigious men only (450 renown). Come back when you improve your renown.", "close_window",[]],
It is the same basic dialog as that for the bookseller:
Code:
[anyone, "start", [(is_between, "$g_talk_troop", tavern_booksellers_begin, tavern_booksellers_end),
                     ],
   "Good day {sir/madam}, will you be looking at my books?", "bookseller_talk", []],
  [anyone|plyr, "bookseller_talk", [], "Yes. Show me what you have for sale.", "bookseller_buy", []],
   
  [anyone,"bookseller_buy", [], "Of course {sir/madam}.", "book_trade_reference_completed",[[change_screen_trade]]],
  [anyone,"book_trade_reference_completed", [], "Anything else?", "bookseller_talk",[]],

How do I get [[change_screen_trade]]] to show the personal inventory of the special merchant?

Or is there a better way to do this trade?
 
disable auto_equip so the merchant won't use the best gear
Code:
troop_set_auto_equip                   = 1509   # (troop_set_auto_equip,<troop_id>,<value>),#disables otr enables auto-equipping

and if you can't make this work

Code:
change_screen_trade                    = 2042	# (change_screen_trade, <troop_id>),

by passing the troop_id, then just use a fake troop (like a "chest") for the trade
 
I first had to fix constants so specialmerch's weren't included in the script for refreshing weaponsmiths.
weapon_merchants_begin = "trp_town_1_weaponsmith"
weapon_merchants_end  = "trp_specialmerch1"

This messed up the dialog causing them to challenging me to duel.
Fixed.

I now have them back to wearing their gear but selling the good stuff at about 50%
(troop_clear_inventory, "trp_specialmerch2"),
>>    (troop_set_auto_equip, "trp_specialmerch2", 0),
  (troop_clear_inventory, "trp_specialmerch6"),
>>  (troop_set_auto_equip, "trp_specialmerch6", 0),
  (troop_clear_inventory, "trp_specialmerch1"),
>>    (troop_set_auto_equip, "trp_specialmerch1", 0),

turning off autoequip doesn't work in the refresh script.
Turning it off in dialogs is too late as they are wearing their sale gear before the conversation starts.
I'll test using [[change_screen_trade, trp_tutorial_chest_2]]] next.

Update: this is not working.
[anyone|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_tutorial_chest_2"),]],
I wonder if I need to somehow be in conversation with trp_tutorial_chest.


I notice that with the zendar chest, the conversation is strange and their is no changescreentrade.
How do we see the inventory of our merchants in the zendar chest?
From Dialogs:
[anyone|auto_proceed,"start", [
  (is_between,"$g_talk_troop","trp_town_1_master_craftsman", "trp_zendar_chest"),
 
Yeah,
The trp_chests seem to be working with the new mod.
["specialmerch1_chest","{!}Ranged Weapons Chest","{!}Ranged Weapons Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_noblearmor9res,itm_noblearmor8res],def_attrib|level(1:cool:,wp(60),knows_common, 0],

Code:
[anyone, "start", [(is_between, "$g_talk_troop", special_merchants_begin, special_merchants_end,),],
   "Good day {sir/madam}, what interests you?", "special_merchant_talk", []],
  [anyone|plyr, "special_merchant_talk", [], "I was told you have some of the finest gear in Brytenwalda. But I need something more... special.", "herrero_buy", []],
   
  [anyone,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 450),], "I only sell the noblest of the noble. Are you sure you qualify?", "herrero_buy2", []],
            # (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, 0),(change_screen_trade, ":merchant_troop"),
            # (troop_set_auto_equip, "$g_talk_troop",0)]],
  [anyone|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch1_chest"),]], # Reduced renown req from 700. TML. F123 - Submod -> 1.41
  [anyone,"herrero_buy", [], "Sorry, friend, but my work is for prestigious men only (450 renown). Come back when you improve your renown.", "close_window",[]],

It's workable for now.
To make this really smart, it would be good if I could have one script for all the special merchants so I don't need to have 7 dialogs.

To make it realistic, I would like to be able to clear inventory and refresh the troop with new gear like a standard merchant.
Currently, if you buy an item, you can't get a second unless I give the chest multiples.
and if I put something in the chest from my inventory, it stays there the rest of the game.
 
I adjusted the other trp_specialmerch chests and can't get the success to work again.
When I change screen trade, I just get a blank screen.
Any advice on how to trade with a chest that you aren't physically interacting with.

I found an interesting idea in scripts that is awkward but works better than adding merchandise:
Code:
("refresh_special_merchants1",
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 230),
    #(try_for_range, ":cur_merchant", special_merchants_begin, special_merchants_end),
	  #(store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      #(val_add, ":cur_town", towns_begin), try_begin), 
      #(this_or_next|eq, ":cur_merchant", trp_specialmerch1),
      #(eq, ":cur_merchant",trp_specialmerch7),
      #(troop_clear_inventory, "trp_specialmerch1_chest"),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor11res,itm_noblearmor1res,itm_noblearmor14res ),
	  (troop_add_items, "trp_specialmerch1_chest", itm_noblearmor1res, 3),
	  (troop_add_items, "trp_specialmerch2", itm_noblearmor14res, 2),
	  (troop_add_items, "trp_specialmerch3", itm_noblearmor14res, 2),
	  (troop_add_items, "trp_specialmerch4", itm_noblearmor14res, 2),
	  (troop_add_items, "trp_specialmerch5", itm_noblearmor14res, 2),
	  (troop_add_items, "trp_specialmerch6", itm_noblearmor14res, 2),
	  (troop_add_items, "trp_specialmerch7", itm_noblearmor14res, 2),
 
I would like to add attributes to special items in the mod.
However, they are scattered throughout module-items and putting them all into a sequential block is not possible.
Here is the script:
Code:
(else_try), #armadura pesada, heavy armor
  (eq, "$g_armor_penalties", 0),
  (eq, ":skill_no", "skl_persuasion"),
  (troop_get_inventory_slot,":cur_item1",":troop_no",ek_body),#Here we are getting items from slots 0,1,2,3
  (is_between, ":cur_item1", nobleclothes2_begin, nobleclothes2_end),
  (val_add, ":modifier_value", 1),
Notice it uses module_constant: nobleclohtes2_begin to end.
Can I set up a module constant where I just list a sequence like:
noble_helm = itm1 + itm2 _itm3 +itm4 .
I did this in header items with factions, itp, itc.
I could assign each of the items a flag, but then I'd need a new script for increasing a troop quality based on a faction quality.

Is it possible to script hero/npc skills based on item flags?

Ideas?
 
In the end, the chests were not necessary.
I didn't use add merchandise with faction.
Nor could I figure out a way to keep the merchants from autoequipping their gear.
This is my working setup:
Add troops in enclosed scenes. I had problems when they were in the town center as you saw in the bug thread.
Code:
["specialmerch1","Harenbili","Harenbili",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_1_store|entry(1), reserved, fac_commoners,[itm_leather_aprontunic,itm_ankleboots,],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch2","Maonirn","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_11_store|entry(1), 0, fac_merc1,[itm_leather_aprontunic,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch3","Uormuin","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_26_store|entry(2), 0, fac_merc1,[itm_ptunic3,   itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch4","Godgyfu","{!}Weaponsmith",tf_hero|tf_is_merchant|tf_randomize_face, scn_town_10_store|entry(1), 0, fac_merc1,[itm_leather_tunic1,  itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch5","Dounerth","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_28_store|entry(1), 0, fac_merc1,[itm_ptunic3,         itm_ankleboots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch6","Aed","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_29_store|entry(1), 0, fac_merc1,[itm_arena_tunic_green,     itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],
["specialmerch7","Fogartach","{!}Weaponsmith",tf_hero|tf_randomize_face|tf_is_merchant, scn_town_40_store|entry(2), 0, fac_merc1,[itm_leather_aprontunic,itm_cheap_shoes],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2],

Script the addition of items with add_items
("refresh_special_merchants1",
Code:
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 230),
    #(try_for_range, ":cur_merchant", special_merchants_begin, special_merchants_end),
	  #(store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      #(val_add, ":cur_town", towns_begin), try_begin), 
      #(this_or_next|eq, ":cur_merchant", trp_specialmerch1),
      #(eq, ":cur_merchant",trp_specialmerch7),
      (troop_clear_inventory, "trp_specialmerch1"),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor11res,2),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor14res,1),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor15res,1),
	  (troop_add_items, "trp_specialmerch1", itm_noblearmor18res,1),
	  (troop_add_items, "trp_specialmerch1", itm_saxonhelmt4face,1),
	  (troop_add_items, "trp_specialmerch1_chest", itm_noblearmor1res, 4),
	  (troop_clear_inventory, "trp_specialmerch2"),
	  (troop_add_items, "trp_specialmerch2", itm_longmail_coat_kingred,1),
	  (troop_add_items, "trp_specialmerch2", itm_noblearmor8res, 1),
	  (troop_add_items, "trp_specialmerch2", itm_goat_nobleman_helm, 1),
	  (troop_add_items, "trp_specialmerch2", itm_resanglehelmet_gold,1),
	  (troop_add_items, "trp_specialmerch2", itm_noblearmor21res,1),

Add a trigger:
Code:
(0.0, 0, 228.0, [],
  [
    (call_script, "script_refresh_special_merchants1"),
  ]),

Dialog:
Code:
[anyone, "start", [(is_between, "$g_talk_troop", special_merchants_begin, special_merchants_end,),],
   "Good day {sir/madam}, what do you want? I'm quite busy", "special_merchant_talk", []],
  [anyone|plyr, "special_merchant_talk", [], "I was told you have some of the finest gear in Brytenwalda. What makes your goods so special?", "herrero_buy", []],
  #[anyone,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I only sell the noblest of the noble. Are you sure you qualify?", "herrero_buy2", []], 
  [trp_specialmerch1,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "Haven't you hard that the Lorica is the latest must-have in Paris? I have an exclusive connection to merchants in Paris who import from all over Europe", "herrero_buy2", []],
          
  [trp_specialmerch2,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "The warlords of Mierce prefer Red when leading in battle. Red is for victory!", "herrero_buy2", []],
  [trp_specialmerch3,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I have one of the best purple dyes from a secret Greek Island. Leaders come to me for Royal armor or tunics.", "herrero_buy2", []],
  [trp_specialmerch4,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I import scale armor from a merchant in Byzantium. Both women and men enjoy these for their spaciousness and comfort.", "herrero_buy2", []],
  [trp_specialmerch5,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "White and Gold were the colors of King Arthur's court. See the armor of Christian nobles.", "herrero_buy2", []],
  [trp_specialmerch6,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "I use the finest purple imported from Italy. Purple Armor on the battlefield will make you a leader.", "herrero_buy2", []],
  [trp_specialmerch7,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 400),], "Blue is the traditional color of leadership on these islands while green is a mark of virtue.", "herrero_buy2", []],
  #[anyone|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch1_chest"),]],

  [trp_specialmerch1|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch1"),]],##works
  [trp_specialmerch2|plyr, "herrero_buy2", [], "I certainly want to be victorious like Penda.","herrero_window",[(change_screen_trade, "$g_talk_troop"),]], ##works
  [trp_specialmerch3|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[[change_screen_trade]]], ##works
  [trp_specialmerch4|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, trp_specialmerch4_chest),]], ##works
  [trp_specialmerch5|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch5_chest"),]], ##works
  [trp_specialmerch6|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, trp_specialmerch6),]], ##works
  [trp_specialmerch7|plyr, "herrero_buy2", [], "Yes. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch7"),]], ##works
  #[anyone|plyr, "herrero_buy2", [], "I am certainly. Let me have a look.","herrero_window",[(change_screen_trade, "trp_specialmerch7"),]], ##works
  [anyone,"herrero_buy", [], "Sorry, friend, but my work is for prestigious men only (450 renown). Come back when you improve your renown.", "close_window",[]],
  [anyone,"herrero_window", [], "Good Luck. Remember my name if you need something. Farewell.", "close_window",[]],

Notice that this worked 6 different ways with the screen_trade command!
Even when I put trp_specialmerch4_chest, it still showed the gear from trp_specialmerch4!!
Why is that? It completely ignored the gear I was assigning to the trp_chests.
 
Back
Top Bottom