DogmaMods / thief

0 stars 0 forks source link

Scene hp_hs_sleep__BSE_Torgnir_Debt01 loops forever #44

Open brewmasterhal opened 10 months ago

brewmasterhal commented 10 months ago

Type: Infinite Loop

Description: When going to sleep in the assigned bed in the crypt in Silentwood, if the player has signed the agreement with Torgnir and no other scenes are scheduled to interrupt during the night, the brief scene hp_hs_sleep__BSE_Torgnir_Debt01 plays over and over.

Version: v1.6.0.3 SE

Steps to repro:

  1. During the 'trial' day, sign the agreement to work as a whore for Torgnir for a day
  2. Do not engage in any other quest path which would trigger other interruptions of the sleeping scene (not sure if this is necessary - needs further testing)
  3. Continue to play until the first night and go to sleep in the crypt
  4. The noted scene plays, then plays again, etc.

Cause: The scene hp_hs_sleep__eventscheck is started as part of the sleeping scene. With the conditions that bd_sq_hs.NoiseRoom_QS == 10 and hp_hs_sys.DayNum == 0, the scene enters Phase 5 and executes Fragment_5() in the associated script. That function sets hp_hs_sleep.EventType equal to 4, then starts the scene hp_hs_sleep_eventscheck_prepareforeventandrun. Once that scene reaches Phase 4, it executes Fragment_1() in its associated script, which actually starts the BSE_Torgnir_Debt01 scene. The trouble comes when that scene ends, as its last line of code before the scene is stopped starts the hp_hs_sleep__eventscheck_prepareforcheckevent scene, which in turn re-starts hp_hs_sleep__eventscheck again. Since the conditions that are checked by hp_hs_sleep__eventscheck are still valid, namely that bd_sq_hs.NoiseRoom_QS is still equal to 10, this creates an infinite loop. It is possible to break out of the loop by executing a setpqv bd_sq_hs noiseroom_qs 11 or similar command.

Recommended Fix: Create a variable in the hp_hs_mine_qs quest that is a 'hasScenePlayed' boolean. Add a condition to Phase 5 in hp_hs_sleep__eventscheck that only starts the hp_hs_sleep__BSE_Torgnir_Debt01 scene if hasScenePlayed is false. Finally, add a line of code to the BSE_Torgnir_Debt01 scene script that sets the hasScenePlayed value to true. This might be slightly more work than setting bd_sq_hs.NoiseRoom_QS to 11 or something in that scene script, depending on the number of other checks that depend on the NR_QS variable being exactly 10