Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaRain committed Feb 12, 2019
2 parents a043730 + fe5a148 commit 6fdf3ac
Show file tree
Hide file tree
Showing 58 changed files with 1,634 additions and 1,419 deletions.
11 changes: 6 additions & 5 deletions artifacts/config_files/CriticalOverrides.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ Part_0=1 ; Tell sfall that we want to modify the head entries

[c_00_0] ; The entries for the head table of the men critter type.
e0_DamageMultiplier=100 ;First level critical
e0_EffectFlags=0
e0_EffectFlags=0 ; The value of the flags (see DAM_* in Define.h)
; For multiple effects, use the sum of the flags (e.g. 2050 = knocked down + bypass armor)
e0_StatCheck=0
e0_StatMod=0
e0_FailureEffect=0
e0_Message=0 ; This is an index into the msg file, not a string
e0_FailMessage=0
e1_... ; Second level critical
... ; And so on up to the hardest hitting level 5 critical
e5_...
;e1_... ; Second level critical
;... ; And so on up to the hardest hitting level 5 critical
;e5_...

;You can skip any entries from this section to leave them at their defaults
;Any missing entries for critters 19-37 will be replaced by a 0, since they have no default
;Note that the UOP fixes are included in the defaults, and do not need to be
; added manually when using this override format, as opposed to the old one
; added manually when using this override format, as opposed to the old one
11 changes: 6 additions & 5 deletions artifacts/config_files/books.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
; Allows to reassign books to different object PIDs, text messages.
; Maximum 30 books are allowed (25 if overrideVanilla is 0)
; Allows to reassign books to different object PIDs, text messages, and skills.
; Maximum 50 books are allowed

[main]
; total number of books in this file
count=5
count=1

; set to 1 to override all vanilla books, so you will have to define ALL books in this file;
; otherwise only new books are defined here
; set to 1 to override all vanilla books, so you will have to define ALL the necessary books in this file;
; otherwise only new books are defined here. To just override the text/skill of a vanilla book,
; specify its PID in the new book and set the parameters
overrideVanilla=0

; count starts from 1
Expand Down
38 changes: 25 additions & 13 deletions artifacts/ddraw.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.1.4
;v4.1.5

[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
Expand Down Expand Up @@ -34,18 +34,21 @@ Enable=1
;The speeds corresponding to each slot in percent. (i.e. 100 is normal speed)
SpeedMulti0=50
SpeedMulti1=100
SpeedMulti2=150
SpeedMulti3=200
SpeedMulti4=300
SpeedMulti2=200
SpeedMulti3=300
SpeedMulti4=400
SpeedMulti5=500
SpeedMulti6=1000
SpeedMulti7=100
SpeedMulti8=100
SpeedMulti9=100
SpeedMulti6=600
SpeedMulti7=700
SpeedMulti8=800
SpeedMulti9=900

;The initial speed at game startup
SpeedMultiInitial=100

;Set to 1 to also affect the playback speed of mve video files without an audio track
AffectPlayback=0

;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Graphics]
;Set to 0 for 8 bit fullscreen
Expand Down Expand Up @@ -159,18 +162,14 @@ DebugEditorKey=0
;Time limit in years. Must be between -3 and 13
;Set to 0 if you want to die the instant you leave arroyo
;Set to -1 to remove the time limit, and automatically reset the date back to 2241 each time you would have reached it
;Set to -2 to remove the time limit without resetting the date. The game will lock up on 8th of March 2255
;Set to -3 to remove the time limit, automatically reset the date, but override Fallout's GetDate function to return the correct year
;Set to -2 or -3 to remove the time limit, automatically reset the date, but override Fallout's GetDate function to return the correct year
TimeLimit=13

;World map travel time percentage modifier
;Modifies how fast in game time passes while you're moving around the map screen without affecting encounter rate
;100 is normal speed, 0 stops time from passing
WorldMapTimeMod=100

;Set to 1 to enable functions relating to overriding the file system
UseFileSystemOverride=0

;Set to 1 to use the Fallout 1 code to control world map speed
WorldMapFPSPatch=1

Expand All @@ -197,6 +196,9 @@ WorldMapSlots=0
;To use a config file other than fallout2.cfg, uncomment the next line and add the name of your new file
;ConfigFile=

;Set to 1 to enable functions relating to overriding the file system
UseFileSystemOverride=0

;To use a patch file other than patch000.dat, uncomment the next line and add your new file name
;If you want to check for multiple patch files, you can include a %d in the file name (sprintf syntax)
;By default, only the first patch file found will be used.
Expand Down Expand Up @@ -532,6 +534,13 @@ ObjCanHearObjFix=0
;If the argument value is -1, the mood will be determined by the local variable 0 of the script (vanilla behavior)
StartGDialogFix=0

;Set to 1 to fix and repurpose the unused called_shot/num_attacks arguments of attack_complex script function
;This also changes the behavior of the result flags arguments
;called_shot - additional damage, when the damage received by the target is above the specified minimum damage
;num_attacks - the number of free action points on the first turn only
;attacker_results - unused, must be 0 or not equal to the target_results argument when specifying result flags for the target
AttackComplexFix=0

;Set to 1 to enable the balanced bullet distribution formula for burst attacks
ComputeSprayMod=0

Expand Down Expand Up @@ -713,6 +722,9 @@ AlwaysFindScripts=0
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
InjectAllGameHooks=0

;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
HideObjIsNullMsg=0

;These options control what output is saved in the debug log (sfall-log.txt)

;Prints messages duing sfall initialization
Expand Down
Binary file modified artifacts/example_mods/AutoDoors/gl_autodoors.int
Binary file not shown.
57 changes: 41 additions & 16 deletions artifacts/example_mods/AutoDoors/gl_autodoors.ssl
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
4 changes: 2 additions & 2 deletions artifacts/example_mods/AutoDoors/readme.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions artifacts/scripting/headers/sfall.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
#define party_member_list_all party_member_list(1)


#define art_cache_clear sfall_func0("art_cache_clear")
#define attack_is_aimed sfall_func0("attack_is_aimed")
#define car_gas_amount sfall_func0("car_gas_amount")
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
Expand Down
2 changes: 1 addition & 1 deletion artifacts/scripting/hookscripts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ Runs before and after each turn in combat (for both PC and NPC).

int arg1 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ended abruptly (by script or by pressing Enter during PC turn)
int arg2 - critter doing the turn
int arg3 - unknown boolean argument
bool arg3 - set to 1 at the start of the player's turn after the game has been loaded, 0 otherwise

int ret1 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat

Expand Down
12 changes: 8 additions & 4 deletions artifacts/scripting/sfall function notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ get/set_critter_current_ap functions should only be used during the target critt

The 'type' value in the weapon knockback functions can be 0 or 1. If 0, the value becomes an absolute distance that targets will be knocked back. If 1, the value is multiplied by the distance they would normally have been knocked back. Weapon knockback modifiers are applied in the order weapon -> attacker -> target, so a x2 weapon wielded by an abs 6 attacker hitting a /2 target will knock the target back 3 squares. The knockback functions will not override the stonewall perk or knockdowns resulting from criticals. knockback values set on weapons or critters are not saved, and must be reset each time the player reloads.

The get/set_sfall_global functions require an 8 character long case sensitive string for the variable name. The variables behave the same as normal Fallout globals, except that they don't have to be declared beforehand in vault13.gam. Trying to get a variable which hasn't been set will always return 0. These functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.
The get/set_sfall_global functions require an 8 characters long case sensitive string for the variable name. The variables behave the same as normal Fallout globals, except that they don't have to be declared beforehand in vault13.gam. Trying to get a variable which hasn't been set will always return 0. These functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.

set_pickpocket_max and set_hit_chance_max effect all critters rather than just the player. set_skill_max can't be used to increase the skill cap above 300. set_perk_level_mod sets a modifier between +25 and -25 that is added/subtracted from the players level for the purposes of deciding which perks can be chosen.

Expand All @@ -60,7 +60,7 @@ get/set_unspent_ap_bonus alter the AC bonus you receive per unused action point

nb_* functions are reserved for the brotherhood tactical training mod, and should be avoided.

The fs_* functions are used to manipulate a virtual file system. Files saved here should have paths relative to the data folder, and use backslashes as the directory separator. They will take precedence over files stored in the normal data folder. They will also be saved into save games, so be avoid creating large files. Using fs_copy followed by fs_read_xxx, you can read the contents of existing files.
The fs_* functions are used to manipulate a virtual file system. Files saved here should have paths relative to the data folder, and use backslashes as the directory separator. They will take precedence over files stored in the normal data folder. They will also be saved into save games if you set a flag for them using fs_resize(fileId, -1), so be avoid creating large files. Using fs_copy followed by fs_read_xxx, you can read the contents of existing files.

get/set_proto_data are used to manipulate the in memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permanent. If you modify the protos, and then Fallout subsequently reloads the file your changes will be lost.

Expand Down Expand Up @@ -163,8 +163,9 @@ array - array ID to be used with array-related functions (actually an integer)
- overrides the scripts self_obj for the next function call.
- It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts;
- self_obj will revert back to its original value after the next function call.
- calling self_obj(0) will also revert self_obj to original value
- calling self_obj(0) will also revert self_obj to original value. It is recommended to call this after each use of set_self in normal scripts in order to avoid unforeseen side effects.
- source_obj, target_obj, and similar functions will not work if preceded by "set_self"
- NOTE: for use_obj/use_obj_on_obj vanilla functions to work correctly, it is required to call set_self twice.

> void mod_skill_points_per_level(int x)
- accepts a value of between -100 and 100, and modifies the number of skill points the player receives when they level up.
Expand Down Expand Up @@ -292,7 +293,7 @@ Some utility/math functions are available:
> float sqrt(float x)
- square root of x

> float abs(float x)
> int/float abs(int/float x)
- absolute (positive) value of x

> float sin(float x)
Expand Down Expand Up @@ -560,6 +561,9 @@ Some utility/math functions are available:
- returns the setting value from the AI packet of an object (critter)
- use AI_CAP_* constants from define_extra.h for the aiParam argument to get AI value

> void sfall_func0("art_cache_clear")
- clears the cache of FRM image files loaded into memory

------------------------
------ MORE INFO -------
------------------------
Expand Down
2 changes: 1 addition & 1 deletion artifacts/scripting/sfall opcode list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
0x81e9 - int get_unspent_ap_perk_bonus()

0x81ec - float sqrt(float)
0x81ed - float abs(float)
0x81ed - int/float abs(int/float)
0x81ee - float sin(float)
0x81ef - float cos(float)
0x81f0 - float tan(float)
Expand Down
7 changes: 6 additions & 1 deletion sfall/FalloutEngine/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,12 @@ enum AttackType : long
#define CRITTER_EYEDAMAGE (0x40)


#define WEAPON_TWO_HANDED (0x200)
#define WEAPON_TWO_HANDED (0x200)

enum TicksTime : unsigned long
{
ONE_GAME_YEAR = 315360000
};

enum RollResult
{
Expand Down
9 changes: 9 additions & 0 deletions sfall/FalloutEngine/Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,4 +700,13 @@ struct AIcap {
long general_type;
};

#pragma pack(1)
struct Queue {
DWORD time;
long type;
GameObject* object;
long data;
Queue* next;
};

}
1 change: 1 addition & 0 deletions sfall/FalloutEngine/VariableOffsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define FO_VAR_character_points 0x518538
#define FO_VAR_cmap 0x51DF34
#define FO_VAR_colorTable 0x6A38D0
#define FO_VAR_combat_end_due_to_load 0x517F98
#define FO_VAR_combat_free_move 0x56D39C
#define FO_VAR_combat_list 0x56D390
#define FO_VAR_combat_state 0x510944
Expand Down
Loading

0 comments on commit 6fdf3ac

Please sign in to comment.