mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Moved DontDeleteProtos option from main.cpp to DebugEditor.cpp.
Updated Auto Doors script mod from Mr.Stalin and ddraw.ini.
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ SpeedMulti9=900
|
||||
;The initial speed at game startup
|
||||
SpeedMultiInitial=100
|
||||
|
||||
;Set to 1 to also affect the playback speed of videos without audio tracks
|
||||
;Set to 1 to also affect the playback speed of mve video files without an audio track
|
||||
AffectPlayback=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
Auto Doors mod for Fallout 2 by Mr.Stalin
|
||||
-----------------------------------------
|
||||
Auto Doors mod v1.1 for Fallout 2 by Mr.Stalin
|
||||
----------------------------------------------
|
||||
|
||||
- allows the player to automatically open/walk through unlocked doors when not in combat
|
||||
|
||||
@@ -12,66 +12,91 @@ NOTE: this script requires compiler from sfall modderspack with -s option
|
||||
|
||||
*/
|
||||
|
||||
/* Include Files */
|
||||
#include "..\headers\define.h"
|
||||
#include "..\headers\command.h"
|
||||
#include "..\headers\sfall\sfall.h"
|
||||
#include "..\headers\sfall\define_extra.h"
|
||||
//#include "..\headers\command.h"
|
||||
#include "..\..\scripting_docs\headers\sfall.h"
|
||||
#include "..\..\scripting_docs\headers\define_extra.h"
|
||||
|
||||
/* Standard Script Procedures */
|
||||
procedure start;
|
||||
procedure map_enter_p_proc;
|
||||
|
||||
procedure set_door_flag(variable state);
|
||||
procedure set_door_flag_array(variable state);
|
||||
procedure combatturn_handler;
|
||||
|
||||
/* Defines */
|
||||
#define PORTAL (0)
|
||||
#define DOOR_FLAGS (0x24)
|
||||
|
||||
variable only_once := 0;
|
||||
variable arrayPid;
|
||||
|
||||
procedure start begin
|
||||
if game_loaded then begin
|
||||
if (sfall_ver_major >= 4) then
|
||||
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
|
||||
else
|
||||
set_global_script_repeat(60);
|
||||
set_global_script_repeat(40); // for sfall 3.x
|
||||
call map_enter_p_proc;
|
||||
end else begin
|
||||
if (only_once == 1 and combat_is_initialized) then begin
|
||||
only_once := 2;
|
||||
call set_door_flag(false);
|
||||
call set_door_flag(0); // reset flag when entering combat mode
|
||||
end else if (only_once == 2 and not(combat_is_initialized)) then begin
|
||||
only_once := 1;
|
||||
if (sfall_ver_major >= 4) then
|
||||
set_global_script_repeat(0);
|
||||
call set_door_flag(FLAG_WALKTHRU);
|
||||
if (sfall_ver_major >= 4) then set_global_script_repeat(0);
|
||||
call set_door_flag(FLAG_WALKTHRU); // set flag after combat mode ends
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
procedure map_enter_p_proc begin
|
||||
if (arrayPid) then begin
|
||||
// when changing maps, delete the current array to create a new one
|
||||
free_array(arrayPid);
|
||||
arrayPid := 0;
|
||||
end
|
||||
only_once := 1;
|
||||
call set_door_flag(FLAG_WALKTHRU);
|
||||
call set_door_flag(FLAG_WALKTHRU); // set flag when entering the map
|
||||
end
|
||||
|
||||
procedure set_door_flag(variable state) begin
|
||||
variable objectMap, obj, objPid, arrayPid, i;
|
||||
variable objectMap, obj, objPid, i;
|
||||
|
||||
if (arrayPid) then begin
|
||||
call set_door_flag_array(state);
|
||||
return;
|
||||
end
|
||||
|
||||
objectMap := list_as_array(LIST_SCENERY);
|
||||
arrayPid := temp_array(1, 0);
|
||||
arrayPid := create_array(0, 0);
|
||||
|
||||
foreach (obj in objectMap) begin
|
||||
objPid := obj_pid(obj);
|
||||
|
||||
if (proto_data(objPid, sc_type) != PORTAL) or is_in_array(objPid, arrayPid) then
|
||||
continue;
|
||||
continue; // next object
|
||||
|
||||
resize_array(arrayPid, i + 1);
|
||||
arrayPid[i] := objPid;
|
||||
i++;
|
||||
resize_array(arrayPid, i + 1);
|
||||
set_proto_data(objPid, DOOR_FLAGS, state);
|
||||
end
|
||||
end
|
||||
|
||||
procedure set_door_flag_array(variable state) begin
|
||||
variable objPid;
|
||||
foreach (objPid in arrayPid) begin
|
||||
set_proto_data(objPid, DOOR_FLAGS, state);
|
||||
end
|
||||
end
|
||||
|
||||
procedure combatturn_handler begin
|
||||
if (only_once == 1) then
|
||||
if (only_once == 1) then begin
|
||||
only_once := 2;
|
||||
call set_door_flag_array(0);
|
||||
set_global_script_repeat(60);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Auto Doors mod for Fallout 2 by Mr.Stalin
|
||||
-----------------------------------------
|
||||
Auto Doors mod v1.1 for Fallout 2 by Mr.Stalin
|
||||
----------------------------------------------
|
||||
|
||||
- allows the player to automatically open/walk through unlocked doors when not in combat
|
||||
|
||||
|
||||
@@ -295,9 +295,18 @@ void DebugModePatch() {
|
||||
}
|
||||
}
|
||||
|
||||
void DontDeleteProtosPatch() {
|
||||
if (GetPrivateProfileIntA("Debugging", "DontDeleteProtos", 0, ".\\ddraw.ini")) {
|
||||
dlog("Applying permanent protos patch.", DL_INIT);
|
||||
SafeWrite8(0x48007E, 0xEB);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
}
|
||||
|
||||
void DebugEditorInit() {
|
||||
if (!IsDebug) return;
|
||||
DebugModePatch();
|
||||
DontDeleteProtosPatch();
|
||||
|
||||
if (GetPrivateProfileIntA("Debugging", "HideObjIsNullMsg", 0, ".\\ddraw.ini")) {
|
||||
MakeCall(0x453FD2, dbg_error_hack, 1);
|
||||
|
||||
@@ -1171,12 +1171,6 @@ static void DllMain2() {
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
if (IsDebug && GetPrivateProfileIntA("Debugging", "DontDeleteProtos", 0, ".\\ddraw.ini")) {
|
||||
dlog("Applying permanent protos patch.", DL_INIT);
|
||||
SafeWrite8(0x48007E, 0xEB);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
CritInit();
|
||||
|
||||
if (GetPrivateProfileIntA("Misc", "MultiPatches", 0, ini)) {
|
||||
|
||||
Reference in New Issue
Block a user