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

Included in Build Custom Pre-Defined Character Choices

There is no function atm, but I could make you one (haven't tested this one).

Code:
int getRandomContrabandGood(ref CurIsland)
{
    aref islRef; makearef(islRef,CurIsland.Trade.Contraband);
    int n = GetAttributesNum(islRef)
    if(n < 1) return -1;
   int goodidx = rand(n);
   return sti(GetAttributeValue(GetAttributeN(islRef,goodidx)));
}

That should work.
While making this I found another bug in the smuggling findfirstcontrabandgood again :type1
 
If you are going to add such a function please add it in smuggling.c
 
if you want to make it more difficult for some players to smuggle at the start you could also use this function:

changeIslandSmugglingState(ref sisland, int change)

if you put change on 4 or higher and loop this for all islad they will all start with a very heavy patrol schedule ;).
 
if you want to make it more difficult for some players to smuggle at the start you could also use this function:

changeIslandSmugglingState(ref sisland, int change)

if you put change on 4 or higher and loop this for all islad they will all start with a very heavy patrol schedule ;).
I didn't yet think to make things extra difficult.
But if I'm deliberately not repairing the player ship AND deleting the cargo, that might make the start TOO hard.
Giving them some contraband at least gives the players something specific to do in the early game that isn't too easy. :cheeky
 
This is how I've got this set up now:
Code:
      if(GiveShip)
       {
         GiveShip2Character(PChar,PChar.ship.type,PChar.ship.name,-1,GetServedNation(),true,true); // PB: Instantly repair and resupply ship
       }
       else
       {
         if (CharPlayerType != PLAYER_TYPE_NAVAL_OFFICER)
         {
           SetCharacterGoods(PChar, CharGood1, 0); // dumps your cargo // KK
           SetCharacterGoods(PChar, CharGood2, 0); // KK
           i = getRandomContrabandGood(GetIslandByID(loadTown));
           if (i > 0) AddCharacterGoods(PChar, i, GetCharacterFreeSpace(PChar, i));
         }
       }
Most player types get their ship automatically repaired and supplied.
Agent and Cursed get contraband instead of a repaired & supplied ship instead to give them something to do in the early game.

Only problem is.... Sometimes this seems to cause error.log entries and I haven't been able to track down why. :confused:

Perhaps this is also a good time to set up a custom start for the Smuggler player type.
But that is yet more work.... And we don't have a default Smuggler starting character yet either.
 
please wait a little while with the smuggler character. I will give some info on how to set it up once it can be done nicely ;).

got the error logs?

Also this would give the player a hull full of contraband good.
I would fill only a percentage of it with a randomization
 
please wait a little while with the smuggler character. I will give some info on how to set it up once it can be done nicely ;).
I'll happily let you take care of that. :cheeky

got the error logs?
Not anymore.

Also this would give the player a hull full of contraband good.
I would fill only a percentage of it with a randomization
How's this?
Code:
if (i > 0) AddCharacterGoods(PChar, i, (3+rand(3)/10)*GetCharacterFreeSpace(PChar, i)); // PB: Between 30%-60% contraband
Why are we putting so much randomization at game start though?
Then if you don't like it, you can start another new game and see if your luckier this time.
Bit silly, no? :facepalm
 
OK how about José Joaquín Almeida for a Portugese privateer (although he took American citizenship).
He has a story and a half according to wikipedia.
But as I said once before I know nothing about ships and therefore which are correct for the period and any known details. He seems to have had mostly different schooners and later a frigate Luisa.

I'll look a bit further into his story and what is needed for the privateer type in the game since I know you are looking for others to do this adding characters. Don't know if there are any pictures/paintings but there is a description of him in the wikipedia article. So what chance of a specific character model if I can provide some better detail (@Jack Rackham ??)
 
OK how about José Joaquín Almeida for a Portugese privateer (although he took American citizenship).
He has a story and a half according to wikipedia.
Sounds cool to me! :woot
If you ENABLE_CHEATMODE and set the correct starting year in the Select Storyline interface for Free Play,
you can use the ship selection filters to find a potentially appropriate ship.
 
I don't want to say no but my priority is to go back and finish the GoldBug.
Maybe later on...
Yes fine no problem I can just choose the nearest appropriate existing model :thumbs1 but as a teaser I will add that the Wiki article does say in the 1820's he was one of the ruling council of the Swedish colony St Barts!
 
Mostly done but if I set his nation to PORTUGAL he gets a LoM and works for them. How can I retain his nationality as Portugese but current served nation as America to get a LoM from them (for the Anglo-American war) later he sort of serves Argentina and wreaks havoc with the Spanish. I know I can't set that up so if the player wants to follow his career he will need to get a LoM from an enemy of Spain at that time.

The other thing is his middle name - I have just added model.middlename = "Joaquin" in the initmodel.c file and will see the result. Another thing I suppose I will just see what happens is his early sloop was called Caroline - so that's what he gets -but there is another ship of that name already in the game (but not the same type)
 
Last edited:
From the Wikipedia article:
He emigrated to the United States in 1796, at 19 years old, settling in Baltimore, Maryland, where he obtained citizenship
So by the time he's a sea captain fighting on behalf of America in 1812, he's also an American citizen. Argentina doesn't exist in PoTC and probably never will, but you could make one of the Personal flags look like the Argentinian flag. By default America and Spain are enemies in the "Napoleonic" period so Almeida's service to America will already make Spain his enemy.

I shouldn't think Almeida needs to worry about the other Caroline. It's Midshipman Hornblower's starting ship. ;)
 
... by the time he's a sea captain fighting on behalf of America in 1812, he's also an American citizen. By default America and Spain are enemies in the "Napoleonic" period so Almeida's service to America will already make Spain his enemy.

Thanks. Good to know relations are set OK, Spain and America didn't have a treaty until 1819 which is about when Jose's first burst of activity declines (even if a lot was on behalf of the United Provinces (aka Argentina) after his treatment in Cartegena. I know he went native but I just wanted to keep his identity as Portugese (in more than just his name) rather than being 'just' an American especially since by 1816 he was trying to change nationality again to suit his new allegiances.

A good (blue and white) personal flag would be a bonus especially given wiki also gives the following "On November 8, 1818 Almeida sacked the British schooner Sir Thomas Hardy. According to the Lloyd's Agent in Madeira," the pirate approached the Sir Thomas Hardy, with blue flag, white and blue horizontal stripes, that he never lowered. They claimed they were not insurgents, but that they were at war with all the nations".

However one thread about personal flags shows they are much in demand and short supply so I guess tread warily is the keynote.
 
Indeed there can be more ships with the same name. That is only normal.

To get him loyal to America might need some tweaking especially in StartStoryline.c .
I've done something similar for Jean Lafitte but he isn't a Corsair and doesn't get a LoM.
See the both_reaction.c file for that one.

Replacing personal flags is tricky because many are already used for one thing or another.
I wouldn't mind if some more flags were added altogether though.
That should be possible, I think, even if it would take a bit of doing.
 
So here is the data for the initModels file (doesn't seem worth posting the whole file).

Code:
    model.description =  "Privateer against the English, Spanish and almost anyone else!";
    model.id       =  "Jose_Almeida";
    model.FaceId    = 39;
    model.nation      =  AMERICA;
    model.assigned    =  true;
    model.name = "Jose";
    model.middlename = "Joaquin";
    model.lastname = "Almeida";
    model.storytitle = "José Joaquín Almeida Rustic Sea Wolf";
    model.storytext = "'I left my Portugese home in the Azores for America in 1796 at the age of 19. I worked as a merchant for a while but now with the outbreak of war I have turned privateer.";
    model.playertype = PLAYER_TYPE_CORSAIR;
    model.ship = "US_Schooner47";
    model.shipname = "Caroline";
    model.Flags.Pirate = 8;
    model.Flags.Personal = 23;
    model.date.month = 6;
    model.date.year = 1812;
    AddCharacterModel(model);

You will see I copied and renamed a sailor model so he has his own ready if a replacement is available sometime but also to try and get the model description text to appear (which didn't work) so his "new" model would be sailor10 renamed to Jose_Almeida in resources/models/characters
 
For the model text to show up, you may have to edit the files in the resource ini folder too.
 
For the model text to show up, you may have to edit the files in the resource ini folder too.
Yes I see - that does it. Easy when you know how!:D I guess you could add that with the above code :cheeky

I'll look at the stuff in StartStoryline.c and both_reaction.c to see if I can work out the way to keep him Portugese but serving America -just a question of getting my head round NATION, PERSONAL_NATION, getServedNnation, iNation etc - I might start to look at the flags stuff too -all totally new territory to me (tga stuff ? me?) but in the meantime he can be another option in the game.
 
Indeed there are a lot of variables at play.

GetServedNation might be the most complex one but it basically is intended at least at the start of the game to indicate the player nationality.
It is set as part of the SetRelationsAsNation function.
PChar.nation is technically the flag you're flying.

If you trace Lafitte through the Free Play code, you might get a reasonable idea of how to add an exception like the one you need.
 
Back
Top