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
Swiney gives his own pants to the player #181
Conversation
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_SFB_1037_Swiney.d Lines 87 to 95 in 5533641
changed to func void Info_Swiney_Schuerfer_Ja()
{
AI_Output (other, self,"Info_Swiney_Schuerfer_Ja_15_00"); //Yes.
AI_Output (self, other,"Info_Swiney_Schuerfer_Ja_09_01"); //Good! Then you know what to watch out for. Here's your protective clothin'. You'll have to find your own pickaxe. Enjoy yourself.
CreateInvItem(other, SFB_ARMOR_L);
CreateInvItem(self, ItAmArrow);
B_GiveInvItems(self, hero, ItAmArrow, 1);
Npc_RemoveInvItem(hero, ItAmArrow);
Info_ClearChoices(Info_Swiney_Schuerfer);
}; gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_SFB_1037_Swiney.d Lines 97 to 109 in 5533641
changed to func void Info_Swiney_Schuerfer_Nein()
{
AI_Output (other, self,"Info_Swiney_Schuerfer_Nein_15_00"); //No.
AI_Output (self, other,"Info_Swiney_Schuerfer_Nein_09_01"); //Of course you don't! Why's it always me? Okay. Listen carefully. You take this stuff and put it on - here.
AI_Output (self, other,"Info_Swiney_Schuerfer_Nein_09_02"); //If an ore nugget falls on your foot while you're not wearing your protective clothing, you'll be crippled for life and only worth half of what you were before to us.
AI_Output (self, other,"Info_Swiney_Schuerfer_Nein_09_03"); //There'll be a pickaxe lying somewhere around here.
AI_Output (self, other,"Info_Swiney_Schuerfer_Nein_09_04"); //But you won't be able to do much with it - well - so what...
CreateInvItem(other, SFB_ARMOR_L);
CreateInvItem(self, ItAmArrow);
B_GiveInvItems(self, hero, ItAmArrow, 1);
Npc_RemoveInvItem(hero, ItAmArrow);
Info_ClearChoices(Info_Swiney_Schuerfer);
}; |
An alternative approach would be that |
Typically, whenever an NPC gives the PC an armor they are wearing themselves, it is done the following way (there are multiple times that exact thing is done in the scripts). A surrogate item is created, transferred, and then removed for display of the desired text, while the armor itself is created in the inventory of the PC. Optionally, the best armor is equipped subsequently. gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_KDW_600_Saturas.d Lines 1127 to 1131 in 5533641
I doubt this will be the best approach here, because a mod might have specifically changed the screen print in Another way would be to place the armor into the inventory of the PC and supply the screen print manually. However, that is dangerous, because a mod might have changed the way the display works (positioning, font, font size, exact wording, ...). Best would be to fix the external engine function I think the easiest fix might be to use a surrogate NPC to transfer the armor from. This could look like this: GetItemHelper();
CreateInvItem(Item_Helper, SFB_ARMOR_L);
B_GiveInvItems(Item_Helper, hero, SFB_ARMOR_L, 1);
|
I agree. I will update the issue accordingly. |
I updated my comment above. The fix might be very easy. |
If we used the |
But are there any other instances of that issue? The only time transferring an item is a problem is when an item is to be transferred that the NPC has equipped themselves, usually armor, and there seem to only be a few instances where that is relevant - most of them already fixed. Or am I wrong? |
I'll have to check that. Let me make a list of armor dealers/givers and see if the issue is present somewhere else. If not, we can gladly use the |
I didn't find any other occasion. In fact, I found comments why PB used the arrow workaround: gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Missions/DIA_SLD_700_Lee.d Lines 468 to 473 in 5533641
So it looks like they forgot to do this with Swiney and I agree on your proposed solution. If it doesn't work, we can still create the arrow workaround. |
I fixed the issue differently from discussed here: Instead of changing his "giving behavior", he merely re-equips his best armor right after the execution of the dialog. This should be instant and not visible. I could not see him take off his armor. @AmProsius, could you test if you spot him taking it off and putting it on? The test is manual (but the dialog will be immediately available). Update: I accidentally fixed this bug, although it was not part of v1.1.0. I added it there such that we don't forget about it later. |
Describe the bug
When Swiney gives a Digger's Dress to the player, he gives him his own equipped Digger's Dress.
Expected behavior
Swiney no longer loses his own Digger's Dress when he gives one to the player.