Great Feature but how was this done - Arrows deplete do not refill after battles

Users who are viewing this thread

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), 
  ]), 
 
 
First of all, thanks for your appreciation.
I am a very poor coder myself, and this feature was one that gave me multiple headaches and was very hard to add. For it to work, I had to create multiple instances of all types of arrows, in batch of 5  (5 barbed arrows, 10 barbed arrows, 15 barbed arrows... and so on), because it was a very empiric coding. Moreover, it has some deep flaws. Moreover, I coded it a very long time ago. So I must suggest that you look for another OSP about ammo not refilling, mine can't be the only one around.
Anyways, thanks again for your appreciation, however, it is weird, because I did not create Rigale to be more challenging, but only to offer more world interaction opportunities to players
 
Which is exactly what added the needed challenge. Its the added variables the player now must consider in addition to what native offered in the first place:smile: It does affect the play style (and in a positive way at too). I was a fan of the crafting mod (the only crafting mod back then) for original Mount&Blade and I think yours is the only one for Warband that implements all the concepts the old one had but in a streamlined fashion. And to be honest, there aren't that many mods that even touch on crafting as it is. If only there was a way (besides compiling the source code) to run more than one mod at once...:smile:. Anyways, thank You for replying,  looks I am gonna have to get a few lessons on modding this game but thanks to this mod I have motivation now:smile: All the best to You, Sir!
 
Once you have a few things installed, modding M&B W is really easy and gratifying. And If I remember well, the community is amazingly helpfull, if you show you try hard.
Thank you for your kind words about rigale. Hopefully you will like the coming V0.10, I love the two new features I am adding, Knowledge, which really has a huge impact on many rigale features (and it probably is the first thing I should have created, because it impacts almost everything else), and the custom settlements, which is quite complex and hard to add. Hopefully, all this can make a civilisation like feature, with some twists.
Anyways, good luck for your quest :smile:
 
Back
Top Bottom