BGforgeNet / Fallout2_Unofficial_Patch

Fallout 2 Unofficial Patch, updated
https://forums.bgforge.net/viewforum.php?f=39
131 stars 9 forks source link

Restore Enclave death slides #115

Closed burner1024 closed 1 year ago

burner1024 commented 1 year ago

As discovered by NovaRain, there are some death slides that never play.

Found an interesting engine bug: the game picks incorrect death endings under certain conditions (low chance), and by fixing it triggers another bug (more like an oversight): the enclave related death endings ( nar_dth7/8/9 in enddeath.txt) are never actually available to the player.

Because the player doesn't really "know" the location of Enclave (i.e. area 16 never shows on the world map).

I think they can be "enabled" by calling mark_on_map(AREA_THE_ENCLAVE) in map_enter in encfite script, and unmark_on_map(AREA_THE_ENCLAVE) in map_exit, so when the player dies on the oil rig maps those death endings can be shown.

NovaRain commented 1 year ago

I just tested the mark/unmark macros, and the availability of death endings does change:

I use some hacks to dump the death end info list from memory when the player is dead. The last 0/1 value indicates whether the ending is available.

* default (even on the oil rig) or calling unmark_on_map(AREA_THE_ENCLAVE)

DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_4, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_5, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_6, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_dth1, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_dth2, 1
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth3, 1
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth4, 1
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth5, 1
DeathEndInfo dump: -1, 0, 22, -1, 0, 40, nar_dth6, 1
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth7, 0
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth8, 0
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth9, 0
DeathEndInfo dump: 491, 1, 3, -1, 150, 0, nar_mo1, 0
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd1, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd3, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd4, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd5, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd6, 1

* calling mark_on_map(AREA_THE_ENCLAVE)

DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_4, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_5, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_6, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_dth1, 1
DeathEndInfo dump: -1, 0, -1, -1, 0, 20, nar_dth2, 1
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth3, 0
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth4, 0
DeathEndInfo dump: -1, 0, -1, 16, 0, 40, nar_dth5, 0
DeathEndInfo dump: -1, 0, 22, -1, 0, 40, nar_dth6, 1
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth7, 1
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth8, 1
DeathEndInfo dump: -1, 0, 16, -1, 0, 40, nar_dth9, 1
DeathEndInfo dump: 491, 1, 3, -1, 150, 0, nar_mo1, 0
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd1, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd3, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd4, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd5, 1
DeathEndInfo dump: -1, 0, -1, -1, 10, 1, nar_jdd6, 1

So I think we can enable them when the player is on the oil rig like this:

procedure map_enter_p_proc begin
   if (global_var(GVAR_LOAD_MAP_INDEX) == 12) then begin
      override_map_start_hex( 24502, 0, 0 );
   end

   Enclave_Lighting;
   set_global_var(GVAR_LOAD_MAP_INDEX,0);
   mark_on_map(AREA_THE_ENCLAVE) // player cannot see the world map while on the oil rig so it's fine
end

procedure map_exit_p_proc begin
   if (global_var(GVAR_ENCLAVE_FRANK_DEAD) == 1) then begin
      set_global_var(GVAR_ENCLAVE_FRANK_DEAD, 2);
      set_global_var(GVAR_ENCLAVE_COUNTDOWN, 0);
      unmark_on_map(AREA_THE_ENCLAVE) // no unreachable "Enclave" location circle on the world map
      gfade_out(600);
      game_time_advance(ONE_GAME_DAY); //added by killap
      set_global_var(GVAR_ARROYO_RETURN_GECK,1);
      play_gmovie(DERRICK_MOVIE);
      endgame_slideshow;
   end
end