Skip to content
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

"The Big Thing of the Brotherhood" creates log entries for Old and New Camp #223

Merged
merged 6 commits into from Apr 23, 2021

Conversation

szapp
Copy link
Collaborator

@szapp szapp commented Apr 18, 2021

Describe the bug
During the quest "The Big Thing of the Brotherhood", the player character gets log entries for both Old Camp and New Camp.

Expected behavior
The player character no longer gets log entries for both Old Camp and New Camp during the quest "The Big Thing of the Brotherhood".

Additional context
Bug provided by Blubbler.

The log topics have the same name:

const string CH1_GoToPsi = "The Big Thing of the Brotherhood";
//Aufnahme Neues Lager
const string CH1_JoinNC = "Admission to the New Camp";
const string CH1_CarryWater = "Water Carrier for Lefty";
const string CH1_DamLurker = "Lurker at the Dam";
const string CH1_SpreadJoints = "Canvassing of Customers";
const string CH1_DealerJob = "The Weed Merchant";
const string CH1_ShrikesHut = "Shrike's Hut";
const string CH1_HoratiosTeachings = "Horatio the Peasant";
const string CH1_GotoPsiCamp = "The Big Thing of the Brotherhood";

@AmProsius AmProsius added the validation: required label Apr 2, 2021
@N1kX94
Copy link

@N1kX94 N1kX94 commented Apr 5, 2021

Its dialog

FUNC VOID Info_CorKalom_BringMCQBalls_Success_Info()
{
AI_Output (other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_01"); //I found eggs belonging to a crawler queen
AI_Output (self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_02"); //I knew it. My vision was a sign. The queen's eggs must contain the strong secretion!
AI_Output (self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_03"); //Excellent, with it I can create a potion to contact the Sleeper!
AI_Output (other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_04"); //What about my reward?
AI_Output (self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_05"); //Oh, right... Thank you.
AI_Output (other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_06"); //I mean a TANGIBLE reward.
AI_Output (self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_07"); //Okay, okay. What do you want?
CorKalom_BringMCQBalls = LOG_SUCCESS;
B_GiveInvItems (hero, self, ItAt_Crawlerqueen,3);
Npc_RemoveInvItems(self, ItAt_Crawlerqueen,3);
B_GiveXP (XP_BringMCEggs);
B_LogEntry (CH2_MCEggs,"I've given Cor Kalom three of the minecrawlers' eggs. He was really unfriendly and I had to ask for my meager reward!");
Log_SetTopicStatus (CH2_MCEggs, LOG_SUCCESS);
B_LogEntry (CH1_GotoPsiCamp,"I believe I now know enough about the sect business, so I can report to Mordrag about it.");
B_LogEntry (CH1_GotoPsi,"I believe I now know enough about the sect business. I should tell Raven about it as soon as I'm in the Old Camp.");
Info_ClearChoices (Info_CorKalom_BringMCQBalls_Success);
Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"A rune.",Info_CorKalom_BringMCQBalls_Success_RUNE);
Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"A weapon.",Info_CorKalom_BringMCQBalls_Success_WAFFE);
Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"A healing potion.",Info_CorKalom_BringMCQBalls_Success_HEAL);
Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Ore.",Info_CorKalom_BringMCQBalls_Success_ORE);
Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Mana.",Info_CorKalom_BringMCQBalls_Success_MANA);
};

change to

FUNC VOID Info_CorKalom_BringMCQBalls_Success_Info()
{	
	AI_Output			(other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_01"); //Ich habe Eier einer Crawler-Königin gefunden
	AI_Output			(self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_02"); //Ich wusste es. Meine Vision war ein Zeichen. Die Eier ihrer Königin enthalten also das starke Sekret!
	AI_Output			(self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_03"); //Ausgezeichnet, damit kann ich ein Elixier brauen, das uns den Kontakt zum Schläfer ermöglicht!
	AI_Output			(other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_04"); //Was ist mit der Belohnung?
	AI_Output			(self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_05"); //Ah, ja richtig ... Danke.
	AI_Output			(other, self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_06"); //Ich meine eine HANDFESTE Belohnung.
	AI_Output			(self, other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_07"); //Na gut, na gut. Was willst du?
	CorKalom_BringMCQBalls = LOG_SUCCESS;
	B_GiveInvItems	(hero, self, ItAt_Crawlerqueen,3);
	Npc_RemoveInvItems(self, ItAt_Crawlerqueen,3);
	B_GiveXP			(XP_BringMCEggs);
	B_LogEntry		(CH2_MCEggs,	"Ich habe Cor Kalom 3 der Minecrawler-Eier übergeben. Er war recht unhöflich und ich mußte meine karge Belohnung erst penetrant einfordern!");
	Log_SetTopicStatus	(CH2_MCEggs,	LOG_SUCCESS);
	
	if (Mordrag_GotoKalom == LOG_RUNNING) //start at Mordrag
	&& !Npc_IsDead(Mordrag) //Mordrag don`t died
	{
		B_LogEntry	(CH1_GotoPsiCamp, "Ich glaube, ich weiß jetzt genug über die Sektensache, daß ich Mordrag etwas darüber erzählen kann.");
	}
	else if (Raven_SpySect == LOG_RUNNING) //start at Raven
	{
		B_LogEntry	(CH1_GotoPsi, "Ich glaube, ich weiß jetzt genug über die Sektensache. Ich sollte Raven davon erzählen, sobald ich wieder im alten Lager bin.");
	};

	Info_ClearChoices (Info_CorKalom_BringMCQBalls_Success);
	Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Eine Rune"	,Info_CorKalom_BringMCQBalls_Success_RUNE);
	Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Eine Waffe"	,Info_CorKalom_BringMCQBalls_Success_WAFFE);
	Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Heilmittel"	,Info_CorKalom_BringMCQBalls_Success_HEAL);
	Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Erz"		,Info_CorKalom_BringMCQBalls_Success_ORE);
	Info_Addchoice(Info_CorKalom_BringMCQBalls_Success,"Manatrank"	,Info_CorKalom_BringMCQBalls_Success_MANA);
};

@szapp
Copy link
Collaborator

@szapp szapp commented Apr 5, 2021

Thanks for providing the fixed scripts!

Note for us regarding the implementation: It will be a bit tricky, because we do not want to assume the exact wording due to language independence. Hence we cannot check which entry to add. Instead of intercepting the function call to B_LogEntry by replacing it as we have done on similar occasions, I suggest something slightly different. Replace the function call with a function that omits the first parameter (not supported by our replacement functions, we need to do it manually) to be able to pop it manually from the stack to get its symbol index. This way we have a chance to identify which log topic is meant (either the symbol index of CH1_GotoPsiCamp or CH1_GotoPsi) and introduce the proposed conditions before passing on the arguments to B_LogEntry. I will assign this issue to myself. If I don't get to it, I will provide some more details.

Are there more occasions where these identical log topic names cause problems?

@szapp szapp self-assigned this Apr 5, 2021
@szapp szapp added compatibility: difficult impl: modify/analyze script func type: session fix labels Apr 5, 2021
@N1kX94
Copy link

@N1kX94 N1kX94 commented Apr 5, 2021

For these two tasks, there is no more, only in this place there is a record in two quests (And some quest may not be received)

@szapp szapp added this to Dialog: Info function in Fix templates Apr 5, 2021
@AmProsius
Copy link
Owner Author

@AmProsius AmProsius commented Apr 16, 2021

We can also think about adjusting one of the two log topic names slightly, if that's easier. But I would then mark this fix as opinionated.

The scripts do not parse at time of commit, because they rely on changes
from another branch.

Refs #223
@szapp szapp removed their assignment Apr 18, 2021
@szapp szapp marked this pull request as draft Apr 18, 2021
@szapp
Copy link
Collaborator

@szapp szapp commented Apr 18, 2021

This PR relies on changes from the recent changes in the test suite.

@szapp szapp added this to the v1.2.0 milestone Apr 18, 2021
@szapp szapp added this to In Progress in v1.2.0 via automation Apr 18, 2021
@AmProsius AmProsius removed this from the v1.2.0 milestone Apr 20, 2021
@AmProsius AmProsius added this to the v1.1.0 milestone Apr 20, 2021
@AmProsius AmProsius removed this from In Progress in v1.2.0 Apr 20, 2021
@AmProsius AmProsius added this to In Progress in v1.1.0 via automation Apr 20, 2021
@szapp szapp marked this pull request as ready for review Apr 20, 2021
@szapp szapp marked this pull request as draft Apr 20, 2021
@szapp szapp marked this pull request as ready for review Apr 20, 2021
@szapp szapp requested a review from AmProsius Apr 21, 2021
@AmProsius AmProsius merged commit c210900 into master Apr 23, 2021
v1.1.0 automation moved this from In Progress to Done Apr 23, 2021
@AmProsius AmProsius deleted the bug223 branch Apr 23, 2021
AmProsius added a commit that referenced this issue Apr 25, 2021
@szapp szapp removed the validation: required label May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility: difficult impl: modify/analyze script func type: session fix
Projects
Fix templates
Modify dialog function
v1.1.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants