• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Looting Muskets with Bayonets

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
Another problem with the musket and plug bayonet. I kill an enemy who is waving one of these around, having already fired his shot and converted it into musket+bayonet. So what I loot from him is musket+bayonet. Sometimes I can separate it back into musket and bayonet by equipping it, drawing and sheathing it. And sometimes I can't. If I've looted more than one then typically I can convert one back to separate musket and bayonet, but equipping, drawing and sheathing the next one still leaves me with a musket+bayonet. Which is annoying if you've just captured three of the things and want to hand them to your officers... (Yes, I did loot some ammo as well.)
 
@Jack Rackham: Can you make any sense of this?

I might mention that I also saw an Arguebuse being fired from shoulder-mode by an officer on a savegame posted by Hylie.
Just in case you'd want to know....
 
@Jack Rackham: Can you make any sense of this?
The only reset I have added is when you sheath your own blade. Then NPC:s should
put back possible hip musket to their shoulders. Now if you loot one in hip mode
there's obviously no reset for that case.

Maybe something could be added when a character dies. If he still has got anything in hipmode:
reset that gun to shoulder mode.
 
To reset a long gun to shoulder mode you need to draw your sword and then resheathe it. This resets the long gun to your shoulder.
 
I tried that. I drew and resheathed the musket+bayonet. I drew and resheathed a cutlass, then drew and resheathed the musket+bayonet. The only way I found to convert a second musket+bayonet into separate musket and bayonet was to equip the first musket I'd separated, which is a gun, then equip and resheath the second musket+bayonet. The first musket went back onto my back, taking the second musket with it and leaving the second bayonet as my new blade.
 
I'll see if I can do anything with the looting situation of these special weapons.
Done.
Both blademketK and blademketB will be switched at the moment a character dies.
Switched to their respective guns (and knife if blademketK).
 
I found a bug: blademketK and blademketB didn't reset to muskets on your sholder when sheathing them.
I'm not gonna tell who caused it. :wp
Comes with the next upload.
 
Code:
void gun_mketK()
{
   aref attack = GetEventData();
   string weaponID = GetCharacterEquipByGroup(attack,GUN_ITEM_TYPE);
//   if (weaponID == "") return; // PB: Prevent potential error messages
//JRH: oops this line stopped the action
@Jack Rackham: How was that line causing problems?
That same line is in ALL similar quest cases to abort them if you don't have any gun equipped at all.

Or is it because it isn't actually used in that spot and occurs AGAIN later.
If so, I'd suggest this simplification:
Code:
#event_handler("blademketK_as_gun", "gun_mketK");
void gun_mketK()
{
   aref attack = GetEventData();

   RemoveCharacterEquip(attack, BLADE_ITEM_TYPE );
   TakeItemFromCharacter(attack, "blademketK");
   GiveItem2Character(attack, "blade_mKnife");
   EquipCharacterByItem(attack, "blade_mKnife");

   float GunCurCharge = LAi_GetCharacterRelCharge(attack); // Levis
   RemoveCharacterEquip(attack, GUN_ITEM_TYPE );
   GiveItem2Character(attack, "pistolmket");
   EquipCharacterByItem(attack, "pistolmket");

   aref weapon;
   string weaponID = GetCharacterEquipByGroup(attack,GUN_ITEM_TYPE);
   if (weaponID == "") return; // PB: Prevent potential error messages
   Items_FindItem(weaponID, &weapon);
   if(weapon.model == "musket")
   {
     weapon.model = "musket_back";
     RemoveCharacterEquip(attack, GUN_ITEM_TYPE );
     EquipCharacterByItem(attack, "pistolmket");
   }  

   attack.chr_ai.charge = GunCurCharge; // Levis

   if(IsMainCharacter(attack) && DisableReloadWhileFighting()) PlaySound("PEOPLE\clothes1.wav");
}
 
I think that other section may also be simplified like this:
Code:
    //JRH -->
     if(!IsMainCharacter(chr))
     {
       if(CheckCharacterItem(chr, "blademketK"))
       {
         TakeItemFromCharacter(chr, "blademketK");
         GiveItem2Character(chr, "blade_mKnife");
         GiveItem2Character(chr, "pistolmket");
       }

       if(CheckCharacterItem(chr, "blademketB"))
       {
         TakeItemFromCharacter(chr, "blademketB");
         GiveItem2Character(chr, "pistolmketB");
       }
     }
     //<-- JRH
Since the character is dying anyway, I think there is no need to re-equip any weapons on the now-dead character.
Similarly, they don't need to be given their fists because they won't get to use them as a corpse.

Not sure if I'm right here though, so please correct me if I'm wrong.... :oops:
 
How was that line causing problems?
Because the player has no gun at the time for that line, it's a blade. It's ok in all cases except these two.

Since the character is dying anyway, I think there is no need to re-equip any weapons on the now-dead character.
Similarly, they don't need to be given their fists because they won't get to use them as a corpse.

Not sure if I'm right here though, so please correct me if I'm wrong....
There was problems when looting blademuskets according to GreyRoger so I thought the best would be to
get those weapons in their musket mode.
 
Because the player has no gun at the time for that line, it's a blade. It's ok in all cases except these two.
How about the suggestion I posted for it above? I think that is technically the same, but with some unnecessary lines removed.

There was problems when looting blademuskets according to GreyRoger so I thought the best would be to
get those weapons in their musket mode.
True. I think just getting the items in place will be enough for looting though.
We'll see.... :wp
 
Here's the updated version of the storyline. You'll probably need it to use the savegame in the thread No maps for sale.

Incidentally, take a look at the officers' inventories. Two of them have multiple muskets. But I only gave them one each...
Apparently it is still possible for odd stuff to happen with this. :(
 
And one of the officers had a blademusket, though possibly not at the time of that savegame. He didn't change it to musket plus bayonet when I drew and sheathed my weapon. I changed it for him by taking it off him, equipping it, drawing and sheathing, and then not giving the musket and bayonet back to him because he'd acquired a couple more by himself. xD
 
And one of the officers had a blademusket, though possibly not at the time of that savegame. He didn't change it to musket plus bayonet when I drew and sheathed my weapon. I changed it for him by taking it off him, equipping it, drawing and sheathing, and then not giving the musket and bayonet back to him because he'd acquired a couple more by himself. xD
Would you be able to give more details on exactly how and when this happens and how we might be able to replicate it?
At the moment it still sounds a bit mysterious, so we need to somehow narrow it down. :facepalm
 
I wish I could nail down specifics so I could give a complete and conclusive report. All I know is that sometimes after a fight the officers have multiple muskets and bayonets. One thing I can say is that it only happens to musket and bayonet combinations. I give Two Dogs a musket and cutlass, no bayonet, and he never spawns new muskets. (Mind you, he has less opportunity to do so because he goes off on his own to lead you towards the slave camp, so does not get involved in fights against any random thugs or highwaymen encountered on the way there.)

And some similar weirdness seems to happen during the prison escape itself. There are three guards, each equipped with musket and bayonet. By the time we've finished killing and looting them, I sometimes have 4 muskets.

One thing I have noticed. I thought if an officer had a blademusket, and you draw and sheathe your weapon, it's supposed to change his blademusket into musket and bayonet? That definitely isn't happening.

Anyway, since the prison guards all have muskets and you get jumped by a squad shortly after you leave prison, there are plenty of muskets around. Then you just need to walk out of town and get attacked by random thugs. Which means you can use "Ardent" as a testing ground for muskets and you won't need much time before you have plenty of them to test!
 
Back
Top