And on the subject of BAD, BAD, BAD bugs, here's yet another one.
Refer to this code from PROGRAM\SEA_AI\AIShip.c:
This is a nice function that should be executed whenever you attack another ship.
I have noticed in the past that the "CompanionEnemyEnable" functionality no longer works.
Turns out it is worse: NOTHING here works at all. None of the traces I put in are being logged into compile.log even if:
- I fire upon and hit an enemy ship
- I manually fire upon and hit a companion ship
- I manually fire upon a companion ship while the "aim" is 'green'
It seems that the last step did eventually trigger *something* in that function, because I finally managed to get these error logs:
But it doesn't get past the line I marked in the code above, which completely skips the functionality.
Some of the things this function is supposed to be responsible for:
- Reputation hit for attacking companions
- Companions that can turn hostile (escort ships/some Standard storyline quest ships) to do so automatically when you fire upon them
- Bad penalty for attacking non-hostile ships at sea.
I need this function to add a penalty for attacking ships while under a friendly flag to them.
When I found some friendly Dutch ships and fired on them, they DID turn hostile, but I STILL didn't get to see the trace lines I added.
So either this function IS working, but it is bypassing my traces (What? How???) or some other functionality is doing what this function should be doing.
This is terrible.
Refer to this code from PROGRAM\SEA_AI\AIShip.c:
Code:
void Ship_FireAction()
{
ref rCharacter = GetEventData(); // we attack this character ---------- ERROR HERE!?!?!? -----------
ref rMainGroupCharacter = GetEventData(); // commander character for rCharacter
int iRelation = GetEventData();
// KK -->
trace("Part 1");
if (!TestRef(rCharacter) || !TestRef(rMainGroupCharacter)) return;
trace("Part 2");
int iCharacterIndex = GetCharacterIndex(rCharacter);
if (iCharacterIndex < 0) return;
trace("Part 3");
int iMainGroupCharacterIndex = GetCharacterIndex(rMainGroupCharacter);
if (iMainGroupCharacterIndex < 0) return;
trace("Part 4");
// <-- KK
ref rMainCharacter = GetMainCharacter();
trace(GetMySimpleName(rMainGroupCharacter) + " attacks " + GetMySimpleName(rCharacter));
// if companion - decrease reputation
if (IsCompanion(rCharacter))
{
ChangeCharacterReputation(rMainCharacter, -15); // NK
if (CheckAttribute(rCharacter, "CompanionEnemyEnable") && sti(rCharacter.CompanionEnemyEnable) == true)
{
SeaAI_SetCompanionEnemy(rCharacter); // disconnect companion from our group and set it enemy to us
}
return;
}
I have noticed in the past that the "CompanionEnemyEnable" functionality no longer works.
Turns out it is worse: NOTHING here works at all. None of the traces I put in are being logged into compile.log even if:
- I fire upon and hit an enemy ship
- I manually fire upon and hit a companion ship
- I manually fire upon a companion ship while the "aim" is 'green'
It seems that the last step did eventually trigger *something* in that function, because I finally managed to get these error logs:
Code:
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
Using reference variable without initializing
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
no DST
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 356
process event stack error
Some of the things this function is supposed to be responsible for:
- Reputation hit for attacking companions
- Companions that can turn hostile (escort ships/some Standard storyline quest ships) to do so automatically when you fire upon them
- Bad penalty for attacking non-hostile ships at sea.
I need this function to add a penalty for attacking ships while under a friendly flag to them.
When I found some friendly Dutch ships and fired on them, they DID turn hostile, but I STILL didn't get to see the trace lines I added.
So either this function IS working, but it is bypassing my traces (What? How???) or some other functionality is doing what this function should be doing.
This is terrible.