Droping/removeing swords when equiping bayonet

Users who are viewing this thread

Solution
Hey, friend. Not entirely sure what you mean here. If you're saying the bayonet is a knife in the inventory you'll want to amend this by doing something like

Changes marked in Red, my comments in Orange
#Bajo script
(eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet

(assign, ":bayonet", "itm_bayonet"), # or whatever the bayonet item_id is, if you want a different one per rifle, make a new slot called slot_item_unique_bayonet and assign them there. Then move this down to...
Hey, friend. Not entirely sure what you mean here. If you're saying the bayonet is a knife in the inventory you'll want to amend this by doing something like

Changes marked in Red, my comments in Orange
#Bajo script
(eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet

(assign, ":bayonet", "itm_bayonet"), # or whatever the bayonet item_id is, if you want a different one per rifle, make a new slot called slot_item_unique_bayonet and assign them there. Then move this down to the commented out section below
(assign,":itemFound",0),
(assign,":playerAgent",":var2"),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),

# (item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet), # this is a variant needed if you want a different bayonet per rifle
(neq,":bayonetItem",0),
(try_for_range,":curSlot",0,3),
(neq,":itemFound",1),
(agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
(try_begin),
(eq,":curItem",":curRifle"),
(assign,":itemFound",1), #break loop
(assign,":itemSlot",":curSlot"),

(else_try),
(eq,":curItem",":bayonet"),
(assign, ":bayonet_in_inventory", 1),
(assign, ":bayonet_itemSlot", ":curSlot"),
(try_end),

(try_end),
(eq,":itemFound",1), #the item was found and no witchcraft occurred
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
(agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
(try_begin),
(eq,":isFixed",0),

(eq,":bayonet_in_inventory",1),
(agent_set_animation,":playerAgent","anim_fix_bayonet"),
(agent_unequip_item, ":playerAgent", ":bayonet", ":bayonet_itemSlot"), # using the item slot will ensure that an agent can carry multiple bayonet items without being forced to unequip them all.
(else_try),
(agent_set_animation,":playerAgent","anim_unfix_bayonet"),

(agent_equip_item, ":playerAgent", ":bayonet"), # This assumes there is an empty slot. That ~should~ be true since we had to unequip an item to make this true, but if the agent picked something in the meantime this would fail.
(try_end),
(agent_unequip_item,":playerAgent",":curRifle"),
(agent_equip_item,":playerAgent",":bayonetItem"),
(agent_set_wielded_item,":playerAgent",":bayonetItem"),
(try_begin),
(eq,":rifleAmmo",0),
(agent_set_ammo,":playerAgent",":bayonetItem",0),
(try_end),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
(try_end), #Bajo script

Sorry about the tabs, being inside a spoiler ruins that

Of course, this is entirely untested and I am only guessing at what you are asking.

The way this works is pretty straight forward. It adds a check that there is a bayonet weapon in the inventory of the agent, and if there is, and the current rifle is a variant without a bayonet, it unequips the last bayonet weapon in the equip slots, and changes the variant just like the base version. Then, if the player is swapping from a bayoneted variant, it assumes there should be an open inventory slot, equips the bayonet weapon, and changes the rifle's variant just as the base did.
 
Upvote 0
Solution
Hey, friend. Not entirely sure what you mean here. If you're saying the bayonet is a knife in the inventory you'll want to amend this by doing something like

Changes marked in Red, my comments in Orange
#Bajo script
(eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet

(assign, ":bayonet", "itm_bayonet"), # or whatever the bayonet item_id is, if you want a different one per rifle, make a new slot called slot_item_unique_bayonet and assign them there. Then move this down to the commented out section below
(assign,":itemFound",0),
(assign,":playerAgent",":var2"),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),

# (item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet), # this is a variant needed if you want a different bayonet per rifle
(neq,":bayonetItem",0),
(try_for_range,":curSlot",0,3),
(neq,":itemFound",1),
(agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
(try_begin),
(eq,":curItem",":curRifle"),
(assign,":itemFound",1), #break loop
(assign,":itemSlot",":curSlot"),

(else_try),
(eq,":curItem",":bayonet"),
(assign, ":bayonet_in_inventory", 1),
(assign, ":bayonet_itemSlot", ":curSlot"),
(try_end),

(try_end),
(eq,":itemFound",1), #the item was found and no witchcraft occurred
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
(agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
(try_begin),
(eq,":isFixed",0),

(eq,":bayonet_in_inventory",1),
(agent_set_animation,":playerAgent","anim_fix_bayonet"),
(agent_unequip_item, ":playerAgent", ":bayonet", ":bayonet_itemSlot"), # using the item slot will ensure that an agent can carry multiple bayonet items without being forced to unequip them all.
(else_try),
(agent_set_animation,":playerAgent","anim_unfix_bayonet"),

(agent_equip_item, ":playerAgent", ":bayonet"), # This assumes there is an empty slot. That ~should~ be true since we had to unequip an item to make this true, but if the agent picked something in the meantime this would fail.
(try_end),
(agent_unequip_item,":playerAgent",":curRifle"),
(agent_equip_item,":playerAgent",":bayonetItem"),
(agent_set_wielded_item,":playerAgent",":bayonetItem"),
(try_begin),
(eq,":rifleAmmo",0),
(agent_set_ammo,":playerAgent",":bayonetItem",0),
(try_end),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
(try_end), #Bajo script

Sorry about the tabs, being inside a spoiler ruins that

Of course, this is entirely untested and I am only guessing at what you are asking.

The way this works is pretty straight forward. It adds a check that there is a bayonet weapon in the inventory of the agent, and if there is, and the current rifle is a variant without a bayonet, it unequips the last bayonet weapon in the equip slots, and changes the variant just like the base version. Then, if the player is swapping from a bayoneted variant, it assumes there should be an open inventory slot, equips the bayonet weapon, and changes the rifle's variant just as the base did.
Hi thanks for replying ill try your updated code later today although im haveing problems with the animation it only plays the fix bayonet animation and not the unfix one would you know the cause of this by any chance and again thanks for replying
 
Upvote 0
Hi thanks for replying ill try your updated code later today although im haveing problems with the animation it only plays the fix bayonet animation and not the unfix one would you know the cause of this by any chance and again thanks for replying
Ive narrowed it down and im 90 percent sure the issue is with the script which is exactly as in the tutorial i linked
 
Upvote 0
That could be a number of things, but you might try raising the animation priority first. Right now it's set to amf_priority_mount which is to say 60, so if another animation is playing with a higher priority, it won't take effect. I personally use 71 in a lot of my stuff which pretty much will take priority over all other animations outside of being hit.

Outside of that, make sure the animations are declared properly and that they are inside the *.brf and the brf is named inside module.ini
 
Upvote 0
That could be a number of things, but you might try raising the animation priority first. Right now it's set to amf_priority_mount which is to say 60, so if another animation is playing with a higher priority, it won't take effect. I personally use 71 in a lot of my stuff which pretty much will take priority over all other animations outside of being hit.

Outside of that, make sure the animations are declared properly and that they are inside the *.brf and the brf is named inside module.ini
That didn't work, Here is my script so far without your update, If possible could you take a look at it thanks
Python:
#Bajo script
              (eq, ":event_type", multiplayer_event_fixBayonet),
        (store_script_param,":eventNo",3),
        (store_script_param,":var2",4),
            (try_begin),
                (eq,":eventNo",1), #Event 1 - Fix Bayonet
                (assign,":itemFound",0),
                (assign,":playerAgent",":var2"),
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
                (eq,":bayonetCooldown",0),
                (agent_get_wielded_item,":curRifle",":playerAgent"),
                (item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
                (neq,":bayonetItem",0),
                (try_for_range,":curSlot",0,3),
                    (neq,":itemFound",1),
                    (agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
                    (eq,":curItem",":curRifle"),
                    (assign,":itemFound",1), #break loop
                    (assign,":itemSlot",":curSlot"),
                (try_end),
                (eq,":itemFound",1), #the item was found and no witchcraft occurred
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
                (agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
                (try_begin),
                    (eq,":isFixed",0),
                    (agent_set_animation,":playerAgent","anim_fix_bayonet"),
                            (else_try),
                    (agent_set_animation,":playerAgent","anim_unfix_bayonet"),
                (try_end),
                (agent_unequip_item,":playerAgent",":curRifle"),
                (agent_equip_item,":playerAgent",":bayonetItem"),
                (agent_set_wielded_item,":playerAgent",":bayonetItem"),
                (try_begin),
                    (eq,":rifleAmmo",0),
                    (agent_set_ammo,":playerAgent",":bayonetItem",0),
                (try_end),
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
            (try_end), #Bajo script
      (else_try),
From my testing ive figured out that when i change the number in (eq,":isFixed",0), it will play the other animation both (for example if set to 0 it plays fix bayonet animation when fixing and unfixing oppisite if set to 1)

and for your new code you sent ill try it once I figure this out. Thanks again
 
Upvote 0
To help you think like a WB scripter, I'm going to walk through my thought process in bugfixing.

First: Identify the bug.
The try_*** loop is always claiming ":isFixed" = 0, so we'll start with that.

Second: Think about what could cause the bug.
One of two things might be happening, the slot is either being overwritten, or it's not being updated.
So we'll look though the script for an agent_set_slot operation pointing at slot_item_isFixed.
There is none, so that means the slot is never updated to reflect the bayonet's state, meaning it's always 0.
So we need to add a agent_set_slot to the consequence block.

Update this section to include slot setting:
Python:
                (try_begin),
                    (eq,":isFixed",0),
                    (agent_set_animation,":playerAgent","anim_fix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 1), # 1 marks the bayonet as fixed
                            (else_try),
                    (agent_set_animation,":playerAgent","anim_unfix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 0), # 0 marks the bayonet as unfixed
                (try_end),

Keep in mind that I didn't check the other mission_template scripts, so maybe the other lines do it. But it should be handled here, to be honest.

Join us in the Modding Discord for faster responses, by some guys much more skilled than me.
 
Last edited:
Upvote 0
To help you think like a WB scripter, I'm going to walk through my thought process in bugfixing.

First: Identify the bug.
The try_*** loop is always claiming ":isFixed" = 0, so we'll start with that.

Second: Think about what could cause the bug.
One of two things might be happening, the slot is either being overwritten, or it's not being updated.
So we'll look though the script for an agent_set_slot operation pointing at slot_item_isFixed.
There is none, so that means the slot is never updated to reflect the bayonet's state, meaning it's always 0.
So we need to add a agent_set_slot to the consequence block.

Update this section to include slot setting:
Python:
                (try_begin),
                    (eq,":isFixed",0),
                    (agent_set_animation,":playerAgent","anim_fix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 1), # 1 marks the bayonet as fixed
                            (else_try),
                    (agent_set_animation,":playerAgent","anim_unfix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 0), # 0 marks the bayonet as unfixed
                (try_end),

Keep in mind that I didn't check the other mission_template scripts, so maybe the other lines do it. But it should be handled here, to be honest.

Join us in the Modding Discord for faster responses, by some guys much more skilled than me.
Thanks this worked I've also tried your first script with the unequipping the bayonet sabre but it causes the same problem as before with it playing the only one animation and it also doesn't unequip the saber bayonet here is the combined script for them both.
Python:
#Bajo script
              (eq, ":event_type", multiplayer_event_fixBayonet),
        (store_script_param,":eventNo",3),
        (store_script_param,":var2",4),
            (try_begin),
                (eq,":eventNo",1), #Event 1 - Fix Bayonet
                (assign, ":bayonet", "itm_british_baker_bayonet"),
                (assign,":itemFound",0),
                (assign,":playerAgent",":var2"),
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
                (eq,":bayonetCooldown",0),
                (agent_get_wielded_item,":curRifle",":playerAgent"),
                (item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
                (neq,":bayonetItem",0),
                (try_for_range,":curSlot",0,3),
                    (neq,":itemFound",1),
                    (agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
                    (try_begin),
                    (eq,":curItem",":curRifle"),
                    (assign,":itemFound",1), #break loop
                    (assign,":itemSlot",":curSlot"),
                    (else_try),
                    (eq,":curItem",":bayonet"),
                    (assign, ":bayonet_in_inventory", 1),
                    (assign, ":bayonet_itemSlot", ":curSlot"),
                    (try_end),
                (try_end),
                (eq,":itemFound",1), #the item was found and no witchcraft occurred
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
                (agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
                (try_begin),
                    (eq,":isFixed",0),
                    (eq,":bayonet_in_inventory",1),
                    (agent_set_animation,":playerAgent","anim_fix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 1), # 1 marks the bayonet as fixed
                    (agent_unequip_item, ":playerAgent", ":bayonet", ":bayonet_itemSlot"),
                            (else_try),
                    (agent_set_animation,":playerAgent","anim_unfix_bayonet"),
                    (agent_set_slot,":playerAgent",slot_item_isFixed, 0), # 0 marks the bayonet as unfixed
                    (agent_equip_item, ":playerAgent", ":bayonet"),
                (try_end),
                (agent_unequip_item,":playerAgent",":curRifle"),
                (agent_equip_item,":playerAgent",":bayonetItem"),
                (agent_set_wielded_item,":playerAgent",":bayonetItem"),
                (try_begin),
                    (eq,":rifleAmmo",0),
                    (agent_set_ammo,":playerAgent",":bayonetItem",0),
                (try_end),
                (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
                (agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
            (try_end), #Bajo script
 
Upvote 0
I can tell you, but you should think read through the try_for_range item slot loop line by line and see why this could be.

Python:
(try_for_range,":curSlot",0,3),
                    (neq,":itemFound",1),
                    (agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
                    (try_begin),
                    (eq,":curItem",":curRifle"),
                    (assign,":itemFound",1), #break loop
                    (assign,":itemSlot",":curSlot"),
                    (else_try),
                    (eq,":curItem",":bayonet"),
                    (assign, ":bayonet_in_inventory", 1),
                    (assign, ":bayonet_itemSlot", ":curSlot"),
                    (try_end),
                (try_end),

Line 1: The loop will run through slots 0, 1, and 2. This is the top, and two middle, inventory slots. First bump that 3 to a 4, since there are four weapon slots and try for range loops do not include the last int of the range.
Line 2: This will prevent any lines below this to be read if ":itemFound" is equal to 1. It's a loop breaker. We'll come back to this.
Line 4: If the ":curItem" is equal to the previously assigned ":curRifle" continue inside this try_*** block.
Line 5: If this line is read, the ":itemFound" is set to 1, and the loop breaks. This is why the bayonet isn't being checked. If the bayonet comes after the rifle, the loop is already broken and it doesn't have a chance to be read and set.

So, we the easiest fix would be to split this to two try_for_ranges, one for bayonets and one for rifles.

Python:
(try_for_range,":curSlot",0,4), # Remember, always desired range +1
                    (agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
                    (eq,":curItem",":bayonet"),
                    (assign, ":bayonet_in_inventory", 1),
                    (assign, ":bayonet_itemSlot", ":curSlot"),
                (try_end),

Just pop that in underneath the Rifles loop, but before the (eq,":itemFound",1), flow control. And, of course, remove the additions made to the rifle try_for_range loop.
 
Last edited:
Upvote 0
Thank you so much it works perfectly and I can't thank you enough. Your replies were always great descriptive and easy to follow. I truly thank you one more question for mount and blade scripting would I need to learn mount and blade specific code or just standard python and do you know any good guides on it?. Again thank you and ill make sure that if i ever get anything done that you will be credited.
 
Upvote 0
I appreciate that, but no credit is necessary. I was doing it for that best answer diamond.

I suggest getting intimately familiar with the latest version of Lav's header_operations and just reading through interesting snippets in the forums and through open source module systems until you feel confident in your understanding on what everything means.

Knowing Python could help, but I can't write a single line of Python so I don't know if those skills are exactly transferrable.
 
Upvote 0
Hi me again forgot to ask you last time if you could expand on the ''(assign, ":bayonet", "itm_bayonet"), # or whatever the bayonet item_id is, if you want a different one per rifle, make a new slot called slot_item_unique_bayonet and assign them there. Then move this down to the commented out section below'' I'm not really sure what you meant by assigning them there? thanks
 
Upvote 0
So the version I had posted, with comments intact, assumes all rifles use the same sabre. But, if you wanted a different sabre per rifle, you could create a slot like slot_item_unique_bayonet in module_constants, and uncomment
Python:
# (item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet), # this is a variant needed if you want a different bayonet per rifle
in order to change the check from a single sabre item, to the sabre item stored in that slot.

Of course you'd need to update the Fixbayoneta code to include the bayonets on both the bayoneted and non-bayoneted versions of the rifles.

You could also do it without slots, but by using slots this script stays modular and you can just keep adding rifles and assigning the appropriate slots without any changes.
 
Upvote 0
So the version I had posted, with comments intact, assumes all rifles use the same sabre. But, if you wanted a different sabre per rifle, you could create a slot like slot_item_unique_bayonet in module_constants, and uncomment
Python:
# (item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet), # this is a variant needed if you want a different bayonet per rifle
in order to change the check from a single sabre item, to the sabre item stored in that slot.

Of course you'd need to update the Fixbayoneta code to include the bayonets on both the bayoneted and non-bayoneted versions of the rifles.

You could also do it without slots, but by using slots this script stays modular and you can just keep adding rifles and assigning the appropriate slots without any changes.
I tried that here is fixbayoneta pretty sure that's what you meant?
Python:
            (item_set_slot,"itm_british_brown_bess_bare",slot_item_bayonetItem,"itm_british_brown_bess"), #set each non-bayoneted rifle to its bayoneted version       
            (item_set_slot,"itm_british_brown_bess",slot_item_bayonetItem,"itm_british_brown_bess_bare"), #set each bayoneted rifle to its non-bayoneted version
            (item_set_slot, "itm_british_brown_bess", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed             
            (item_set_slot,"itm_french_charleville_bare",slot_item_bayonetItem,"itm_french_charleville"), #set each non-bayoneted rifle to its bayoneted version       
            (item_set_slot,"itm_french_charleville",slot_item_bayonetItem,"itm_french_charleville_bare"), #set each bayoneted rifle to its non-bayoneted version
            (item_set_slot, "itm_french_charleville", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
            (item_set_slot,"itm_british_baker_rifle",slot_item_unique_bayonet,"itm_british_baker_rifle_bayonet"), #set each non-bayoneted rifle to its bayoneted version       
            (item_set_slot,"itm_british_baker_rifle_bayonet",slot_item_unique_bayonet,"itm_british_baker_rifle"), #set each bayoneted rifle to its non-bayoneted version
            (item_set_slot, "itm_british_baker_rifle_bayonet", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
and here is the new script
Python:
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
(item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet),
(assign, ":bayonet", "itm_british_baker_bayonet"),
(neq,":bayonetItem",0),
im not sure whats wrong there it seems the baker-rifle cant do the whole fix and unfix thing i would like to try to fix it myself but im not sure where to start could you point me in the right direction and ill try to fix it thanks
 
Upvote 0
You're on the right path, but that's still not quite right.

First, you are no longer assigning slot_item_bayonetItem for the itm_british_baker_rifle and itm_british_baker_rifle_bayonet, which is the way the script knows a weapons have a variant to fix/unfix to. That's why the baker isn't working. You need to readd the lines that assign the companion rifle to that slot.

Second, you're storing things in the local var ":bayonet" twice.
Remove the line (assign, ":bayonet", "itm_british_baker_bayonet"),.
because you're already pulling the info stored in slot_item_unique_bayonet in the line above, now you're just overwriting it.

With that being said, you're also not assigning the slot_item_unique_bayonet correctly. You put the fixed bayonet variation into the slot meant for the sabre weapon. I.E. If brownbess needed a socket bayonet, you'd assign itm_socket_bayonet into slot_item_unique_bayonet not itm_british_brown_bess.

In summation,
  1. readd the lines that assign slot_item_bayonetItem for both baker rifles
  2. properly assign slot_item_unique_bayonet for EACH variation of the rifle, making sure to assign the SABRE not the fixed version since that's how the flexible version of the script determines which weapon the agent must be holding to fix a bayonet, and what weapon to add when they unfix the bayonet.


Also, don't be afraid to start smaller. Slots and the like are pretty advanced stuff, and not easy to understand without a strong foundational understanding of MBScript. If you're getting lost, revert back the generic sabre variant of the script from earlier and return to this when you're feeling a little more confident that you know what's up.
 
Upvote 0
yeah, that did it thanks and ill be trying to do smaller stuff from now on. (spent a whole week on this even before posting for help, so I have enough of bayonets for now :dead:) also thanks for replying even after getting best answer, you've been a great help.
 
Upvote 0
Yeah man, 100%.

I always try to encourage people to mod, I've been doing it for 14 years and it's my most rewarding hobby.

If you need to field any more questions, please feel free to drop into my inbox or into the modding discord.
 
Upvote 0
Seems like it hit the veriable limit when i tried compileing it. Is it possible to add more veriables then the limit?
 
Upvote 0
Back
Top Bottom