• 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 Tomahawk auto unequiping

Tingyun

Corsair
Storm Modder
Forgot to report this a week ago, just confirmed with a current save. Either of the saved games in the attached rar that I made for a different bug report will allow you to confirm the bug.

The tomahawk behaves very strangely in auto unequiping itself, and auto unequiping your gun. Most times you equip it and a pistol in the inventory screen, only one will be equiped on exiting. Then as you try to equip the other, and exit the inventory screen, the other one will then unequip. Sometimes you can get them both equiped, and then when you change scenes one or the other will once again unequip when you are in the new scene. It is not every time, but most times.

I think this happens with the pistol, not so much with the musket (and maybe the musket being in the inventory, or the bows, is messing with the tomahawk and making it not want to work with the pistol, not sure). But tomahawks and pistols don't get along.

Probably not a huge priority to fix of course.

(side note, but my earlier mention of the tomahawk as a balancing concern a week ago is probably mistaken. By lvl 10, I had swords I preferred to use instead of the tomahawk from random encounters, even if I had been willing to use it, so it really doesn't matter, just a few levels that it is relevant for).
 

Attachments

  • Test saved Tingyun comparison maltese.rar
    1.1 MB · Views: 97
Probably a side-effect of the tomahawk being a special Indian weapon?
There is indeed some code in place to equip them in relation to the bow and arrow.
 
@Jack Rackham

This is linked in the new content thread as a bugfix, but no file is here.

Is it because it is already in the new baker rifle files you posted, and they obsoleted this?
 
@Jack Rackham

I installed all the new content fixes released so far (including the baker rifle/fists arrows fix from you, and everything everyone has put out) except this one, and am currently testing.

Could I ask for your guidance on two issues?

First, could you direct me to which of the files on your ftp this fix was on?

Second, when I acquired a tomahawk and tried to equip it, I got an error that said something like "error quest tomahawk could not be found in any function" I had not seen this before, so it must have been caused by one of the new content fixes. But maybe a later file referred in some way to this one I am missing?

Here is the error log, but I don't think it contains that error message that was displayed:

RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 2661
Using reference variable without initializing
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 2661
null ap

I don't think that has anything to do with the tomahawk though, odd the error message from on screen wasn't put into the error log.

If you can help point me to which file on your ftp to get this fix, I can try installing and see if that resolves the error. I'm betting its just because I didn't download this fix yet.
 
Last edited:
I can equip the tomahawk without any problems. Could it be that LAi_events.c have been changed
a lot of times recently (most by me) and you don't have the latest version?
It would be nice with a new zip or installer soon.

Here's a very merged one I'm using today.
 

Attachments

  • LAi_events.c
    124.9 KB · Views: 133
@Jack Rackham I checked and I had the latest LAi_events, but after a detailed look through all the fixes using winmerge, I've located where I think the problem arose.

In the old (Aug Levis zip) quests_common.c, we had this:

Code:
        case "indian_arrow_tomahawk_equip_check":
            if(IsEquipCharacterByItem(Pchar, "pistolbow"))
            {
                //ok
            }
            else RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
        break;

        case "indian_pistols_equip_check":
            if(IsEquipCharacterByItem(Pchar, "bladearrows") || IsEquipCharacterByItem(Pchar, "tomahawk")
            || IsEquipCharacterByItem(Pchar, "shield_hand") || IsEquipCharacterByItem(Pchar, "shield_back"))
            {
                RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
                if(!CheckCharacterItem(Pchar, "bladeX4")) GiveItem2Character(Pchar, "bladeX4");
                EquipCharacterByItem(Pchar, "bladeX4");
            }
        break;

In the more recent version included with the Baker Rifle mod, we those lines changed to:

Code:
        case "indian_arrows_equip_check":
            if(IsEquipCharacterByItem(Pchar, "pistolbow"))
            {
                //ok
            }
            else RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
        break;

        case "indian_pistols_equip_check":
            if(IsEquipCharacterByItem(Pchar, "bladearrows")
            || IsEquipCharacterByItem(Pchar, "shield_hand") || IsEquipCharacterByItem(Pchar, "shield_back"))
            {
                RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
                if(!CheckCharacterItem(Pchar, "bladeX4")) GiveItem2Character(Pchar, "bladeX4");
                EquipCharacterByItem(Pchar, "bladeX4");
            }
        break;

I merged that in initially (it looks like an intentional improvement), but I think that change in the newer version of the file is the source of the error?

Specifically, the newer version:

changes indian_arrow_tomahawk_equip_check to indian_arrows_equip_check

and erases
|| IsEquipCharacterByItem(Pchar, "tomahawk")

EDIT tested and changing back to the August version of those lines fixes the error. But they were probably changed for a reason?

Could you share your current version of the file?
 
Last edited:
In other words: Incompatibility resulting from multiple people editing the same files at the same time.

Once we start making proper use of the Notice - Build Mod Version Control | PiratesAhoy!,
this should hopefully no longer happen (so often) as that is a system specifically intended to keep everyone on the same page at all times and prevent this from happening.
So if anyone wonders why he should care about that thread..... this is why. ;)
 
@Jack Rackham

Your version is the same as baker rifle one, and it does give the error, just tested.

Tomahawks can be equiped, but watch the upper left of your screen when you do so. The message "quest name indian_arrow_tomahawk_equip_check not found in any function" will be displayed as an error message after you equip and exit the inventory screen.

So is the renaming of indian_arrow_tomahawk_equip_check to indian_arrows_equip_check intentional? If so , then does something else need to be told to look for that function instead?

Is the deletion of || IsEquipCharacterByItem(Pchar, "tomahawk") intentional also?

@Pieter Boelen

Version control makes great sense. In this case though I can't imagine anyone else was editing Jack Rackham's tomahawk code. The only people who had that file anyway were me (in the initial baker rifle edits) and then Jack when I handed it off to him. I didn't edit it, so I think something else is going on.
 
Jack, here is one I merged using the old aug 25 version + baker rifle entries, so you can compare on the tomahawk code.
 

Attachments

  • quests_common.c
    223.5 KB · Views: 99
I think my version is the right one. (I don't get any error message left corner)
Instead it may be your version of INTERFACE/items.c that is still poiting
to something in quests_common.c that no longer exists.
Try this one:
 

Attachments

  • items.c
    78.3 KB · Views: 106
Yep, that was it, winmerge confirms I was missing stuff, my version hadn't been modified for months.

I think this file should be posted to New Content: I downloaded and installed literally everything that was directly linked to from there, and never came across it. Whenever someone makes a zip they would possibly miss it to.

Was it part of a larger update? As I said, I never could find the tomahawk auto unequiping fix that this thread is about, but I might have been simply not understanding where it is on your ftp. I want to make sure still not missing other related files.

Thanks for finding me the file Jack Rackham :)
 
Where? When you posted the tomahawk fix:

http://piratesahoy.net/threads/new-...a-4-0-public-release.27077/page-8#post-544837

you included a link to this thread. But you did not post the tomahawk fix in this thread.

That's why I asked above in this thread a couple of days ago for where the bugfix is, and Pieter suggested I look at your ftp. Then I posted I couldn't figure out where it was there and asked for directions on the ftp.

Can you point me to where it is posted?
 
Back
Top