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

Gor Na Ran attacks the player character in chapter 6 #220

Merged
merged 1 commit into from May 9, 2021
Merged

Conversation

AmProsius
Copy link
Owner

@AmProsius AmProsius commented May 9, 2021

Describe the bug
Gor Na Ran attacks the player character in chapter 6. Considering the corresponding dialog, it seems that he is supposed to be in the Sleeper's temple.

Expected behavior
Gor Na Ran no longer attacks the player character in chapter 6.

Additional context
Bug provided by Blubbler.

instance Info_TPL_1405_GorNaRan (C_INFO)
{
npc = TPL_1405_GorNaRan;
condition = Info_TPL_1405_GorNaRan_Condition;
information = Info_TPL_1405_GorNaRan_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_TPL_1405_GorNaRan_Condition()
{
if (Kapitel == 6)
{
return TRUE;
};
};
FUNC VOID Info_TPL_1405_GorNaRan_Info()
{
AI_Output (self, other,"Info_TPL_1405_GorNaRan_Info_13_01"); //Where do you think you are going? Nobody's allowed to pass here!
};
// ****************** ANGRIFF *********************
INSTANCE Info_TPL_1405_GorNaRan2 (C_INFO)
{
npc = TPL_1405_GorNaRan;
nr = 1;
condition = Info_TPL_1405_GorNaRan2_Condition;
information = Info_TPL_1405_GorNaRan2_Info;
permanent = 1;
description = "What's going on here anyway?";
};
FUNC INT Info_TPL_1405_GorNaRan2_Condition()
{
if ( Npc_KnowsInfo ( hero, Info_TPL_1405_GorNaRan )) {
return 1;
};
};
FUNC VOID Info_TPL_1405_GorNaRan2_Info()
{
AI_Output (other, self,"Info_TPL_1405_GorNaRan_Info_15_02"); //What's going on here anyway?
AI_Output (self, other,"Info_TPL_1405_GorNaRan_Info_13_03"); //You're asking me what's going on? Throw yourself into the dust and pay tribute to the Sleeper, because at this very moment he awakens to banish all infidels from this world.
};
// ****************** ANGRIFF *********************
INSTANCE Info_TPL_1405_GorNaRan3 (C_INFO)
{
npc = TPL_1405_GorNaRan;
nr = 1;
condition = Info_TPL_1405_GorNaRan3_Condition;
information = Info_TPL_1405_GorNaRan3_Info;
permanent = 1;
description = "Just wanted to have a look around.";
};
FUNC INT Info_TPL_1405_GorNaRan3_Condition()
{
if ( Npc_KnowsInfo ( hero, Info_TPL_1405_GorNaRan )) {
return 1;
};
};
FUNC VOID Info_TPL_1405_GorNaRan3_Info()
{
AI_Output (other, self,"Info_TPL_1405_GorNaRan_Info_15_04"); //Just wanted to have a look around.
AI_Output (self, other,"Info_TPL_1405_GorNaRan_Info_13_05"); //You worm, you and your kind have no business here when the Sleeper awakes! I'll have to clear you out of the way.
AI_StopProcessInfos ( self );
Npc_SetTarget ( self, hero );
AI_StartState ( self, ZS_Attack, 1 ,"" );
};
INSTANCE Info_TPL_1405_GorNaRan4 (C_INFO)
{
npc = TPL_1405_GorNaRan;
nr = 1;
condition = Info_TPL_1405_GorNaRan4_Condition;
information = Info_TPL_1405_GorNaRan4_Info;
permanent = 0;
description = "You can't stop me!";
};
FUNC INT Info_TPL_1405_GorNaRan4_Condition()
{
if ( Npc_KnowsInfo ( hero, Info_TPL_1405_GorNaRan )) {
return 1;
};
};
FUNC VOID Info_TPL_1405_GorNaRan4_Info()
{
AI_Output (other, self,"Info_TPL_1405_GorNaRan_Info_15_06"); //You can't stop me!
AI_Output (self, other,"Info_TPL_1405_GorNaRan_Info_13_07"); //Whatever you say, boy, for the Sleeper!
AI_StopProcessInfos ( self );
Npc_SetTarget ( self, hero );
AI_StartState ( self, ZS_Attack, 1 ,"" );
};

@AmProsius AmProsius added the validation: required label Mar 31, 2021
@AmProsius
Copy link
Owner Author

@AmProsius AmProsius commented Mar 31, 2021

I see two possible fixes:

  1. Insert Gor Na Ran into the Sleeper Temple and remove him from the Swamp Camp1.
  2. Remove the dialog from Gor Na Ran.

Any thoughts on this @szapp?

1 There's no routine that supports this behavior yet.

@szapp
Copy link
Collaborator

@szapp szapp commented Mar 31, 2021

To be honest, I don't find the argument compelling that he is supposed to be in the sleeper temple. Fair enough, the dialog doesn't make much sense given he is still in the swamp camp. But there is no indication what the "where" is, that he is referring to. Either of the two options proposed here seem as arbitrary as the dialog itself. For the time being, I would leave it as it is. But we can discuss some more.

@AmProsius
Copy link
Owner Author

@AmProsius AmProsius commented Apr 1, 2021

In my opinion the Sleeper's temple is the only logical explanation, because it's the only place in the game where the mad templars are. I suppose he should have been placed at some gateway, given this dialog:

FUNC VOID Info_TPL_1405_GorNaRan_Info()
{
	AI_Output (self, other,"Info_TPL_1405_GorNaRan_Info_13_01"); //Wo willst DU hin, hier darf niemand durch!
};

As the option to place him in the temple might be too opinionated, I'd like to disable the dialog, because it surely isn't supposed to happen the way it is now.

@szapp
Copy link
Collaborator

@szapp szapp commented Apr 12, 2021

UPDATE The suggested implementation will not work as it only sets the first dialog to told but not the remaining ones. It is also a bit more complicated than need be:
It might actually be easier to create session fix in which the dialog condition function Info_TPL_1405_GorNaRan_Condition is hooked (like e.g. in #17) to always return false.

/*
 * #220 Gor Na Ran attacks the player character in chapter 6
 */
func int G1CP_220_GorNaRanDialogMad() {
    if (G1CP_IsFunc("Info_TPL_1405_GorNaRan_Condition", "int|none")) {
        HookDaedalusFuncS("Info_TPL_1405_GorNaRan_Condition", "G1CP_220_GorNaRanDialogMad_Hook");
        return TRUE;
    } else {
        return FALSE;
    };
};

/*
 * Hook the dialog condition function to disable it
 */
func int G1CP_220_GorNaRanDialogMad_Hook() {
    G1CP_ReportFuncToSpy();

    // Always return false: The dialog is inaccessible
    return FALSE;
};

Something like this should suffice to disable the dialog during the game and re-enable it when saving (to make it available again when removing the patch):

Bad suggestion - Only kept for completeness

/*
 * #220 Gor Na Ran attacks the player character in chapter 6
 */
func int G1CP_220_GorNaRanDialogMad() {
    if (!Npc_KnowsInfo(hero, "Info_TPL_1405_GorNaRan")) {
        G1CP_SetInfoTold("Info_TPL_1405_GorNaRan", TRUE);
        return TRUE;
    } else {
        return FALSE;
    };
};

/*
 * This function reverts the changes
 */
func int G1CP_220_GorNaRanDialogMadRevert() {
    // Only revert if it was applied by the G1CP
    if (!G1CP_IsFixApplied(220)) {
        return FALSE;
    };

    // Re-enable the info
    G1CP_SetInfoTold("Info_TPL_1405_GorNaRan", FALSE);
    return TRUE;
};

The test will have to be just manual: Set the variable Kapitel to 6 and teleport the PC to the NPC. Also check if the dialog correctly reappears when unloading the patch afterwards with the same savegame.

@szapp szapp added compatibility: easy provided fix impl: change obj var opinionated type: revert on save labels Apr 12, 2021
@szapp szapp added this to Other in Fix templates Apr 12, 2021
@szapp szapp added provided implementation and removed provided fix labels Apr 12, 2021
@AmProsius AmProsius self-assigned this Apr 17, 2021
@AmProsius AmProsius added this to To Do in v1.2.0 Apr 17, 2021
@AmProsius AmProsius added this to the v1.2.0 milestone Apr 18, 2021
@szapp szapp added impl: hook script func type: session fix and removed impl: change obj var type: revert on save labels Apr 21, 2021
@szapp szapp moved this from Other to Dialog: Info condition in Fix templates Apr 22, 2021
@AmProsius AmProsius merged commit 0dbbee4 into master May 9, 2021
v1.2.0 automation moved this from To Do to Done May 9, 2021
@AmProsius AmProsius deleted the bug220 branch May 9, 2021
@AmProsius AmProsius removed their assignment May 12, 2021
@szapp szapp removed the validation: required label May 14, 2021
AmProsius added a commit that referenced this issue May 14, 2021
@szapp szapp moved this from Modify dialog conditions to Add dialog conditions in Fix templates Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility: easy impl: hook script func opinionated provided implementation type: session fix
Projects
Fix templates
Add dialog conditions
v1.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants