Skip to content

Commit

Permalink
Updated scripts files, and ddraw.ini.
Browse files Browse the repository at this point in the history
  • Loading branch information
FakelsHub committed Feb 10, 2019
1 parent 0cfee0c commit ca41945
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 19 deletions.
4 changes: 2 additions & 2 deletions artifacts/ddraw.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.1.4 - Extended version
;v4.1.5 - Extended version

[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
Expand Down Expand Up @@ -46,7 +46,7 @@ SpeedMulti9=900
;The initial speed at game startup
SpeedMultiInitial=100

;Set to 1 to speed affect to video playback and slide show
;Set to 1 to also affect the playback speed of videos (only for mve-files that don't contain an audio track)
AffectPlayback=0

;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down
Binary file modified artifacts/example_mods/AutoDoors/gl_autodoors.int
Binary file not shown.
63 changes: 46 additions & 17 deletions artifacts/example_mods/AutoDoors/gl_autodoors.ssl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*

Auto Doors mod for Fallout 2 by Mr.Stalin
Auto Doors v1.1 mod for Fallout 2 by Mr.Stalin
-----------------------------------------

- allows the player to automatically open/walk through unlocked doors when not in combat
Expand All @@ -12,66 +12,95 @@ NOTE: this script requires compiler from sfall modderspack with -s option

*/

#define SFALL_SC_EVALUATION (true)

/* 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\headers\sfall.h"
#include "..\..\scripting\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
end
else begin
if (only_once == 1 and combat_is_initialized) then begin
only_once := 2;
call set_door_flag(false);
end else if (only_once == 2 and not(combat_is_initialized)) then begin
call set_door_flag(0); // reset flag when entered 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 ending combat mode
end
end
end

procedure map_enter_p_proc begin
if (arrayPid) then begin
// when changing the map, delete the current array to create a new
free_array(arrayPid);
arrayPid := 0;
end
only_once := 1;
call set_door_flag(FLAG_WALKTHRU);
call set_door_flag(FLAG_WALKTHRU); // set the flag entered 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 change: 1 addition & 0 deletions artifacts/mods/gl_sfall-mods.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ procedure start begin
// Fix the lighting of the map from the night vision perk when loading the game
if has_trait(TRAIT_PERK, dude_obj, PERK_night_vision) then begin
temp := get_light_level;
if (temp > 65535) then return; // 100%
if (temp < 40960) then begin
temp := round(((temp - 16384) * 100) / 24576.0);
end
Expand Down

0 comments on commit ca41945

Please sign in to comment.