Snowcrash1982
Recruit
Hello all,
I really like this mod, especially that it is more challenging. One question though, as in the topic above, how was this done? I am not a modder but would gladly implement this part of code into other mods that I use. I did find this part of script file and was wondering if the answer is somewhere in it:
("prohibit_refilling_ammo", #script_prohibit_refilling_ammo
[
(store_script_param_1, ":agent_no"),
(try_begin),
(get_player_agent_no, ":agent_no"), # For the moment, for only player
(agent_get_troop_id, ":troop_no", ":agent_no"),
(agent_get_wielded_item, ":cur_weapon", ":agent_no", 0),
(item_get_type, reg2, ":cur_weapon"),
(try_begin), #rigale add
(eq, reg2, itp_type_bow),
(assign, ":ammo_type", itp_type_arrows),# RIGALE, ArrowsFor the moment, for only arrow
(else_try),
(eq, reg2, itp_type_crossbow),
(assign, ":ammo_type", itp_type_bolts),# Rigale bolts
(try_end),
(str_store_item_name, s1, ":cur_weapon"),
(agent_get_ammo, reg1, ":agent_no",1),
(assign, "$g_num_ammo", reg1), # The following is script that prohibit refilling ammo even if you accessed your inventory during battle. # but once you visit town or castle or village and "Take a walk around the streets.", Your ammo is refilled. # I can't modify it.
(store_add, ":end_of_slot", ek_item_3, 1),
(try_for_range, ":i_slot", ek_item_0, ":end_of_slot"), # your weapon slot 1-4
(troop_get_inventory_slot, ":cur_item", ":troop_no", ":i_slot"),
(ge, ":cur_item", 0),
(item_get_type, ":cur_item_type", ":cur_item"),
(eq, ":cur_item_type", ":ammo_type"),
(troop_inventory_slot_set_item_amount, ":troop_no", ":i_slot", reg1),
(assign, ":end_of_slot", 0),
(eq, reg1, 0),
(troop_set_inventory_slot, ":troop_no", ":i_slot", -1), # remove this item
(try_end),
(try_end),
]),
I really like this mod, especially that it is more challenging. One question though, as in the topic above, how was this done? I am not a modder but would gladly implement this part of code into other mods that I use. I did find this part of script file and was wondering if the answer is somewhere in it:
("prohibit_refilling_ammo", #script_prohibit_refilling_ammo
[
(store_script_param_1, ":agent_no"),
(try_begin),
(get_player_agent_no, ":agent_no"), # For the moment, for only player
(agent_get_troop_id, ":troop_no", ":agent_no"),
(agent_get_wielded_item, ":cur_weapon", ":agent_no", 0),
(item_get_type, reg2, ":cur_weapon"),
(try_begin), #rigale add
(eq, reg2, itp_type_bow),
(assign, ":ammo_type", itp_type_arrows),# RIGALE, ArrowsFor the moment, for only arrow
(else_try),
(eq, reg2, itp_type_crossbow),
(assign, ":ammo_type", itp_type_bolts),# Rigale bolts
(try_end),
(str_store_item_name, s1, ":cur_weapon"),
(agent_get_ammo, reg1, ":agent_no",1),
(assign, "$g_num_ammo", reg1), # The following is script that prohibit refilling ammo even if you accessed your inventory during battle. # but once you visit town or castle or village and "Take a walk around the streets.", Your ammo is refilled. # I can't modify it.
(store_add, ":end_of_slot", ek_item_3, 1),
(try_for_range, ":i_slot", ek_item_0, ":end_of_slot"), # your weapon slot 1-4
(troop_get_inventory_slot, ":cur_item", ":troop_no", ":i_slot"),
(ge, ":cur_item", 0),
(item_get_type, ":cur_item_type", ":cur_item"),
(eq, ":cur_item_type", ":ammo_type"),
(troop_inventory_slot_set_item_amount, ":troop_no", ":i_slot", reg1),
(assign, ":end_of_slot", 0),
(eq, reg1, 0),
(troop_set_inventory_slot, ":troop_no", ":i_slot", -1), # remove this item
(try_end),
(try_end),
]),