gothic-1-community-patch icon indicating copy to clipboard operation
gothic-1-community-patch copied to clipboard

Chromanin books spawn at wrong location

Open AmProsius opened this issue 4 years ago • 2 comments

Describe the bug The Chromanin books spawn at the wrong location when they are read in another location than the overworld.

Expected behavior to be defined

Additional context Bug provided by Blubbler.

AmProsius avatar May 08 '21 14:05 AmProsius

I see two possible solutions:

  1. If possible, spawn them at the right location in the overworld.
  2. If [1] is not possible, prevent the player from reading one of the books in every other location.

AmProsius avatar May 08 '21 14:05 AmProsius

The first one will not be possible. Second might seem like the way to go. For each book, analyze the bytecode of the item's on_state function to find the waypoint referred to by a call to Wld_InsertItem (second argument). Hook the on_state function to check if that waypoint exists. If not, immediately return from the on_state function, possibly with a voice line like this one (needs to be check for existence): https://github.com/AmProsius/gothic-1-community-patch/blob/a867f2db6a820eb1980527f31d62fdceddd1f968/scriptbase/_work/Data/Scripts/Content/Story/SVM.d#L2148

szapp avatar May 08 '21 14:05 szapp