• 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 Transfer Between Two Companion Ships: Officer Transfer locks up

Oh right, I feel better now. :)

What with all this whack-a-mole I’ve been doing I thought I’d hit the angriest one!

There has to be a reason for this, might be something I’ll look into.
 
There has to be a reason for this, might be something I’ll look into.
Indeed it could very well be this bug is properly fixable. Would be nice if that were done.
For all I know, it might be quite a quick fix. But I don't know. :razz
 
transfer_characters.c
Code:
   if(CheckAttribute(myCh,"InterfaceParam.i1")) {
     nMyCharacterCompanionPlace = sti(myCh.InterfaceParam.i1);
   } else {
     interfaceResultCommand = RC_INTERFACE_TRANSFER_MAIN_RETURN;
     EndCancelInterface(true);
     return;
   }
The else statement is what’s throwing it out. I removed it and it let me in, but it’s still very broken. Was this a bad attempt to disable it?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    183.8 KB · Views: 115
Was this a bad attempt to disable it?
Looks like it, yes.

So that means the "InterfaceParam.i1" attribute isn't set if you try to swap between two companion ships.
First thing to fix then is to set that attribute.
 
I keep on seeing this...
Code:
RUNTIME ERROR - file: interface\transfer_main.c; line: 205
missed attribute: passengerslist
RUNTIME ERROR - file: interface\transfer_main.c; line: 205
null ap
RUNTIME ERROR - file: interface\transfer_main.c; line: 205
null ap
RUNTIME ERROR - file: interface\transfer_main.c; line: 205
no rAP data
 
Check what is on that line, then do a DumpAttributes on whatever should hold that attribute; probably a character.
I think only the player has a "passengerslist", so maybe you will find that the character is some NPC.
 
Code:
tempnum1 = GameInterface.passengerslist.(attributename).captainindex;
Returns zero, no dump list. That’s using my ship and also two companions.
 
Right, that’s completely wrong... it should be nCompanionIndex, or something like that. After changing it to that I now get the correct companion ID if using my own ship, otherwise it’s a null value. The error message is also now gone.
 
Last edited:
I think somebody said something about interfaces being laborious. Sheesh, warn me twice next time. :sick

Err... actually, this file is proper bugged. I’ll leave it here for now, but there’s an awful lot wrong with it. I’m working on it!
 

Attachments

  • transfer_characters.c
    20.8 KB · Views: 127
Last edited:
Can somebody test this please. :yes

The fix which was posted here is not necessary with the above file. Now, it’s ever so slightly bugged - sometimes, usually the first time transferring after loading a game, the pictures don’t update properly, but even though it might look like they haven’t the officers do transfer without a problem, and once the screen is exited and reloaded then the pictures will be displayed as they should be. What I’m thinking is that it might be better to have two independent interfaces for this, one for player-to-companion and another for companion-to-companion, simply because they always conflict one way or the other.

I’ll think about companions being able to transfer passengers between one another. Not that’s it’s much of a big deal, but it’d be nice to have a working interface for it. So yeah, the companions can’t actually transfer passengers between each other as it stands but their officers will be correctly displayed, you just can’t do anything with them unless you use your own ship.
I did try! :shock
I don’t listen, ever. :rolleyes:
 
What I’m thinking is that it might be better to have two independent interfaces for this, one for player-to-companion and another for companion-to-companion, simply because they always conflict one way or the other.
Why is that, I wonder....?

I’ll think about companions being able to transfer passengers between one another. Not that’s it’s much of a big deal, but it’d be nice to have a working interface for it. So yeah, the companions can’t actually transfer passengers between each other as it stands but their officers will be correctly displayed, you just can’t do anything with them unless you use your own ship.
Is it possible or even necessary for companion ships to have more than 3 extra officers?
For the most part, I tried to rewrite some of the "Skill Code" so that in theory it should be able to handle NPC ships with officers and passengers as well.
But I'm not 100% sure if that works quite right and I'm also not sure if it is needed.
 
It’s not about them having more than four officers, it probably shouldn’t even be allowed because of the potential buffs.

It’s purely about the interface, the ease of swapping officers between the player’s ships, which could be more important if extra ship slots become available. Currently the player must use their own ship if they want to swap about, which could be a long task if they have a dozen ships including some berthed.

When I say two interfaces, I probably mean duplicating some of the functions so that the same logic doesn’t apply to both cases. For example, for companion-to-companion the skills won’t display, and currently it’s not possible to move them - in order to do this, the file would require a complete rewrite.

Wait, so if a companion has officers then their skills don’t actually do anything? If that’s the case then I probably just wasted the entire night with that file! o_O
 
Last edited:
For example, for companion-to-companion the skills won’t display, and currently it’s not possible to move them - in order to do this, the file would require a complete rewrite.
Why would the skills not display? :confused:

Wait, so if a companion has officers then their skills don’t actually do anything? If that’s the case then I probably just wasted the entire night with that file! o_O
Their skills should do something. But I don't know for certain if that works.
You can check ingame by looking at the companions' skills in the F2>Ship interface and then see if those numbers correspond with what you would expect.
The Ship Interface numbers are the numbers that are actually used by the game.
 
Why would the skills not display? :confused:
It’s fine if using the player ship, but they don’t show when transferring between two companions. I intend to look at this.
The Ship Interface numbers are the numbers that are actually used by the game.
Ah, well the summary skills for companions definitely do change when officers are placed, so I assume it works fine.
 
Actually... I’ve fixed it already.

Replace...
Code:
GameInterface.strings.CharacterName = XI_ConvertString("Summary Skills");
i = GetCompanionIndex(refMyCharacter,nMyCharacterCompanionPlace);
With...
Code:
GameInterface.strings.CharacterName = XI_ConvertString("Summary Skills");
i = refMyCharacter.index;
The skills will now show in companion-to-companion transfers. :)

All I need to do now is enable the officers to be moved.
 
@Pieter - Look at this! :woot
In the officer transfer (between player and companion) you don't get two ships officers just the companion with four slots (as though they are shore party etc) plus your passengers in the line above. So given that - there is no way that it would work between two companions (who don't have passengers)
I think only the player has a "passengerslist"
This is actually incorrect, they do. I’ve just realised that when officers are transferred over to a companion, they stay there because the interface does not actually remove them from the passenger list, only from the officer slot. In other words, after removing an officer from a companion it not only returns them to the player, but also dumps them in their own passenger list. What I’m saying here is that the officer is duplicated, which therefore means that if the player could access their companion’s passenger list, which by the way is very possible and hence the attached image, then officers could be recursively duplicated.

I’ve been pulling my hair out for hours because I could not understand why I was seeing different results for the passenger list while messing with the file. It’s because I was looking at the companion’s passengers, not my own! :rolleyes:

Just to make it very clear, the attached image is a transfer between two companions.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    195 KB · Views: 111
Last edited:
Actually, they are only duplicated one time. Still, that means lots and lots of twins! So basically, without even realising it people could have companions which have maybe dozens upon dozens of officers sitting in them.
 
Last edited:
If those duplicates are made, do they get a new character index and ID?
 
Back
Top