• 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 Castaway start gets error papers in ship chest and weird invisible item near chest

Tingyun

Corsair
Storm Modder
Attached saved game, simply enter the ship, proceed to the cabin, and you can see the following (also, tested and the same if I start a new castaway, cheat 100k gold, and immediately buy any vessel):

1) In castaway start, there is an unretrievable letter item in the ship chest. Seems to be this error: Fixed - Start as swordmaster - an unretrievable "letter" item in starting tutorial chest. | PiratesAhoy! . Here's some of the relevant code for the last few player types from characters_init.c :

case PLAYER_TYPE_CASTAWAY:
ch.shiplog.Entry.log0 = "An old friend of the family has bought me passage on a ship bound for the New World. But whether he did that out of kindness or just to get rid of me, I do not know. I have never had much luck in Europe and the little I own in this world was safely stored in my cabin. It will be difficult to get on my feet, but I am determined to succeed at last!";
// Deliberately no items
break;
case PLAYER_TYPE_CUSTOM:
GiveItem2Character(ch, "blade4");
GiveItem2Character(ch, "pistol1");
break;


2) There is a weird unretrivable invisible item near the ship chest. You get a hand icon over it, but no actual item gets picked up when hitting spacebar, and I can't see an item.

This persists as you change ships, as long as the ship has the smallest (lugger or sloop style) interior scene.

Perhaps, what is happening is because the castaway starts with one of those, the dinghy, but his version has no cabin, something gets messed up when you trade up to a real one, with some item persisting perhaps?

EDIT: Confirmed it is caused by the Dinghy. Started with a swordmaster with the dinghy ship, cheated and bought an immediate upgrade to a lugger, weird item is there.

EDIT2: Also confirmed the weird invisible item persists any time the player trades ships to a small sloop/lugger interior ship. It goes away if you go to a different interior scene ship, and then returns if you purchase the smaller scene again. It does not exist for officer commanded small interior scene ships.

So it seems some permanent modification of that ship scene occurs for the player controlled ship.




@Pieter Boelen , Could I ask for your best advice and guess on something? These bugs seem pretty harmless, just 1) an extra error item in the ship chest and 2) some odd invisible item, (and, in the other bug report I just posted, 3) the ship deck graphic remaining a locked symbol, but you can enter and exit). I would like to just continue playing my current game and ignore them.

Do you foresee any trouble or greater problems from these 3 glitches, or am I probably fine to just continue playing and ignore them?

Relatedly, any console codes that could erase the contents of the ship's chest to clear out that error item, or generally any codes to reset the interior scene of the ship?

Thanks so much for your advice! I really like my current campaign. :)
 

Attachments

  • -=Player=- Barbados. Speightstown port.rar
    577.7 KB · Views: 123
Last edited:
Is the Toss button enabled for them?
It is easy enough to get rid of them using console, but you need to know the item ID
You can use DumpAttributes(pchar) to write all player attributes to compile.log, which should contain a list of all items.
Then use TakeItemFromCharacter(pchar, "*item ID*") .

Did you change any default settings, such as disabling the Ammo Mod?
 
Hi Pieter!

I changed several default settings, but not ammo mod, I kept that on. ;) (especially since the FAQ says turning it off causes bugs, but also because it is very fun). Nothing I changed should cause any of this--I set salaries to x20, turned off autolooting of corpses, made ships on worldmap not show their type, enabled brothels.

The game prevents me from picking up the paper item, so I can't throw them away, it stays in the chest.

I ran Dumpattributes, but it only seems to list stuff I am carrying, not stuff in my ship chest.
 
If you put the DumpAttributes in the correct so spot in itemsbox.c, you could make it return the items from the box instead.
If you can't track that down, eventually I will. But not right now as I'm quite tired after a long day traveling.
 
Hi Pieter,

Of course! Rest well, I hope you had a good trip.

I will try again with dump attributes tonight. I'll report back if I can figure it out, if not, I'll wait for you.

This is certainly not an urgent issue at all, and my saved game appears to be working fine. :)
 
I'm sorry Pieter, I'm having trouble figuring this one out. I will wait for you to have time sometime in the future. There is absolutely no urgency or reason to rush, please take your time and wait for sometime in a couple of weeks when it is convenient. I will keep with my current saved game for now, I think these bugs shouldn't create broader issues and my captain's cabin will just be a little weird in the meantime. :)
 
Remind me this evening (European time) and hopefully I'll be at my computer then.
Should not take too much time to do at least a bit.
 
In PROGRAM\INTERFACE\itemsbox.c add this line:
Code:
void InitInterface_RS(string iniName,ref itemsRef,string faceID)
{
   ref pch = GetMainCharacter();
   DumpAttributes(itemsRef); // THIS LINE!!!

Now start the game, open the box, then check compile.log and it should contain a list of the item IDs that were in the box.
 
The paper or letter item icon use to show up when something concerning items has gone completely wrong.
 
Well, Jack Rackham is right, something has gone completely wrong. I purposefully left the art of war book and a few bullets in the box to know where box contents would appear, and here they are:

items =
= 1
relationbook = 1
gunpowder = 6
pistolbullets = 6


The item is " = 1" haha.

So the letter item simply doesn't exist? ;)
 
So something in the castaway start is creating a "" item.

Is there a version of TakeItemFromCharacter(pchar, "*item ID*") I can try that would work on my chest? I can't pick the item up, it is locked to the chest.
 
This is the problem:
Code:
start_weapon =
  blade =
  gun =

Adding this if-statement in the Free Play both_reaction.c file should fix it:
Code:
            if(playerBlade != "")
               TutDeck.box1.items.(playerBlade) = 1;

This removes all items from that box:
Code:
   ref TutDeck = &Locations[FindLocation("Tutorial_Deck")];
   DeleteAttribute(TutDeck, "box1.items");
 
Pieter,

Wonderful you fixed it!

But I think we still have the other half of the bug...let me report as a new bug report, I should have seperated them to begin with.
 
Could you post the update file here for reference?
 
Could you post the update file here for reference?
My modified both_reaction.c file? I deliberately didn't post it because I am still on the 28 July version of all files, so it wouldn't be 100% compatible.
 
My modified both_reaction.c file? I deliberately didn't post it because I am still on the 28 July version of all files, so it wouldn't be 100% compatible.
it was more a question for @Tingyun I think he has a version which he tested already.
 
I did not test yet actually, I just wanted to say thanks and assumed it was fixed. :)

I am not able to playtest right now, and am on a mobile device rather than my computer, so I can't edit files right now.

I am happy to incorporate it into the aug 24 version and run a test, but I will need to wait until tonight or later this week, depending one what happens. If we wanted to test it earlier, if someone posted the file I imagine Imado would be willing to test (he just needs to start as a castaway, buy a Lugger, and then check his chest to make sure no papers are there)l

If it hasn't already been done, I'll take care of this by the end of the week. :)
 
I think I must have added it to the wrong place in the file, because the item was still generated on a new start. I really couldn't figure out where to add it, so I put it near the beginning, tried a couple of places.

Can someone with the Aug 25 version and a bit more knowledge add and test? :)
 
Last edited:
Back
Top