• 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!

Medium Priority Strange Effects with Muskets using Quick-Equip

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
I looted a bunch of muskets and muskets with bayonets from a bunch of prison guards.
Then I pressed [F] to equip this new good stuff I've now got.

Naturally I was quite surprised when I saw I equipped TWO muskets:
upload_2016-1-11_19-50-51.png


Does seem pretty bad-ass though! :guns:
 
Actually, turns out I can mess things up just fine even without the Quick-Equip key.
This is what I managed to do using the Inventory menu:
upload_2016-1-11_19-54-26.png

Somehow.... :rofl
 
That's because one of them is a musket, i.e. firearm, and equipped on one side; and the other is a musket+bayonet, i.e. blade, and equipped on the other. When I was doing this, I could then equip and sheathe the musket+bayonet, which would then separate into musket and bayonet. Having looted the three guards, that got me a total of three muskets and bayonets, which means by the time I'm standing where you are, two of the officers are carrying a musket and bayonet as well. (Hint: you can only carry three musket bullets, so if you pick up two from a dead guard, hand one to an officer. Then if you are lucky and get two from the next guard, you haven't wasted one.)

But I thought muskets were supposed to have been fixed so that you they'd revert back to separate musket and bayonet when you killed the enemy, so that you shouldn't be looting musket+bayonet. On the other hand, I also found that if I ran out of ammo, my musket got its bayonet fixed and wouldn't separate again. If I then picked up some more ammo, I'd need to borrow one of my officers's muskets, equip and sheathe my musket+bayonet to separate them, then give the officer back his musket.
 
@Jack Rackham: Do you intend to have a look into this?
Grey Roger's new storyline makes for some good testing grounds as there are plenty of muskets to loot.
 
Yes I changed the looting situation so blademuskets (blade items) will be picked up as muskets (gun items) + a separate knife if possible.

So I wonder how that happened in post #1

Do you intend to have a look into this?
Guess I have to but I don't have much time this weekend - have to deliver Caroline K to her university
in another part of the country. :(

Back in action monday night.
I'll upload what I've got before leaving, just to clean up a little.

With an ammopouch or ammobag and you can carry more bullets.
 
@Pieter Boelen , it did happen once for me that killing a guard with a blademusket he
still got it when he died. By that I could equip both that one and an ordinary musket I already had.

But by drawing my blade and sheathing it again all was reset. Knife at left hip, musket on back.

I'll continue trying to repeat the bug...
 
What about then you equip one of them and you have it on your back?
Then what do you have equipped in your hand? Just your fists, right?
I think in such a case, the "equip any blade" option should be disabled altogether, no?
 
What about then you equip one of them and you have it on your back?
Then what do you have equipped in your hand? Just your fists, right?
You get the knife in your hand. If it's the later type with fixed bayonet I think you get fists equipped.

Another case:
If you got an ordinary blade equipped and equip a musket (without any bayonet) you will also
get all reset by drawing/sheathing the blade. (Knife at left hip, musket on back.)
 
I have fixed so when you try to equip a blademket from the inventory it changes to knife + musket (back)
resp fists + mket bayonet (back).

The Quick-Equip key is next but where's that code?
 
Okay, I have done what I could:

Tried to decrease the chance of looting bayonet muskets in wrong mode. Can still happen though.
Disabled equip a blademket from inventory or quick-equip button.
Can't happen anymore. so post#1 & #2 should be ok.
Muskets can still show up in hip mode when equipping them. Draw/sheathe works as a reset though.
 
@Jack Rackham: Instead of editing the Quick-Equip code in seadogs.c itself, perhaps you can make use of a simpler and more general solution.
Some options:
1. Set certain items to "skipequip = true"
2. Edit FindCharacterItemByGroup in CharacterUtilite.c so it won't return specific types of items:
Code:
string FindCharacterItemByGroup(ref chref, string groupID)
{
   // TIH --> new method that uses the blade/guns sorted arrays Aug24'06
   if(!CheckAttribute(chref,"items")) return "";

   int i,n;
   int itmqual;
   int high = -1;
   string highid = "";
   string curId = "";

   aref chit; makearef(chit, chref.items);
   for(i = GetAttributesNum(chit)-1; i >= 0; i--)
   {
     aref refItm;
     curId = GetAttributeName(GetAttributeN(chit, i));
     n = Items_FindItem(curId,&refItm);// returns item index and fills aref refItm

     // check to see if this item is even something we can bother with selecting
     if ( n < 0 )                  continue;// invalid item
     if ( !CheckAttribute(refItm,"id") )      continue;// no valid id
     if ( !CheckAttribute(refItm,"groupID") )    continue;// no valid groupid
     if ( refItm.groupID != groupID )        continue;// not what we are looking for, move along now
     if ( refItm == "telescope")          continue;// PB: do not find this for auto-equipping!
Maybe that could help towards a better solution?
 
Thanks Pieter. It's a little complicated as I not only want to disable equip for those items but
also change them into other items. (To reset.)

Like
if(newitm == "blademketK")
{
RemoveCharacterEquip(&PChar, GUN_ITEM_TYPE);
RemoveCharacterEquip(&PChar, BLADE_ITEM_TYPE);
TakeItemFromCharacter(&PChar, "blademketK");
GiveItem2Character(&PChar, "blade_mKnife");
GiveItem2Character(&PChar, "pistolmket");
EquipCharacterByItem(&PChar, "blade_mKnife");
EquipCharacterByItem(&PChar, "pistolmket");
}

if(newitm == "blademketB")
{
RemoveCharacterEquip(&PChar, GUN_ITEM_TYPE);
RemoveCharacterEquip(&PChar, BLADE_ITEM_TYPE);
TakeItemFromCharacter(&PChar, "blademketB");
if(!CheckCharacterItem(&PChar, "bladeX4")) GiveItem2Character(&PChar, "bladeX4");
GiveItem2Character(&PChar, "pistolmketB");
EquipCharacterByItem(&PChar, "bladeX4");
EquipCharacterByItem(&PChar, "pistolmketB");
}

Tested and works.
 
What items do you want to not be automatically equipable?
And do you require FindCharacterItemByGroup for them?
If you don't need that function, list them in there together with the "telescope" to prevent them from being equipped using the Quick Equip keys.
 
I think I got it Pieter. The problem is I can't prevent the 2 blademuskets from being looted
complely. Got 2 out of 50 possible.

Now if I just make a check in the killcharacter function: if pchar has got any of those 2 after a
killed enemy; switch them immediately. This is so much better than to wait with the switch to the equip moment.
This way you can't provide your officers with troublesome weapons which was a weak point.

I'll try that tomorrow instead.
 
I don't understand how corpses can carry the wrong types if they're being swapped out the moment the character dies.
Maybe that swapping happens at the wrong time?
For example, if it is done too late (after the Loot Box has already been generated), then the swapping would be pointless.
Could that be what is happening here?
 
Not sure. It seems like it's when they have a not fired musket at the hip they strange enough
end up with blademuskets in the moment of looting. But as I said not really sure if that's it.

I'll make some more tests tomorrow to see if we can get rid of it for good.
 
I can also have a search where those Loot Locators are made.
That would probably be relevant. Will check tomorrow.
 
@Jack Rackham: Maybe you should move this code from LAi_CheckKillCharacter in LAi_utils.c to LAi_Character_Dead_Event in LAi_events.c:
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
That is the function that creates the "looting" locator and it looks like you have edited it already in the past.
Might be a more reliable solution for that code to take effect. :doff
 
Back
Top