New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gorn can't be asked about after talking to Lares #228
Conversation
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_ORG_801_Lares.d Lines 207 to 221 in e66b303
changed to FUNC VOID ORG_801_Lares_BringListAnteil_Info()
{
AI_Output (other, self,"ORG_801_Lares_BringListAnteil_15_00"); //They've already mugged the convoy? Where's my share?
AI_Output (self, other,"ORG_801_Lares_BringListAnteil_11_01"); //Go to see Gorn. He'll give you something.
var C_NPC gorn; gorn = Hlp_GetNpc(PC_Fighter);
if (gorn.aivar[AIV_FINDABLE]==TRUE)
{
AI_Output (other, self,"ORG_801_Lares_BringListAnteil_15_02"); //I know Gorn. He's no member of the gang. He's a mercenary who works for the mages.
AI_Output (self, other,"ORG_801_Lares_BringListAnteil_11_03"); //Yeah, that's right.
AI_Output (other, self,"ORG_801_Lares_BringListAnteil_15_04"); //Was he involved in this business?
AI_Output (self, other,"ORG_801_Lares_BringListAnteil_11_05"); //Knowing too much isn't good for you. Just go to see him and collect your share.
};
B_LogEntry(CH1_JoinNC,"Gorn, the mercenary, participated in the raid on the convoy in a mysterious way. I'll get my share from him.");
gorn.aivar[AIV_FINDABLE] = TRUE;
}; |
We might have to adjust the wording in the changelog. The player can "find" Gorn regardless. This AI variable records whether the player has heard of Gorn and can be asked for in the "Where can I find ..." ambient dialogs. gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/B/B_AssignFindNPC_NC.d Lines 30 to 34 in 9a6227f
The simplest way to fix this issue is by hooking the function and setting the AI variable afterwards. Alternatively, the comparison (==) can be exchanged for an assignment (=) in the byte code of the function. This would be more elegant and would correct the data stack (the comparison leaves the resulting truth value on the stack). If I get to it, I will do that. If not, the hook-approach should suffice, too. |
I think, the easy route may suffice:
/*
* #228 Gorn can't be asked about after talking to Lares
*/
func int G1CP_228_LaresDialogFindGorn() {
if (G1CP_IsFunc("ORG_801_Lares_BringListAnteil_Info", "void|none"))
&& (G1CP_IsIntConst("AIV_FINDABLE", 0))
&& (G1CP_IsNpcInst("PC_Fighter")) {
HookDaedalusFuncS("ORG_801_Lares_BringListAnteil_Info", "G1CP_228_LaresDialogFindGorn_Hook");
return TRUE;
} else {
return FALSE;
};
};
/*
* This function intercepts the dialog to add actions afterwards
*/
func void G1CP_228_LaresDialogFindGorn_Hook() {
G1CP_ReportFuncToSpy();
// Call the original function first
ContinueCall();
// Set Gorn to be "findable"
G1CP_NpcIDSetAIVar(MEM_GetSymbolIndex("PC_Fighter"), "AIV_FINDABLE", TRUE);
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better late than never ;) Some minor fixes and suggestions.
Describe the bug
Because of an incorrect assignment, Gorn can't be asked about in ambient dialogs after Lares talks of his existence.
Expected behavior
Gorn can now correctly be asked about in ambient dialogs after the player talked to Lares.
Additional context
Bug and fix provided by N1kX94.