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

Solved Need Help - Repairs cause colored sails to be removed

needhalp

Landlubber
Sorry for posting this here guys, the bug reporting section seems to be down.

Anyways, loved getting my sails changed to black at the Pirate shipyard, except that everytime I repair my ship it resets the color to white...not a huge issue just irritating, as I do love my black sails and forking out $$$$ everytime to recolor them not to mention having to trek all the way back to Bermuda can be frustrating.

If anyone knows how to fix this would you mind spelling it out clearly for me, not exactly an expert modder here.
Many thanks.

if it helps im using GoF v1.2
 
im also having this problem. Im not sure if its intended though. Im looking into the files to try and find the solution but i dont have a clue where to begin.
 
I dont believe i have the know how to fix this bug. The code behind the pirate ship yard is completely different then the normal shipyards accross the carribbean. This means that the normal shipyards do not know the difference between the sail color you have and the default sail calor. So when you repair your ship the sail color changes. I have noticed that if you crew repair your ship/sails, teh sail color does not alter. I am convinced that it must be the way the ship graphics/models are being altered.

When a ship is new it looks like model 1. Then it is damaged, model 2 (temp). you go to a shipyard and repair it. The shipyard code must refer to the original ship model (model 1). There probably isnt even a single reference to the sail colors being different in the first place so there is no way that the shipyard will repair it to include an alternate color of sails.

I wonder if this means that the change of sail color is remembered at all. if it is. then the fix to this may be as simple as adding a line of code to the various shpyard codes.

There are various ship yard codes in both the 'Interface' folder (shipyard.c) and individual shipyards in the 'DIALOGS/russian/shipyard/' folder (Pirates_shipyard.c).

The answer must be something simple but i just dont understand enough of this type of programing to create anything new. I tend to specialize in minor tweaks.

I hope somebody else can fix this bug.
 
HI,

I'm sorry being out for a while and coming back at odd times....I installed G.O.F. this morning, great job !!!

The solution to fix the colors after sails are repeared is to open Program\Interfaces\Shipyard.c, look for :

1°)
void ExitRepairMenu()

and add these lines:

void ExitRepairMenu()
{
XI_WindowShow("REPAIR_WINDOW", false);
XI_WindowDisable("REPAIR_WINDOW", true);
XI_WindowDisable("MAIN_WINDOW", false);
//========================== PHILIPPE =================

if(sti(XI_refCharacter.ship.sp) == sti(realships[sti(XI_refCharacter.ship.type)].sp))
{
if(CheckAttribute(XI_refCharacter, "ship.sails.color"))
{
XI_refCharacter.ship.oldsails.color = XI_refCharacter.ship.sails.color;
}
if(CheckAttribute(XI_refCharacter, "ship.sails.gerald_name"))
{
XI_refCharacter.ship.oldsails.gerald_name = XI_refCharacter.ship.sails.gerald_name;
}
DeleteAttribute(XI_refCharacter,"ship.sails");
DeleteAttribute(XI_refCharacter,"ship.masts");
if(CheckAttribute(XI_refCharacter, "ship.oldsails.color"))
{
XI_refCharacter.ship.sails.color = XI_refCharacter.ship.oldsails.color;
}
if(CheckAttribute(XI_refCharacter, "ship.oldsails.gerald_name"))
{
XI_refCharacter.ship.sails.gerald_name = XI_refCharacter.ship.oldsails.gerald_name;
}
}
//==================================================================

2°)

void RepairStatShow()
{
int hp = MakeInt(GetHullPercent(xi_refCharacter));
int sp = MakeInt(GetSailPercent(xi_refCharacter));

//============================ PHILIPPE =========================================
if(CheckAttribute(xi_refCharacter, "ship.sails.color"))
{
xi_refCharacter.ship.oldsails.color = xi_refCharacter.ship.sails.color;
}
if(CheckAttribute(xi_refCharacter, "ship.sails.gerald_name"))
{
xi_refCharacter.ship.oldsails.gerald_name = xi_refCharacter.ship.sails.gerald_name;
}
//==============================================================================

Be careful, copy just the files to add, take care about "{" and "}" ...
 
Hi,

I added some lines in my code to get colored sails to the officers' ships too.

http://i445.photobucket.com/albums/qq176/Philippe_album/Interfacecouleursvoiles.jpg

Of course you can choose differents colors for each ship (and sails wouldn't loose colors when being repared...).

http://i445.photobucket.com/albums/qq176/Philippe_album/Blackbluered.jpg

Now, I just have to make the interface prettier...Feel free to ask me the code if you're interested.

And I think this topic could be marked as "solved".
 
i do not understand your instructions...

i find , in shipyard.c the text line
//////////////////// ðåìîíò ///////////////
void ExitRepairMenu()
{
XI_WindowShow("REPAIR_WINDOW", false);
XI_WindowDisable("REPAIR_WINDOW", true);
XI_WindowDisable("MAIN_WINDOW", false);

SetCurrentNode("SHIPS_SCROLL");

sMessageMode = "";void ShowRepairMenu()
...


i have found the right place. but the code you wrote is not clear to me... what goes where?

is there one step, or two steps?
--> 1°) ; 2°)

The first part of the file code ... is the same code that you give.
does YOUR code replace the original code?
//////////////////// ðåìîíò ///////////////
void ExitRepairMenu()

*insert your code here and replace the code that exists*

void ShowRepairMenu()

if not REPLACE, then what do we add? what do we not add? is it okay to have duplicate code?
 
HI,

I though it's clear, 1°) ==> first step, 2°) ==> second step.

"...copy just the files to add..." means "do not replace", just copy missing lines...Perhaps I should've wrote between any "====" and yes you've to have duplicate code, one when repear program starts, one when program closes.
 
Jean, If you're available I sure could use your help getting the surrender features working correctly in GOF Eras. It would mean a copy of my work before anyone else gets it and all of the new skins I've been working on as well as the new weather and water.

MK
 
Hi,

"ça roule ma poule!"...Saroule is my surname in french forums...:wp

Modernknight1,

I'll be very glad trying to help you.

Friendly,

Philippe
 
That's fantastic Phillipe!!! Thank you! :onya

I need to rar the whole mod in its current state which will take me a day or so. I will PM you in a couple days with the Beta link.

Thank you again Mate! :bow

MK
 
I added some lines in my code to get colored sails to the officers' ships too.
http://i445.photobucket.com/albums/qq176/Philippe_album/Interfacecouleursvoiles.jpg

Of course you can choose differents colors for each ship (and sails wouldn't loose colors when being repared...).
http://i445.photobucket.com/albums/qq176/Philippe_album/Blackbluered.jpg

Now, I just have to make the interface prettier...Feel free to ask me the code if you're interested.
Philippe, could you please post the code? ;)
 
Hi,

"ça roule ma poule!"...Saroule is my surname in french forums...:wp

Modernknight1,

I'll be very glad trying to help you.

Friendly,

Philippe

Philippe,

I may still need your help soon on some other stuff. However I figured out the surrender code on my own. Everything works!!!

Would you like to be a beta tester?

MK
 
Back
Top