AmProsius / gothic-1-community-patch

Gothic 1 Community Patch
Other
48 stars 4 forks source link

Natalia acts as if Y'Berion is alive #360

Open OrcPriestPsychologist opened 1 year ago

OrcPriestPsychologist commented 1 year ago

Describe the bug Natalia acts as if Y'Berion is alive.

natalia

Expected behavior Natalia doesn't act as if Y'Berian is alive when he is dead.

Steps to reproduce the issue

  1. Be in Chapter 3 or further.
  2. Visit the temple of the Swamp Camp
  3. Look at Natalia's behaviour or check her schedule(J key in the test mode)

Additional context The function that should switch her behaviour is B_Story_PrepareRitual()

https://github.com/AmProsius/gothic-1-community-patch/blob/2892a60a3edf33340d7907fe7b3c137d079e8474/scriptbase/_work/Data/Scripts/Content/Story/Chapters/B_Story_PrepareRitual.d#L41-L42

It works for Chani but doesn't work for Natalia.

I guess the reason is a wrong routine's name in GUR_1207_Natalia.d

https://github.com/AmProsius/gothic-1-community-patch/blob/2892a60a3edf33340d7907fe7b3c137d079e8474/scriptbase/_work/Data/Scripts/Content/Story/NPC/GUR_1207_Natalia.d#L62-L66

If I understand correctly how routines work the name should be RTN_dead_1207 because Natalia's id is 1207.

AmProsius commented 7 months ago

It is correct that the routine name does not match the NPC's ID, but that is no error. The routine 1421 is correctly started for NPC Natalia.

Scratch that.

OrcPriestPsychologist commented 7 months ago

The routine 1421 is correctly started for NPC Natalia.

How can I check the running procedure? Because looks like for me she still has the procedure Rtn_start_1421() and not Rtn_dead_1421():

natalia

And Chani has the correct schedule: chani

AmProsius commented 7 months ago

How can I check the running procedure? Because looks like for me she still has the procedure Rtn_start_1421() and not Rtn_dead_1421()

Sorry, there might have been a misunderstanding. Just from the script's point of view, the routine is correctly started with the ID of 1421:

https://github.com/AmProsius/gothic-1-community-patch/blob/2892a60a3edf33340d7907fe7b3c137d079e8474/scriptbase/_work/Data/Scripts/Content/Story/NPC/GUR_1207_Natalia.d#L35

Just to clarify that the routine's ID doesn't necessarily need to match the NPC's ID. But we'll investigate this further.

OrcPriestPsychologist commented 7 months ago

the routine's ID doesn't necessarily need to match the NPC's ID

I think they should match for the case when B_ExchangeRoutine() is called. I assume B_ExchangeRoutine() combines the NPC's ID and a passed string to get the name of a procedure.

https://github.com/AmProsius/gothic-1-community-patch/blob/2892a60a3edf33340d7907fe7b3c137d079e8474/scriptbase/_work/Data/Scripts/Content/Story/Chapters/B_Story_PrepareRitual.d#L41-L42

For Chani it does "1205" + "dead" = "Rtn_dead_1205". Then finds the procedure and assigns it.

For Natalia it does "1207" + "dead" = Rtn_dead_1207". Such procedure doesn't exist. So the schedule switch in ch. 3 doesn't happen.

OrcPriestPsychologist commented 7 months ago

Looks similar to #124

AmProsius commented 7 months ago

You are totally right!

Provided fix:

https://github.com/AmProsius/gothic-1-community-patch/blob/2892a60a3edf33340d7907fe7b3c137d079e8474/scriptbase/_work/Data/Scripts/Content/Story/NPC/GUR_1207_Natalia.d#L10

changed to

    id          =   1421;

I've checked that no other NPC uses the ID 1421.