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
Ambient dialogs of rogue not available #166
Conversation
Lines 78 to 90 in 0623f55
changed to if ( (Npc_HasItems(other,ItMiJoint_1)>0) || (Npc_HasItems(other,ItMiJoint_2)>0) || (Npc_HasItems(other,ItMiJoint_3)>0) )
{
if (Npc_HasItems(other,ItMiJoint_1))
{ B_GiveInvItems (other,self,ItMiJoint_1,1); }
else if (Npc_HasItems(other,ItMiJoint_2))
{ B_GiveInvItems (other,self,ItMiJoint_2,1); }
else if (Npc_HasItems(other,ItMiJoint_3))
{ B_GiveInvItems (other,self,ItMiJoint_3,1); };
AI_Output (self, other,"Info_ORG_829_OfferJoint_06_01"); //Sure! Are you one of the dealers from the Sect Camp or what?
NC_Joints_verteilt = NC_Joints_verteilt + 1;
Org_829_GotJoint = TRUE;
} |
A downside of the suggested fix is, that it will not take effect on savegames where the dialog had already been spoken. I think that is a problem, because we could no longer claim that the fixes are applied irrespective of the savegame/story progression. |
Can't we check if |
UPDATE I might have misread your suggestion. You are proposing to not check if the dialog has been told but if the specific output unit I think that would be equivalent to replacing the condition At the moment I don't see a way of enabling these two unavailable dialogs without introducing other inconsistencies or while keeping the patch savegame-independent. Since the NPC does not immediately use the joint I thought we could check if the info was told and the NPC has a joint in their inventory. Unfortunately, he may smoke it during his daily routine (see below). gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/ZS/B_ZS.d Lines 386 to 399 in 0623f55
|
If I am not mistaken, Gothic may actually save how often an output unit was played. I'm really not sure yet, but that would solve so many problems (e.g. all the dialogs where Update: This information is not persistent. There is no way to reliably check whether an individual output unit was spoken. |
Going back to this issue, I think we will need to compromise. In the original game the NPC Although not an ideal solution, it is a robust one as far as the original scripts are concerned. So I suggest to change the dialog conditions: Lines 111 to 117 in 0623f55
changed to FUNC INT Info_ORG_829_SpecialInfo_Condition()
{
if (Org_829_GotJoint == TRUE)
|| ((Npc_KnowsInfo(hero, Info_ORG_829_OfferJoint)) && ((Npc_HasItems(self, ItMiJoint_1))
|| (Npc_HasItems(self, ItMiJoint_2))
|| (Npc_HasItems(self, ItMiJoint_3))))
{
return 1;
};
}; and Lines 141 to 147 in 0623f55
changed to FUNC INT Info_ORG_829_PERM_Condition()
{
if (Org_829_GotJoint == TRUE)
|| ((Npc_KnowsInfo(hero, Info_ORG_829_OfferJoint)) && ((Npc_HasItems(self, ItMiJoint_1))
|| (Npc_HasItems(self, ItMiJoint_2))
|| (Npc_HasItems(self, ItMiJoint_3))))
{
return 1;
};
}; This, of course, entails to check if these items exist. In a script hook of these dialog conditions, return false when the inverse of the added condition is true (as we usually do in these info condition script hooks). |
It's a cool feeling to finally hear dialogs I've never heard before! |
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.
I know this fix already found its way into the release, but we should revise it. I didn't have the time to review it until now. We can discuss how to improve it here.
cond4 = !Npc_HasItems(self, joint3Id); | ||
|
||
// Return false if either of the conditions is true | ||
if (cond1) || (cond2 && cond3 && cond4) { |
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.
This if-condition might cause issues. It will prevent the dialog from appearing if the variable is Org_829_GotJoint
is true but the NPC no longer has the items. We will have to revise this if-condition. We can brain storm some ideas here.
Since we are adding an or-condition, it is dangerous to prematurely return false. Likewise, it is dangerous to return true, because a mod could have added new conditions in the dialog condition function.
I wonder if it will be enough to just change the order: Run the original function first (use ContinueCall()
in the beginning and collect its return value). If the return value is true, return true, if it is false, add our new conditions and return true/false. If I am not mistaken we might have done this in a few fixes. Maybe we can find those dialog fixes.
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.
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.
I agree with the comment about #66. That may be worth worrying about, if the dialog was an important one and is likely to be changed in a mod. Here - you are right - there is no need to overthink it.
Nevertheless, the issue I mentioned in the first paragraph in the comment above should be addressed. And I think your suggestion with #96 sounds great.
What we should do is check if the variable that is used to check whether the joint has been given is false. If so, check if the dialog was told and the NPC has either of the items and then set the variable to true. After that (irrespective of the check of the variable) the original function should be triggered.
/* | ||
* #166 Ambient dialogs of rogue not available | ||
* | ||
* There does not seem an easy way to test this fix programmatically, so this test relies on manual confirmation. |
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.
There should actually be a way to check this with an automatic test. As found in similar tests, set the dialog Info_ORG_829_OfferJoint
to told, trigger the condition function, and check its return value.
Why? Maybe it's a feature by devs. Guards take a joint and |
It is, of course, always a possibility that the developers intended a certain circumstance. Thank you for voicing this concern. However, it is rather unlikely here, because the existence of the dialogs and conditions and variables strongly suggest an oversight. If it were intentional or a last-minute change, this circumstance would have most likely been implemented differently. This hunch based on other examples of last-minute changes and intended omissions we found in the scripts. |
Describe the bug
Two ambient dialogs of a rogue in the New Camp are not available due to a missing variable set.
Expected behavior
Ambient dialogs of a rogue in the New Camp are now available.
Additional context
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_ORG_829_Organisator.d
Lines 111 to 117 in 0623f55
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_ORG_829_Organisator.d
Lines 141 to 147 in 0623f55