Module System Question

正在查看此主题的用户

ligerteeth

Regular
Hi I have been using the module system for two weeks now working on a new mod and I just have one question, How can I change exactly what the merchants in towns are selling? For example, there are firearms in my mod, so how do I make cartridges available at every merchant? Any help would be appreciated, thanks in advance.

BTW, I have read through the module system documentation and I didn't see this, so please don't just give me links to the documentation.
 
have you enabled firearms?

in your merchant screen do guns appear (the games defult gun is a flintlock pistol and will appear if guns are enabled)

to enable guns look through module.ini inside your module folder, and change the 0 to 1 next to display_wp_firearms (its quite near the top)

if you have done this then you can try changing the abundence of items, when typing out the new items, or editing them you should have a line that looks like
["arena_lance",        "Lance", [("arena_lance",0)], itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear,
90 , weight(2.5)*|spd_rtng(96) | weapon_length(150)|swing_damage(20 , blunt) | thrust_damage(25 ,  blunt),imodbits_polearm ],

i've hightlighted the area you need to add to, make sure that the line itp_mechandise is in it otherwise it will never appear in shops

and if you want to change the odds of it appearing add the comment |abundence(100) where i've put the *

the number 100 can be changed, note that 100 isn't a one hundred percent chance, i'm not sure of the upper limit but it can be much higher (and the higher the number the more likely it is to appear)
 
I did have firearms enabled, and when I increased the abundance, it didn't help. Is there anyway to control exactly what the merchants are selling? I also have racial armors for the different factions and I would like it if they were sold at the cities that the factions start out owning.
 
Module triggers, right near the top, is the refresh_merchants trigger. That handles what itp types appear in shops.
 
thanks alot, i just had one problem with this, i added this under refresh weapon merchants:

(troop_add_merchandise,reg(2),itp_type_pistol,2),

it gave me an error saying:

TypeError 'tuple' object is not callable

do you know what this might be?
 
Actually got it to work thanks alot Raglan and Ruthven, but there is one problem, for some reason all of my muskets dont appear in the stores, any suggestions?
 
(troop_add_merchandise,reg(2),itp_type_musket,2),
(troop_add_merchandise,reg(2),itp_type_bullets,2),
You need those as well

 
I have done that but it still doesn't work. heres what I have under # Refresh Weapon sellers

插入代码块:
(0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,150),
                      (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
                        (troop_add_merchandise,reg(2),itp_type_one_handed_wpn,4),
                        (troop_add_merchandise,reg(2),itp_type_two_handed_wpn,4),
                        (troop_add_merchandise,reg(2),itp_type_polearm,4),
                        (troop_add_merchandise,reg(2),itp_type_shield,5),
                        (troop_add_merchandise,reg(2),itp_type_bow,4),
	                (troop_add_merchandise,reg(2),itp_type_crossbow,2),
                        (troop_add_merchandise,reg(2),itp_type_thrown,5),
                        (troop_add_merchandise,reg(2),itp_type_arrows,2),
                        (troop_add_merchandise,reg(2),itp_type_bolts,1),
	                (troop_add_merchandise,reg(2),itp_type_bullets,2),
                        (troop_add_merchandise,reg(2),itp_type_pistol,1),
	                (troop_add_merchandise,reg(2),itp_type_musket,2),
                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                        (troop_sort_inventory, reg(2)),
                        (store_troop_gold, reg(6),reg(2)),
                        (lt,reg(6),900),
                        (store_random_in_range,":new_gold",200,400),
                      (call_script, "script_troop_add_gold",reg(2),":new_gold"),
                      (end_try,0),
                     ]),
 
后退
顶部 底部