Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Right, new problem. This trigger has always worked for me before, but for some reason it's just stopped without me editing it:
(fisheye made it for me. I understand how it works fine, but don't know what is wrong with it that it doesn't work. It simply doesn't fill Jabbara's inventory with anything. I go to him and his inventory is just empty.)
Code:
# Refresh Weapon AND Armor seller, Jabbara
  (0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,120),
                      (assign, reg(2), "trp_jabbara"),
                      (troop_add_merchandise,reg(2),itp_type_body_armor,8),
                      (troop_add_merchandise,reg(2),itp_type_head_armor,8),
                      (troop_add_merchandise,reg(2),itp_type_foot_armor,4),
                      (troop_add_merchandise,reg(2),itp_type_hand_armor,2),
                      (troop_add_merchandise,reg(2),itp_type_one_handed_wpn,3),
                      (troop_add_merchandise,reg(2),itp_type_two_handed_wpn,2),
                      (troop_add_merchandise,reg(2),itp_type_polearm,2),
                      (troop_add_merchandise,reg(2),itp_type_shield,3),
                      (troop_add_merchandise,reg(2),itp_type_bow,2),
                      (troop_add_merchandise,reg(2),itp_type_crossbow,2),
                      (troop_add_merchandise,reg(2),itp_type_thrown,2),
                      (troop_add_merchandise,reg(2),itp_type_arrows,1),
                      (troop_add_merchandise,reg(2),itp_type_bolts,1),
                      (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                      (store_troop_gold, reg(6),reg(2)),
                      (lt,reg(6),500),
                      (store_random,reg(8),100),
                      (val_add,reg(8),200),
                      (troop_add_gold,reg(2),reg(8)),
                     ]),

Code:
  ["Jabbara","Jabbara","Jabbara",tf_hero|tf_is_merchant, scn_zendar_farm|entry(15),reserved,  fac_commoners,[itm_leather_apron,itm_leather_boots],def_attrib|level(7),wp(80),knows_ironflesh_4|knows_shield_4|knows_inventory_management_3|knows_common,0x0000000000000145000007a54e58f0d1],

Code:
  [trp_jabbara,"start", [(eq,"$jabbara_sell",1)], "Hello, {playername}. What can I do for you?", "jabbara_merchant_1",[]],
  [trp_jabbara|plyr,"jabbara_merchant_1", [], "I'd like to see your merchandise.", "jabbara_merchant_2",[]],
  [trp_jabbara,"jabbara_merchant_2", [], "Certainly. Anything for the {man/woman} who brought my wife back to me.", "trade_done", [[change_screen_trade]]],
  [trp_jabbara,"trade_done", [], "Anything else?", "jabbara_merchant_1",[]],
  [trp_jabbara|plyr,"jabbara_merchant_1", [], "Tell me about yourself.", "jabbara_self",[]],
  [trp_jabbara,"jabbara_self", [], "Certainly, {playername}. Here goes...", "trade_done",[(change_screen_view_character)]],
#  [trp_jabbara|plyr,"jabbara_merchant_1", [], "Is there anything I can do for you?"
  [trp_jabbara|plyr,"jabbara_merchant_1", [], "No thank you. That's all for now.", "jabbara_leave",[]],
  [trp_jabbara,"jabbara_leave", [], "OK. Take care now. I hope to see you again.", "close_window",[]],

It gets to "jabbara_merchant_1" just fine, giving me the options like "Tell me about yourself", "Let me see your merchandise", etc, and when I click "Let me see your merchandise" that works too, and it goes to "jabbara_merchant_2", just fine. It then does the "change_screen_trade" just fine, and lets me trade with him, but his inventory is always blank. Ideas?
 
(troop_ensure_inventory_space,reg(2),merchant_inventory_space),

Keep in mind that this is ensuring a LOT of space.  Make sure jabarra has inventory skill of 10.  Your skill of 3 will not cut it.  If you still have problems we will sort them after that.
 
Good point. I think the reason that I didn't get that is that he's a pre-existing character that's unused in the game who I made a weapon merchant, but forgot to check the stats. I'll edit this post with any success I have. Thanks.

EDIT: Perfect. Thank you.
 
I think my question fits well to this discussion,
I've made a new merchant, but [change_screen_trade] seems not to affect anything.
Code:
["spy","dusky_man","dusky_man", tf_hero|tf_is_merchant, scn_village_tavern|entry(1),0, fac_commoners,[itm_pilgrim_hood,itm_pilgrim_disguise,itm_practice_staff, itm_throwing_daggers],def_attrib|level(2),wp(20),knows_common, 0x000000000004028601ea89a44929b699],
 
Code:
[trp_spy,"spy_buy", [], "aaahh... some rare things", "spy_talk",[[change_screen_trade]]],
 
def_attrib|level(2),wp(20),knows_common wouldn't give it inventory management 10, would it? And have you set up the trigger right? Post that too, I'll check it against bryce777's fix of mine and see what we can find.
 
well, he has just about 5 itims to trade does he need that much space?

(troop_ensure_inventory_space,"trp_spy",merchant_inventory_space),
is also in a trigger at the start of the game, even if I don't know what it affects.
I don't have those add merchandise, cause he only gets rare itims, which I add by troop_add_item.
 
It seems I've managed to solve my own, "mod won't load" problem. It looks like you can't use \ to split up menu descriptions like you can in dialogs.
 
Ok, how do I assign skins to troops?  I was told how to add in new entries already in the skins module, but I don't see how in the troop definition I can pick my new race to be used by these guys.  I have been searching the forums and the module files for several hours.

Can anyone help?

Ok, highelfwarrior helped me.  the idea is to put new troop flags that correspond to the new 'gender' and then give that troop the troop flag when you create it!
 
Did ya miss me? :grin:

How do I add an NPC? Can it be done with Notepad, or is it necessary to do it via Python (because Python's upset with my computer and won't work)?
 
Code:
  (0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,120),


                      (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_tools",700),
                      (troop_add_merchandise,"trp_zendar_merchant",itp_type_goods,num_merchandise_goods),
                      (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_salt",700),
                      (troop_add_merchandise,"trp_salt_mine_merchant",itp_type_goods,num_merchandise_goods),
                      (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_grain",700),
                      (troop_add_merchandise,"trp_zendar_farm_merchant",itp_type_goods,num_merchandise_goods),

                      # Add trade goods to merchant inventories
                      (try_for_range,reg(2),towns_begin,towns_end),
                      (reset_item_probabilities,100),
                      (party_get_slot,reg(6),reg(2),slot_town_export_good),
                      (party_get_slot,reg(8),reg(2),slot_town_export_good_2),
                      (party_get_slot,reg(10),reg(2),slot_town_merchant),
                      (set_item_probability_in_merchandise,reg(6),700),
                      (set_item_probability_in_merchandise,reg(8),700),
                      (troop_add_merchandise,reg(10),itp_type_goods,num_merchandise_goods),
                      (store_troop_gold, reg(6),reg(2)),
                      (lt,reg(6),800),
                      (store_random,reg(8),100),
                      (val_add,reg(8),200),
                      (troop_add_gold,reg(2),reg(8)),
#                      (assign,"$pin_town",reg(2)),
#                      (call_script,"script_get_town_properties"),
#                      (assign,reg(3),4000000),
#                      (val_div,reg(3),"$pout_export_rate"),
#                      (val_div,reg(3),"$pout_export_rate"),
#                      (set_item_probability_in_merchandise,"$pout_export_good",700),
#                      (troop_add_merchandise,"$pout_trp_merchant",itp_type_goods,num_merchandise_goods),
                      (end_try,0),

What is wrong with that that would stop it adding money to merchant inventories? I can't see anything, can you guys?
 
Leprechaun said:
                      (party_get_slot,reg(10),reg(2),slot_town_merchant),
(party_get_slot,<destination>,<party_id>,<slot_no>),

yours:
(party_get_slot,<party_id>,<destination>,<slot_no>),
 
sry, I read wrong. Anyway, you need instead of:
(troop_add_gold,reg(2),reg(:cool:),
this:
(troop_add_gold,reg(10),reg(:cool:),
because your destination of the party_get_slot is reg(10). You used the towns.
 
Status
Not open for further replies.
Back
Top Bottom