WB Coding Troop Items in Freelancer

Currently viewing this thread:

Hello community, I have a problem with Freelancer, I installed it with modmerger and everything works perfectly, except that it does not assign me the items of the troop in which I am recruited.

I clarify that the name of the troop in which I am recruited is perfect, it simply does not give me the item that the troop has. I also tried removing all the items I had in inventory before I enlisted but it didn't work either.

(store_script_param_1, ":source_troop"),

(str_clear, s2),
(set_show_messages, 0),

(assign, ":recording_slot", slot_freelancer_equip_start),
(troop_get_inventory_capacity, ":troop_cap", ":source_troop"),
(assign, ":melee_given", 0),
(assign, ":needs_ammo", 0),
(assign, ":eek:pen_weapon_slot", 0),
(try_for_range, ":type", itp_type_horse, itp_type_pistol),
(neq, ":type", itp_type_goods),
(neq, ":type", itp_type_arrows),
(neq, ":type", itp_type_bolts),

#Assign Prob. of Getting Type
(assign, ":continue", 0),
(troop_is_guarantee_horse, ":source_troop"),
(eq, ":type", itp_type_horse),
(assign, ":continue", 1),
(troop_is_guarantee_ranged, ":source_troop"),
(this_or_next|eq, ":type", itp_type_musket), #I tried changing this line to itp_type_musket to see if it gives me the musket that the troop has.

(this_or_next|eq, ":type", itp_type_bow),
(eq, ":type", itp_type_thrown),
(assign, ":continue", 1),
(this_or_next|eq, ":type", itp_type_shield), #Shields and all armor pieces are guaranteed
(ge, ":type", itp_type_head_armor),
(assign, ":continue", 1),
(neq, ":type", itp_type_horse),
(lt, ":eek:pen_weapon_slot", 4),
(store_random_in_range, ":continue", 0, 3), # 1 chance in three of being 1
(eq, ":continue", 1),

#Clear Temp Array
(try_for_range, ":inv_slot", 0, 20),
(troop_set_slot, "trp_temp_array_a", ":inv_slot", 0),

#Collect Items from Source Troop
(assign, ":type_count", 0),
(try_for_range, ":inv_slot", 0, ":troop_cap"),
(troop_get_inventory_slot, ":item", ":source_troop", ":inv_slot"),
(gt, ":item", 0),
(item_get_type, ":item_type", ":item"),
(eq, ":item_type", ":type"),
(call_script, freelancer_can_use_item, "trp_player", ":item", 0),
(eq, reg0, 1),
(troop_set_slot, "trp_temp_array_a", ":type_count", ":item"),
(val_add, ":type_count", 1),
(gt, ":type_count", 0),

Will I have to change something in this script?

Thx in advance.
Top Bottom