What are you doing with your flags? I changed that code a bit:
Code:
. Flag Hoisting Code rewritten and simplified by Pieter Boelen
> If you use the Quick-Command Menu, you will hoist your original flag again later on
> You are no longer marked as a traitor whenever you hoist a pirate flag, but if you hoist ANY hostile flag IN SIGHT OF other ships
That range can be pretty far though, especially when it is clear during daytime. See this this code from BattleInterface.c:
Code:
visibility_range = GetVisibilityRange(0) + makefloat(GetSummonSkillFromName(chr, SKILL_LEADERSHIP) * GetSummonSkillFromName(chr, SKILL_SAILING) * 5); // KK
if (SeaAI_GetRelation(Ships[i], sti(PChar.index)) != RELATION_ENEMY || Ship_GetDistance2D(pchar, chr) > visibility_range)
{
SetCharacterRelationBoth(sti(PChar.index), Ships[i], GetNationRelation(sti(PChar.nation), sti(chr.nation)));
}
if(Ship_GetDistance2D(pchar, chr) <= visibility_range)
{
//If you hoist an enemy flag close to other ships, they will remenber you and recognise you next time
if(CheckAttribute(Pchar,"flagchanged") && GetNationRelation(sti(pchar.nation), sti(chr.nation)) == RELATION_ENEMY)
{
chr.recognized = 1;
chr.EnemyShipName = Pchar.Ship.Name;
chr.EnemyShipType = Pchar.Ship.Type;
// PB: Only do this close to enemy ships
PChar.traitor = true; // marker for recognizing feature
}
}
Couple of things we could change:
- Add a random factor in this, so that you won't always be marked as traitor
- Reduce the range at which all the above recognizing happens. At the moment this is 3000 "units" minus fog density and reduced by another 50% if at night
For this second one, just change
GetVisibilityRange(0) to
GetVisibilityRange(1) in the above example. That'll change the distance to 1000 units instead of 3000.
I'll still be interested to know what you were doing before you got recognized.
Edit: These ranges are used also for the availability of the ship type and nation information in the Sail-To menu.
Looks like ship type can be seen closer than range "1" and for nation to be known, you have to be closer than range "2".
Based on that, I'd suggest changing the above to
GetVisibilityRange(2) .
If you can't see THEIR flag according the interface, it stands to reason that they can't see YOURS either.
That should definitely reduce the amount of times you'll get the "traitor" thing.
If it is still not OK, let me know and we can add that randomizer.