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

Flags on ships in B14A9.5 Development Resources

In my version of select storyline screen I made option that player can select any flag from personal and pirate files. This means that if we want other personal flag on other ship, we would have to be very careful and always make constructs like:
Code:
if player_personal_flag == some_personal_flag then
ship_flag = some_other_personal_flag;
else
ship_flag = some_personal_flag;
as long as we care to that ship has other flag than player is using. A bit awkward.
You mean to prevent the other ship showing the same flag as the player?
Personally I'd be inclined to ignore the possibility of non-default selections.

At this point in time, it only relates to the EITC flag and the Assassin quest flag.
The EITC one isn't a problem in the first place, since having more than one of those wouldn't be a logical problem.

The Assassin quest example might pose a logic problem, but not worse than now.
Right now, the ship ALWAYS uses the actual player flag.
My suggestion would prevent that at least on default settings and also in most player flag selections,
since it'd be quite a coincidence if the player would choose the exact same flag as the Assassin quest ship uses.
And even if the player does do that, it'd only be in two scenes in a whole quest, so that isn't so bad. :no

Player already uses flags from nations, pirates and personal files anyway. The problem of use a flag from some file for player is nonexistent.
Indeed; the 'issue' comes from wanting OTHER ships fly EITC colours as well.
Since this'd be a rare occurance for certain quest-characters only, I was thinking of just setting those characters
to be part of the personal nation but with a different personal flag. This wouldn't be very noticeable anyway.

It's easy to achieve. Simply add a code where all ship in one squadron are "on the same side" when loging on sea and we could have ships with British flag together with French and quite friendly to each other even if there's a war between England and France. Messy but doable.
In this instance, I was thinking of, say, setting Beckett.Flags.Personal = EITC flag .
Then even if that ship is part of the player squadron, which happens at one point in the quest, she'd show EITC colours.

Anyway, I think all of the above should not be much of a problem.
There is a chance of weird effects, but no actual bugs and only on non-default settings in a select few cases.
I don't think it's worth to code things in a better and more advanced way,
considering the low amounts of times it'll be necessary. :shrug

BTW: While we've got a hold of you, I'm sincerely hoping that at some point we can get the Alpha versions
back up to date with your latest modifications. It'd be great to have the latest features and fixes from you included.
We've got the Different Flags mod seemingly working pretty well now and
I think that was the greatest cause of crashes in the last Development Resources edition.
So it should be quite possible, but it's rather hard to do for someone who doesn't understand all that code so well. :facepalm

Also it'd be nice if some of the half-finished features could be finished at some point.
I know people would really want that Customize Character interface back, for example.
 
BTW: While we've got a hold of you, I'm sincerely hoping that at some point we can get the Alpha versions
back up to date with your latest modifications. It'd be great to have the latest features and fixes from you included.
We've got the Different Flags mod seemingly working pretty well now and
I think that was the greatest cause of crashes in the last Development Resources edition.
So it should be quite possible, but it's rather hard to do for someone who doesn't understand all that code so well.
Considering that I made something that didn't work but caused crashes and you with Screwface and the rest managed to fix what I broke, I'm sure you'd be able to make a better merge than me. Remember what happened when I was trying to merge my silly work with Maximus' improvements? Since then Build is full of bugs.

pirate_kk
 
I know that it is possible to have a companion ship NOT change flag as Danielle in the standard storyline flys an English flag while you are sailing from Barbados to Bonaire (I think)

As for the pirate flags I agree have it random which flag is flying but have Jack Rackham's Jolly Roger the most likely to show up and then have the others less likely to show (dont want work going to waste)

In my storyline I have Gentleman Jocard part of my fleet and it would be nice if his flag if you select personal would be his Jolly Roger ;) (and at one point I set it so it IS his Jolly Roger)

I know of 4 ships that will be using the EITC flag before they come to the Caribbean and take over command of English colonies. These are:
- Becketts
- Liutenant Bligh
- EITC ships hasling opium ship 1 & 2 :cheeky
 
Considering that I made something that didn't work but caused crashes and you with Screwface and the rest managed to fix what I broke, I'm sure you'd be able to make a better merge than me. Remember what happened when I was trying to merge my silly work with Maximus' improvements? Since then Build is full of bugs.
It isn't quite as bad as you make it out to be here. You did a GREAT job on the Different Flags mod.
You didn't BREAK it; you made it work! You didn't make it fully stable, which is what Screwface has now done for you.
But without you, it wouldn't exist at all, which would've been a huge shame. It's something I've wanted for YEARS!

And as far as your Maximus-merge is concerned, all recent Alpha's are based on that merge and things do seem pretty stable.
There might be some mistakes and bugs caused at that time, but certainly less than if, say, I would've attempted to do it.
If it weren't for your work at that time, we'd still be messing around with a Maximus and Pirate_KK game version. :facepalm

The current Alpha is based solely on your original merge, along with additional content and further fixes.
Any differences you would observe between Alpha 9.5 Patch 3 and your own game version would be either your own work,
or something you would agree is an improvement. I could try to make the merge myself, but last times I attempted that,
I ended up quite confused on your code. It's just too advanced for a simple person like me to fully understand. :wacko:

I know that it is possible to have a companion ship NOT change flag as Danielle in the standard storyline flys an English flag while you are sailing from Barbados to Bonaire (I think)
How's that handled then? And shouldn't Danielle, of all people, NOT be flying British colours? :shock

As for the pirate flags I agree have it random which flag is flying but have Jack Rackham's Jolly Roger the most likely to show up and then have the others less likely to show (dont want work going to waste)
At the moment, each flag has an equal chance of occuring and I'd like to keep it tha way.
Reason being, tthe code is nicely simple now and should work. ;)

In my storyline I have Gentleman Jocard part of my fleet and it would be nice if his flag if you select personal would be his Jolly Roger ;) (and at one point I set it so it IS his Jolly Roger)
A pirate flag as personal flag sounds a bit troublesome.
What if Jack Sparrow would fly his own pirate flag at that time and Gentleman Jocard HIS own? I think we can get that to work. :yes
We'd just need to allow a character-specific pirate flag, just like I was planning for personal flags.
Then if the character doesn't have a flag attribute, he'll show the flag of the commander.
If he does have the attribute, he'll show his own.

I know of 4 ships that will be using the EITC flag before they come to the Caribbean and take over command of English colonies. These are:
- Becketts
- Liutenant Bligh
- EITC ships hasling opium ship 1 & 2 :cheeky
And those last two are supposedly in China anyway, aren't they?
 
So here's my latest code suggestion for the Different Flags mod; replaces the functions in BATTLE_INTERFACE\Flags.c:
Code:
int GetPirateFlag(ref chr)
{
if (CheckAttribute(chr, "Flags.Pirate")) return sti(chr.Flags.Pirate);
ref cmdr = Group_GetGroupCommander(GetGroupIDFromCharacter(chr));
if (!CheckAttribute(cmdr, "Flags.Pirate")) cmdr.Flags.Pirate = rand(4);
return sti(cmdr.Flags.Pirate);
}

int GetPersonalFlag(ref chr)
{
if (CheckAttribute(chr, "Flags.Personal")) return sti(chr.Flags.Personal);
ref cmdr = Group_GetGroupCommander(GetGroupIDFromCharacter(chr));
if (!CheckAttribute(cmdr, "Flags.Personal"))
{
ref mchr = GetMainCharacter();
if (!CheckAttribute(mchr, "Flags.Personal")) return 0;
return sti(mchr.Flags.Personal);
}
return sti(cmdr.Flags.Personal);
}
If a character has his own pirate/personal flag, that'll be used. This can be applied to the EITC ships, for example.
That way, Beckett will show his personal flag (EITC) when you show your own personal flag.
Of course if you choose to fly, say, British colours or an other nation's, Beckett's ship would probably do the same.

If a character doesn't have the attribute, the group commander is checked.
If the group commander doesn't have it either, he gets a random pirat flag / the main character's personal flag.

So by default, all pirates get a random pirate flag from the first five in the file.
The other two (#6 and #7) can be used for player/quest ships.
To set/change a pirate flag, add a chr.Flags.Pirate = #; line in the character init entry or through a quest case.
I'm thinking we could use this to make the Mefisto/Crimson Blood and other similar ships to use a red pirate flag by default.

For the personal flag, you need to set chr.nation = PERSONAL_NATION as well as chr.Flags.PERSONAL = #; .
That way you can make characters use non-default flags, for example EITC or a custom flag for the Assassin quest ship.
 
I also note this function:
Code:
bool IsShipMerchant(ref chr)
{
ref rShip = GetShipByType(GetCharacterShipType(chr));
aref arShip; makearef(arShip, chr.Ship);
if (CheckShipAttribute(arShip, rShip, "Flags.UseMerchantFlag") == true && sti(GetLocalShipAttrib(arShip, rShip, "Flags.UseMerchantFlag")) == true) return true;
if (CheckShipAttribute(arShip, rShip, "Flags.UseNavalFlag") == true && sti(GetLocalShipAttrib(arShip, rShip, "Flags.UseNavalFlag")) == true) return false;
return sti(GetLocalShipAttrib(arShip, rShip, "Type.Trade")) == true && sti(GetLocalShipAttrib(arShip, rShip, "Type.War")) == false;
}
By the looks of it, a ship will show merchant colours if it is not assigned to war, but is assigned to trade.
However, there could be ships that are assigned to both, that should still show merchant colours.
In that case, a refShip.Flags.UseMerchantFlag = true; line can be added in ships_init.c .
Please report if anyone encounters a ship type that uses war/merchant flags but would look better with the other type. :doff
 
So has anybody toyed aroung with this yet? Tried to make use of it in a quest somewhere maybe...? :rolleyes:
 
Thomas the Terror is done with the personal and pirate flags,
so that pretty much concludes the work on the Different Flags mod!
I have now made some slight quest modifications to make full use of this:

- In the Assassin main quest, the ship that is set to PERSONAL_NATION will now fly a DIFFERENT flag from the default player one
Your personal flag will change from the Amsterdam one to the Bones Amsterdam after "The Apprenticeship"

- In Jack Sparrow, you start out with a British flag
When you get to escort Beckett, you hoist your own flag (British with Sparrow) while Beckett flies the EITC colours
Your personal flag changes to EITC when you get promoted to EITC lieutenant
After meeting Tia Dalma, your personal flag changes to the non-British-Sparrow personal flag

For the Hornblower quest, there's a Blue and Red Ensign available as personal flags;
maybe these could be used at some point for different admirals' squadrons.
 
Here's an example of the Beckett escort:
escorting_beckett.jpg
 
And the Assassin one too:
assassin_flag.jpg

Not sure if maybe a different flag should be chosen. :facepalm
 
Great idea :will and a pirate flag for Bartolomeu too :woot
What exactly did you have in mind?
For now I used the red skull-and-crossbones with an hourglass below as pirate flag for Bartolomeu.

Btw : in the screenshot, it seems you chose the Portuguese flag for Elting.. Did you make a mistake ? :shrug
I was just flying false colours. I had to, because Portugal is at war with Holland in the Spanish Main period now.
By default, Elting flies Dutch colours and his personal flag is the flag of Amsterdam first
and a modified version with crossbones later. So it should be good. :cheeky

Of course all nation relations and town nationality changes with the Period mod will need to be looked into.
I tried to do things in such a way that they won't interfere much with all existing quests.

Anyway, once the next Patch is released, you'll be able to have a look at all the
relations/town nationalities/flag assignments and see how you like them. Adjusting will be easy in case you don't. :cheeky
 
What exactly did you have in mind?
For now I used the red skull-and-crossbones with an hourglass below as pirate flag for Bartolomeu.
Have you got a screenshot of this flag ? :?
By default, Elting flies Dutch colours and his personal flag is the flag of Amsterdam first
and a modified version with crossbones later. So it should be good. :cheeky
Could you also post a screenshot for these flags ?
Of course all nation relations and town nationality changes with the Period mod will need to be looked into.
I tried to do things in such a way that they won't interfere much with all existing quests.

Anyway, once the next Patch is released, you'll be able to have a look at all the
relations/town nationalities/flag assignments and see how you like them. Adjusting will be easy in case you don't. :cheeky
Alright, I'll check that when released.. :)
 
Bartolomeu personal and pirate flag:
bart_pers.jpg
bart_pirate.jpg


Johan Elting personal flag 1 (used at the beginning) and 2 (used after completion of "The Apprenticeship") and pirate flag:
elt_pers1.jpg
elt_pers2.jpg
elt_pirate.jpg


Aurelien Bergerat fake flag (flag of Malta):
malta.jpg

The flag shown on above screenshot for Aurelien is actually intended for the main character of Thomas' new main quest,
so he suggested we use this one instead.
 
Alright for all the flags :onya

The Bartolomeu personal flag is really good. It looks like the flag used by the town where I live (Viana do Castelo is its name) :dance
 
Back
Top