mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
504f66f002 | ||
|
|
76f2301b6c | ||
|
|
4788ac757b | ||
|
|
a71b33aab1 | ||
|
|
222f3eaf68 | ||
|
|
823d2b92f7 | ||
|
|
f478e9a1f9 | ||
|
|
8718b86440 | ||
|
|
67adb9b592 | ||
|
|
ca5781a44a | ||
|
|
4edf36a1dc | ||
|
|
4a5f556cd3 | ||
|
|
2b7754746c | ||
|
|
8a4a83c8f8 | ||
|
|
c04df22c48 | ||
|
|
8e0ccc576c | ||
|
|
42566cc9da | ||
|
|
9e1c68e78d | ||
|
|
9765396b08 | ||
|
|
b008502e13 | ||
|
|
d71efe5b82 | ||
|
|
120888e5ed | ||
|
|
7b5075042d | ||
|
|
12ad41043d | ||
|
|
e509932add | ||
|
|
ba3ad33587 | ||
|
|
6e74c3166a | ||
|
|
e320acce0b | ||
|
|
4f48926105 | ||
|
|
5611931063 | ||
|
|
f00022fed6 | ||
|
|
78815425e2 | ||
|
|
9ddddcc120 | ||
|
|
11c15cec93 | ||
|
|
f36bd6fb61 | ||
|
|
26ab38c6c3 | ||
|
|
9b50e6be1e | ||
|
|
2427634ee8 | ||
|
|
36d1d0a5fc | ||
|
|
486f00cdf4 | ||
|
|
b6fd424665 | ||
|
|
3d679db758 | ||
|
|
92e1f919d9 | ||
|
|
d259e8c903 | ||
|
|
dea0e596c3 | ||
|
|
90b39f3dde | ||
|
|
c80224f661 | ||
|
|
d7d8de5e1a | ||
|
|
0a21e4abfa | ||
|
|
1340eeb0d3 | ||
|
|
a350fed4d1 | ||
|
|
402d4f40f2 | ||
|
|
0f49c7f68d | ||
|
|
deb0299776 | ||
|
|
4bb3fa0275 | ||
|
|
da31455cef | ||
|
|
4da10e2fdb | ||
|
|
5426d043c1 | ||
|
|
719cec74d1 | ||
|
|
627fe11c29 | ||
|
|
dcca405b89 | ||
|
|
cce9437d19 | ||
|
|
09b3bf3aed | ||
|
|
08a891a0fc | ||
|
|
e9df81ac78 |
@@ -14,15 +14,16 @@ 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
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
; have an additional NoHardcode option in this file which can
|
||||
; be used to remove their hardcoded effects, and add new stat/skill effects
|
||||
|
||||
;Name=The name of the perk
|
||||
;Desc=The description of the perk
|
||||
;Name=The name of the perk (max 63 characters)
|
||||
;Desc=The description of the perk (max 1023 characters)
|
||||
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
|
||||
;Ranks=The number of perk levels
|
||||
;Level=The minimum required level
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
;Controls the elevators
|
||||
;Image must match up with the image of an existing elevator
|
||||
;Image must match up with the image of an existing elevator (can be overrided in sfall 4.1.4/3.8.14 or newer)
|
||||
;Make sure you specify the correct number of exit targets
|
||||
;The maximum number of elevators is currently capped at 50
|
||||
;Use the line number (0-indexed) of the corresponding FRM in intrface.lst to set the appearance of the elevator
|
||||
|
||||
;Override elevator 0
|
||||
[000]
|
||||
;This elevator uses the frm of the original forth elevator
|
||||
[0]
|
||||
;This elevator will use the settings of the original forth elevator
|
||||
Image=4
|
||||
|
||||
;Set up the first exit point
|
||||
@@ -24,3 +25,22 @@ Elevation3=0
|
||||
Tile3=12944
|
||||
|
||||
;No forth exit point
|
||||
|
||||
;Override FRM images of elevator 0. Set ButtonsFrm to -1 to use default buttons from MainFrm
|
||||
MainFrm=143
|
||||
ButtonsFrm=-1
|
||||
|
||||
|
||||
;An example of a new elevator
|
||||
[24]
|
||||
;Set Image to 24 to create a new elevator type (0-23 are the original elevator types)
|
||||
Image=24
|
||||
|
||||
;Set the number of buttons
|
||||
ButtonCount=3
|
||||
|
||||
;Set the appearance of the elevator
|
||||
MainFrm=148
|
||||
ButtonsFrm=151
|
||||
|
||||
;Set up the exit points for all three buttons (see examples above)
|
||||
|
||||
+41
-14
@@ -1,5 +1,5 @@
|
||||
;sfall configuration settings
|
||||
;v3.8.12
|
||||
;v3.8.15
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
@@ -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
|
||||
@@ -176,8 +179,7 @@ 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
|
||||
@@ -185,9 +187,6 @@ TimeLimit=13
|
||||
;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
|
||||
|
||||
@@ -214,6 +213,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.
|
||||
@@ -370,6 +372,7 @@ ProcessorIdle=-1
|
||||
LoadProtoMaxLimit=-1
|
||||
|
||||
;Set to 1 if using the hero appearance mod
|
||||
;You can add AppChCrt.frm and AppChEdt.frm files to art/intrface/ to set a custom background for the character screen
|
||||
EnableHeroAppearanceMod=0
|
||||
|
||||
;Set to 1 to skip the 3 opening movies
|
||||
@@ -384,6 +387,9 @@ NPCsTryToSpendExtraAP=0
|
||||
;Note that enabling this option can significantly affect the weapon choice of some NPCs in combat
|
||||
AIBestWeaponFix=0
|
||||
|
||||
;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as drug use preference when using drugs in their inventory
|
||||
AIDrugUsePerfFix=0
|
||||
|
||||
;Allows the use of tiles over 80*36 in size. sfall will just split and resave them at startup
|
||||
;Set to 1 to check all tiles on started (slow)
|
||||
;Set to 2 if you provide a XLtiles.lst file in art/tiles/ containing a list of the tile ids that need checking
|
||||
@@ -429,6 +435,7 @@ ExtraSaveSlots=0
|
||||
|
||||
;Set to 1 to speed up the HP/AC counter animations
|
||||
;Set to 2 to update the HP/AC counters instantly
|
||||
;Set to 3 to update the AC counter instantly when switching to other controlled critters in combat
|
||||
SpeedInterfaceCounterAnims=0
|
||||
|
||||
;These lines allow you to control the karma FRMs displayed on the character screen
|
||||
@@ -445,7 +452,7 @@ ScienceOnCritters=0
|
||||
SpeedInventoryPCRotation=166
|
||||
|
||||
;Uncomment to set the text colour of the extra 5 interface boxes
|
||||
;The line must contain a 5 digits, each either a 0 for green or 1 for red
|
||||
;The line must contain 5 digits, each either a 0 for green or 1 for red
|
||||
;BoxBarColours=00000
|
||||
|
||||
;Set to 1 to fix the bug that caused bonus HtH damage to not be applied correctly.
|
||||
@@ -532,6 +539,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
|
||||
|
||||
@@ -609,6 +623,10 @@ EnableMusicInDialogue=0
|
||||
;Set to 1 to prevent the player from running while sneaking without Silent Running perk
|
||||
DontTurnOffSneakIfYouRun=0
|
||||
|
||||
;Changes the distance at which the player will switch to walking when trying to use objects (valid range: 0..3)
|
||||
;Set to 0 to disable switching. (Default is 3)
|
||||
UseWalkDistance=3
|
||||
|
||||
;Set to 1 to fix the bug that unable to sell used geiger counters or stealth boys
|
||||
CanSellUsedGeiger=1
|
||||
|
||||
@@ -629,6 +647,12 @@ NumbersInDialogue=0
|
||||
;Set to 1 to use Fallout's normal text font instead of DOS-like font on the world map
|
||||
WorldMapFontPatch=0
|
||||
|
||||
;Set to 1 to display full item description for weapon/ammo in barter screen
|
||||
FullItemDescInBarter=0
|
||||
|
||||
;Set to 1 to display experience points with the bonus from Swift Learner perk when gained from non-scripted situations
|
||||
DisplaySwiftLearnerExp=1
|
||||
|
||||
;Set to 1 to display party member's current level/AC/addict flag on the combat control panel
|
||||
PartyMemberExtraInfo=0
|
||||
|
||||
@@ -681,6 +705,9 @@ DontDeleteProtos=0
|
||||
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
|
||||
AllowUnsafeScripting=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
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -151,14 +151,16 @@ Example:
|
||||
|
||||
*mixed means any type
|
||||
|
||||
> int create_array(int size, int nothing):
|
||||
> int create_array(int size, int flags):
|
||||
- creates permanent array (but not "saved")
|
||||
- if size is >= 0, creates list with given size
|
||||
- if size == -1, creates map (associative array)
|
||||
- second argument is not used yet, just use 0
|
||||
- if size == -1 and flags == 2, creates a "lookup" map in which the values of existing keys are read-only and can't be updated.
|
||||
This type of array allows you to store a zero (0) key value
|
||||
- NOTE: in earlier versions (up to 4.1.3/3.8.13) the second argument is not used, just use 0
|
||||
- returns arrayID (valid until array is deleted)
|
||||
|
||||
> int temp_array(int size, int nothing):
|
||||
> int temp_array(int size, int flags):
|
||||
- works exactly like "create_array", only created array becomes "temporary"
|
||||
|
||||
> void fix_array(int arrayID):
|
||||
@@ -169,6 +171,7 @@ Example:
|
||||
- if used on list, "key" must be numeric and within valid index range (0..size-1)
|
||||
- if used on map, key can be of any type
|
||||
- to "unset" a value from map, just set it to zero (0)
|
||||
- NOTE: to add a value of 0 for the key, use the float value of 0.0
|
||||
- this works exactly like statement:
|
||||
arrayID[key] := value;
|
||||
|
||||
@@ -182,7 +185,7 @@ Example:
|
||||
- changes array size
|
||||
- applicable to maps too, but only to reduce elements
|
||||
- there are number of special negative values of "size" which perform various operations on the array,
|
||||
use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfall.h header
|
||||
use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfall.h header
|
||||
|
||||
> void free_array(int arrayID):
|
||||
- deletes any array
|
||||
|
||||
@@ -234,26 +234,26 @@
|
||||
#define CALIBER_7_62MM (18)
|
||||
|
||||
// hidden perks
|
||||
#define PERK_add_nuka (53)
|
||||
#define PERK_add_buffout (54)
|
||||
#define PERK_add_mentats (55)
|
||||
#define PERK_add_psycho (56)
|
||||
#define PERK_add_radaway (57)
|
||||
#define PERK_weapon_long_range (58)
|
||||
#define PERK_weapon_accurate (59)
|
||||
#define PERK_weapon_penetrate (60)
|
||||
#define PERK_weapon_knockback (61)
|
||||
#define PERK_armor_powered (62)
|
||||
#define PERK_armor_combat (63)
|
||||
#define PERK_weapon_scope_range (64)
|
||||
#define PERK_weapon_fast_reload (65)
|
||||
#define PERK_weapon_night_sight (66)
|
||||
#define PERK_weapon_flameboy (67)
|
||||
#define PERK_armor_advanced_1 (68)
|
||||
#define PERK_armor_advanced_2 (69)
|
||||
#define PERK_add_jet (70)
|
||||
#define PERK_add_tragic (71)
|
||||
#define PERK_armor_charisma (72)
|
||||
#define PERK_add_nuka (53)
|
||||
#define PERK_add_buffout (54)
|
||||
#define PERK_add_mentats (55)
|
||||
#define PERK_add_psycho (56)
|
||||
#define PERK_add_radaway (57)
|
||||
#define PERK_weapon_long_range (58)
|
||||
#define PERK_weapon_accurate (59)
|
||||
#define PERK_weapon_penetrate (60)
|
||||
#define PERK_weapon_knockback (61)
|
||||
#define PERK_armor_powered (62)
|
||||
#define PERK_armor_combat (63)
|
||||
#define PERK_weapon_scope_range (64)
|
||||
#define PERK_weapon_fast_reload (65)
|
||||
#define PERK_weapon_night_sight (66)
|
||||
#define PERK_weapon_flameboy (67)
|
||||
#define PERK_armor_advanced_1 (68)
|
||||
#define PERK_armor_advanced_2 (69)
|
||||
#define PERK_add_jet (70)
|
||||
#define PERK_add_tragic (71)
|
||||
#define PERK_armor_charisma (72)
|
||||
|
||||
#define WPN_ANIM_NONE (0x00) // (A)
|
||||
#define WPN_ANIM_KNIFE (0x01) // (D)
|
||||
@@ -267,4 +267,21 @@
|
||||
#define WPN_ANIM_MINIGUN (0x09) // (L)
|
||||
#define WPN_ANIM_ROCKET_LAUNCHER (0x0A) // (M)
|
||||
|
||||
// common object data offsets
|
||||
#define OBJ_DATA_TILENUM (0x04)
|
||||
#define OBJ_DATA_CUR_FRM (0x18) // current frame number
|
||||
#define OBJ_DATA_ROTATION (0x1C)
|
||||
#define OBJ_DATA_FID (0x20)
|
||||
#define OBJ_DATA_ELEVATION (0x28)
|
||||
#define OBJ_DATA_PID (0x64)
|
||||
#define OBJ_DATA_CID (0x68)
|
||||
#define OBJ_DATA_SID (0x78)
|
||||
// items
|
||||
#define OBJ_DATA_CUR_CHARGES (0x3C)
|
||||
// critters
|
||||
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
||||
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
||||
#define OBJ_DATA_DAMAGE_LAST_TURN (0x48)
|
||||
#define OBJ_DATA_WHO_HIT_ME (0x54)
|
||||
|
||||
#endif // DEFINE_EXTRA_H
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
/*
|
||||
Generic array functions
|
||||
*/
|
||||
// returns True if the specified key exists in the associative array
|
||||
procedure map_contains_key(variable arrayMap, variable key);
|
||||
|
||||
// push new item at the end of array, returns array
|
||||
procedure array_push(variable array, variable item);
|
||||
|
||||
@@ -151,6 +154,14 @@ procedure load_collection(variable name);
|
||||
|
||||
#define ARRAY_SET_BLOCK_SIZE (10)
|
||||
|
||||
procedure map_contains_key(variable arrayMap, variable key) begin
|
||||
variable i;
|
||||
for (i := 0; i < len_array(arrayMap); i++) begin
|
||||
if (array_key(arrayMap, i) == key) then return true;
|
||||
end
|
||||
return false;
|
||||
end
|
||||
|
||||
/**
|
||||
* Returns first index of zero value
|
||||
*/
|
||||
|
||||
@@ -102,6 +102,10 @@
|
||||
#define create_array_map (create_array(-1, 0))
|
||||
// create temporary map
|
||||
#define temp_array_map (temp_array(-1, 0))
|
||||
// create persistent lookup map (see arrays.txt for details)
|
||||
#define create_lookup_map (create_array(-1, 2))
|
||||
// create temporary lookup map
|
||||
#define temp_lookup_map (temp_array(-1, 2))
|
||||
// true if array is map, false otherwise
|
||||
#define array_is_map(x) (array_key(x, -1) == 1)
|
||||
// returns temp list with names of all arrays saved with save_array() in alphabetical order
|
||||
@@ -114,14 +118,18 @@
|
||||
#define array_exists(array) (len_array(array) != -1)
|
||||
// remove all elements from array
|
||||
#define clear_array(array) resize_array(array, 0)
|
||||
// sort array in ascending order
|
||||
// sort array or map by key in ascending order
|
||||
#define sort_array(array) resize_array(array, -2)
|
||||
// sort array in descending order
|
||||
// sort array or map by key in descending order
|
||||
#define sort_array_reverse(array) resize_array(array, -3)
|
||||
// reverse elements in list
|
||||
// reverse elements in list/map
|
||||
#define reverse_array(array) resize_array(array, -4)
|
||||
// randomly shuffle elements in list
|
||||
// randomly shuffle elements in list/map
|
||||
#define shuffle_array(array) resize_array(array, -5)
|
||||
// sort map in ascending order by value
|
||||
#define sort_map_value(array) resize_array(array, -6)
|
||||
// sort map in descending order by value
|
||||
#define sort_map_value_desc(array) resize_array(array, -7)
|
||||
// remove element from map or just replace value with 0 for list
|
||||
#define unset_array(array, item) set_array(array, item, 0)
|
||||
// same as "key_pressed" but checks VK codes instead of DX codes
|
||||
@@ -206,6 +214,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 create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
#define create_win_flag(winName, x, y, w, h, flag) sfall_func6("create_win", winName, x, y, w, h, flag)
|
||||
@@ -217,6 +226,7 @@
|
||||
#define get_cursor_mode sfall_func0("get_cursor_mode")
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_map_enter_position sfall_func0("get_map_enter_position")
|
||||
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
|
||||
#define get_outline(obj) sfall_func1("get_outline", obj)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
@@ -224,11 +234,15 @@
|
||||
#define intface_show sfall_func0("intface_show")
|
||||
#define inventory_redraw(invSide) sfall_func1("inventory_redraw", invSide)
|
||||
#define item_weight(obj) sfall_func1("item_weight", obj)
|
||||
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
|
||||
#define obj_under_cursor(crSwitch, inclDude) sfall_func2("obj_under_cursor", crSwitch, inclDude)
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
|
||||
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
|
||||
#define set_object_data(obj, offset, value) sfall_func3("set_object_data", obj, offset, value)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
|
||||
@@ -166,7 +166,7 @@ int arg5 - The special effect flags for the target (use bwand DAM_* to chec
|
||||
int arg6 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)
|
||||
int arg7 - The weapon used in the attack
|
||||
int arg8 - The bodypart that was struck
|
||||
int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2, but with Silent Death perk and the corresponding attack conditions, it's 4; for critical hits, the value is taken from the critical table)
|
||||
int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
|
||||
int arg10 - Number of bullets actually hit the target (1 for melee attacks)
|
||||
int arg11 - The amount of knockback to the target
|
||||
int arg12 - Attack Type (see ATKTYPE_* constants)
|
||||
@@ -189,7 +189,7 @@ Critter arg1 - The critter that just died
|
||||
|
||||
HOOK_FINDTARGET (hs_findtarget.int)
|
||||
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker. This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. Use sfall_return to give the 4 targets, in order of preference. All 4 must be given if you want to override normal sorting; if you want to specify less than 4 targets fill in the extra spaces with 0's. If you do not give 4 targets, the NPCs normal sorting mechanism will be used.
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker. This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. Use sfall_return to give the 4 targets, in order of preference. All 4 must be given if you want to override normal sorting; if you want to specify less than 4 targets, fill in the extra spaces with 0's. If you do not give 4 targets, the NPCs normal sorting mechanism will be used.
|
||||
|
||||
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries.
|
||||
|
||||
@@ -432,7 +432,7 @@ HOOK_INVENWIELD (hs_invenwield.int)
|
||||
Runs before wielding or unwielding an armor or a weapon by a critter (except when using inventory by PC).
|
||||
An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations.
|
||||
NOTE: when replacing a previously wielded armor or weapon, the unwielding hook will not be executed.
|
||||
If you need to rely on this, try checking if armor/weapon already equipped when wielding hook is executed.
|
||||
If you need to rely on this, try checking if armor/weapon is already equipped when wielding hook is executed.
|
||||
|
||||
Critter arg1 - critter
|
||||
Obj arg2 - item being wielded or unwielded (weapon/armor), may be 0 when unwielding (object is valid only if the item is unwielded by move_obj_inven_to_obj() or rm_obj_from_inven())
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -48,7 +48,7 @@ set_fake_trait and set_fake_perk can be used to add additional traits and perks
|
||||
|
||||
has_fake_trait and has_fake_perk return the number of levels the player has of the perks/traits with the given name.
|
||||
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the players traits, if bit 2 is set it is added to the players perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to it's default state.
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the players traits, if bit 2 is set it is added to the players perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to its default state.
|
||||
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to 9 for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 3.8.12, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -98,7 +98,7 @@ array - array ID to be used with array-related functions (actually an integer)
|
||||
----------------------------------------------
|
||||
|
||||
> int game_loaded()
|
||||
- returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. It's primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too.
|
||||
- returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. Its primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too.
|
||||
|
||||
> void inc_npc_level(string npc)
|
||||
- takes an NPC name as an argument. The NPC must be in your party. This function ignores player level requirements and the minimum 3 player level delay between NPC level gains. It also ignores the random element, regardless of sfall's NPCAutoLevel setting.
|
||||
@@ -141,7 +141,7 @@ array - array ID to be used with array-related functions (actually an integer)
|
||||
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
|
||||
|
||||
> int get_light_level()
|
||||
- ambient light level in range 0..65535
|
||||
- ambient light level in range 0..65536
|
||||
- The value returned by get_light_level may not exactly match that set by set_light_level, as set_light_level applies modifiers from the night vision perk.
|
||||
|
||||
> void set_map_time_multi(float multi)
|
||||
@@ -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.
|
||||
@@ -223,13 +224,13 @@ was made as a dirty easy hack to allow dynamically change some explosion paramet
|
||||
- currently y is not used and x means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern
|
||||
|
||||
> void set_attack_explosion_art(x, y)
|
||||
- y not used and x is a misc frame ID (last 3 bytes, without object type) to use for the next explosion.
|
||||
- y is not used and x is a misc frame ID (last 3 bytes, without object type) to use for the next explosion.
|
||||
|
||||
> void set_attack_explosion_radius(x)
|
||||
- changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine)
|
||||
|
||||
> void set_attack_is_explosion_fire
|
||||
- if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still receive fire damage.
|
||||
- if you call this right before using a weapon with fire damage type (e.g. in HOOK_AFTERHITROLL), it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still receive fire damage.
|
||||
|
||||
> void set_explosion_radius(grenade, rocket)
|
||||
- sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius.
|
||||
@@ -278,7 +279,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)
|
||||
@@ -310,7 +311,7 @@ Some utility/math functions are available:
|
||||
- this calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION)
|
||||
|
||||
> int tile_light(int elevation, int tileNum)
|
||||
- returns light intensity at the given tile in range from 0 to 65535
|
||||
- returns light intensity at the given tile in range from 0 to 65536
|
||||
|
||||
> object obj_blocking_line(object objFrom, int tileTo, int blockingType)
|
||||
- returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h)
|
||||
@@ -424,6 +425,13 @@ Some utility/math functions are available:
|
||||
- displays player stats in the inventory screen display window
|
||||
- works only in opened inventory
|
||||
|
||||
> int sfall_func1("lock_is_jammed", object)
|
||||
- returns 1 if the lock (container or scenery) is currently jammed, 0 otherwise
|
||||
|
||||
> void sfall_func1("unjam_lock", object)
|
||||
- unjams a lock immediately without having to wait until the next day, or leave the map and then return after 24 hours
|
||||
- does not work in use_skill_on_p_proc procedure
|
||||
|
||||
> array sfall_func0("get_map_enter_position")
|
||||
- returns an array of the player's position data (index 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids
|
||||
- if entering from the world map, the tile value will be -1
|
||||
@@ -449,6 +457,20 @@ Some utility/math functions are available:
|
||||
- works just like vanilla CreateWin function, but creates a window with MoveOnTop flag if the flags argument is not specified, and allows to set additional flags for the created window
|
||||
- MoveOnTop flag allows the created window to be placed on top of the game interface
|
||||
|
||||
> object sfall_func2("obj_under_cursor", bool crSwitch, bool inclDude)
|
||||
- returns the object under the cursor on the main game screen
|
||||
- crSwitch: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.), False - checks all objects (can't check critters under objects)
|
||||
- passing False to the inclDude argument will ignore dude_obj
|
||||
|
||||
> int sfall_func2("get_object_data", object, int offset)
|
||||
- returns the data at the specified offset of an object (see OBJ_DATA_* constants in define_extra.h for offsets)
|
||||
|
||||
> void sfall_func3("set_object_data", object, int offset, int data)
|
||||
- sets the data at the specified offset of an object
|
||||
|
||||
> void sfall_func0("art_cache_clear")
|
||||
- clears the cache of FRM image files loaded into memory
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
*0x8156 - int read_byte(int address)
|
||||
*0x8157 - int read_short(int address)
|
||||
*0x8158 - int read_int(int address)
|
||||
*0x8159 - string read_string(int address)
|
||||
0x8156 - int read_byte(int address)
|
||||
0x8157 - int read_short(int address)
|
||||
0x8158 - int read_int(int address)
|
||||
0x8159 - string read_string(int address)
|
||||
|
||||
*0x81cf - void write_byte(int address, int value)
|
||||
*0x81d0 - void write_short(int address, int value)
|
||||
@@ -132,13 +132,13 @@
|
||||
0x819d - void set_sfall_global(string/int varname, int/float value)
|
||||
0x819e - int get_sfall_global_int(string/int varname)
|
||||
0x819f - float get_sfall_global_float(string/int varname)
|
||||
0x822d - int create_array(int elementcount, int elementsize)
|
||||
0x822d - int create_array(int elementcount, int flags)
|
||||
0x822e - void set_array(int array, any element, any value)
|
||||
0x822f - any get_array(int array, any element)
|
||||
0x8230 - void free_array(int array)
|
||||
0x8231 - int len_array(int array)
|
||||
0x8232 - void resize_array(int array, int newelementcount)
|
||||
0x8233 - int temp_array(int elementcount, int elementsize)
|
||||
0x8233 - int temp_array(int elementcount, int flags)
|
||||
0x8234 - void fix_array(int array)
|
||||
0x8239 - int scan_array(int array, int/float var)
|
||||
0x8256 - int array_key(int array, int index)
|
||||
@@ -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)
|
||||
|
||||
+275
-462
File diff suppressed because it is too large
Load Diff
@@ -162,7 +162,7 @@ skip:
|
||||
call combat_anim_finished_;
|
||||
end:
|
||||
mov [edi][esi], ebx;
|
||||
push 0x415DF2;
|
||||
xor dl, dl; // goto 0x415DF2;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ void ApplyAnimationsAtOncePatches(signed char aniMax) {
|
||||
SafeWrite32(animMaxSizeCheck[i], animRecordSize * aniMax);
|
||||
}
|
||||
|
||||
//divert old animation structure list pointers to newly alocated memory
|
||||
//divert old animation structure list pointers to newly allocated memory
|
||||
|
||||
//struct array 1///////////////////
|
||||
|
||||
@@ -356,7 +356,7 @@ void AnimationsAtOnceInit() {
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
// Fix for calling anim() functions in combat
|
||||
MakeJump(0x415DE2, anim_set_end_hack);
|
||||
MakeCall(0x415DE2, anim_set_end_hack, 1);
|
||||
|
||||
// Fix crash when the critter goes through a door with animation trigger
|
||||
MakeJump(0x41755E, object_move_hack);
|
||||
|
||||
+208
-122
File diff suppressed because it is too large
Load Diff
+35
-13
@@ -4,17 +4,16 @@
|
||||
#include <unordered_map>
|
||||
#include <set>
|
||||
|
||||
#define ARRAY_MAX_STRING (255) // maximum length of string to be stored as array key or value
|
||||
#define ARRAY_MAX_SIZE (100000) // maximum number of array elements,
|
||||
// so total maximum memory/disk footprint of one array is: 16 + (ARRAY_MAX_STRING + 8) * ARRAY_MAX_SIZE
|
||||
#define ARRAY_MAX_STRING (255) // maximum length of string to be stored as array key or value
|
||||
#define ARRAY_MAX_SIZE (100000) // maximum number of array elements,
|
||||
// so total maximum memory/disk footprint of one array is: 16 + (ARRAY_MAX_STRING + 8) * ARRAY_MAX_SIZE
|
||||
|
||||
// special actions for arrays using array_resize operator
|
||||
#define ARRAY_ACTION_SORT (-2)
|
||||
#define ARRAY_ACTION_RSORT (-3)
|
||||
#define ARRAY_ACTION_REVERSE (-4)
|
||||
#define ARRAY_ACTION_SHUFFLE (-5)
|
||||
#define ARRAY_ACTION_SORT (-2)
|
||||
#define ARRAY_ACTION_RSORT (-3)
|
||||
#define ARRAY_ACTION_REVERSE (-4)
|
||||
#define ARRAY_ACTION_SHUFFLE (-5)
|
||||
|
||||
extern char get_all_arrays_special_key[];
|
||||
|
||||
// TODO: rewrite
|
||||
class sArrayElement
|
||||
@@ -27,27 +26,35 @@ public:
|
||||
float floatVal;
|
||||
char* strVal;
|
||||
};
|
||||
|
||||
sArrayElement();
|
||||
// this constructor does not copy strings (for performance), use set() for actual array elements
|
||||
sArrayElement(DWORD _val, DWORD _dataType);
|
||||
sArrayElement(const long&);
|
||||
|
||||
// free string resource from memory, has to be called manually when deleting element
|
||||
void clear();
|
||||
|
||||
// set* methods will actually COPY strings, use this when acquiring data from the scripting engine
|
||||
void setByType(DWORD val, DWORD dataType);
|
||||
|
||||
void sArrayElement::set( const sArrayElement &el )
|
||||
{
|
||||
setByType(el.intVal, el.type);
|
||||
}
|
||||
|
||||
void set(long val);
|
||||
void set(float val);
|
||||
void set(const char* val, int _len = -1);
|
||||
void unset();
|
||||
|
||||
DWORD sArrayElement::getHash() const
|
||||
{
|
||||
return getHashStatic(*(DWORD*)&intVal, type);
|
||||
}
|
||||
|
||||
DWORD static getHashStatic(DWORD value, DWORD type);
|
||||
|
||||
bool operator < (const sArrayElement &el) const;
|
||||
};
|
||||
|
||||
@@ -74,6 +81,7 @@ struct sArrayVarOld
|
||||
};
|
||||
|
||||
#define ARRAYFLAG_ASSOC (1) // is map
|
||||
#define ARRAYFLAG_CONSTVAL (2) // don't update value of key if the key exists in map
|
||||
|
||||
typedef std::tr1::unordered_map<sArrayElement, DWORD, sArrayElement_HashFunc, sArrayElement_EqualFunc> ArrayKeysMap;
|
||||
|
||||
@@ -87,13 +95,14 @@ class sArrayVar
|
||||
{
|
||||
public:
|
||||
DWORD flags;
|
||||
sArrayElement key; // array associated key, if it was saved
|
||||
sArrayElement key; // array associated key, if it was saved
|
||||
ArrayKeysMap keyHash; // key element => element index, for faster lookup
|
||||
std::vector<sArrayElement> val; // list of values or key=>value pairs (even - keys, odd - values)
|
||||
|
||||
bool isAssoc() const {
|
||||
return (flags & ARRAYFLAG_ASSOC);
|
||||
}
|
||||
|
||||
// logical array size (number of elements for normal arrays; number of key=>value pairs for associative)
|
||||
int size() const {
|
||||
return isAssoc()
|
||||
@@ -109,6 +118,7 @@ public:
|
||||
}
|
||||
|
||||
sArrayVar() : flags(0), key() {}
|
||||
|
||||
// free memory used by strings
|
||||
void clear() {
|
||||
clearRange(0);
|
||||
@@ -133,8 +143,7 @@ extern std::set<DWORD> tempArrays;
|
||||
// saved arrays: arrayKey => arrayId
|
||||
extern ArrayKeysMap savedArrays;
|
||||
|
||||
void LoadArraysOld(HANDLE h);
|
||||
void LoadArrays(HANDLE h);
|
||||
bool LoadArrays(HANDLE h);
|
||||
void SaveArrays(HANDLE h);
|
||||
int GetNumArrays();
|
||||
void GetArrays(int* arrays);
|
||||
@@ -146,32 +155,45 @@ const char* _stdcall GetSfallTypeName(DWORD dataType);
|
||||
DWORD _stdcall getSfallTypeByScriptType(DWORD varType);
|
||||
DWORD _stdcall getScriptTypeBySfallType(DWORD dataType);
|
||||
// creates new normal (persistent) array. len == -1 specifies associative array (map)
|
||||
DWORD _stdcall CreateArray(int len, DWORD nothing);
|
||||
DWORD _stdcall CreateArray(int len, DWORD flags);
|
||||
|
||||
// same as CreateArray, but creates temporary array instead (will die at the end of the frame)
|
||||
DWORD _stdcall TempArray(DWORD len, DWORD nothing);
|
||||
DWORD _stdcall TempArray(DWORD len, DWORD flags);
|
||||
|
||||
// destroys array
|
||||
void _stdcall FreeArray(DWORD id);
|
||||
|
||||
/*
|
||||
op_get_array_key can be used to iterate over all keys in associative array
|
||||
*/
|
||||
DWORD _stdcall GetArrayKey(DWORD id, int index, DWORD* resultType);
|
||||
|
||||
// get array element by index (list) or key (map)
|
||||
DWORD _stdcall GetArray(DWORD id, DWORD key, DWORD keyType, DWORD* resultType);
|
||||
|
||||
// set array element by index or key
|
||||
void _stdcall SetArray(DWORD id, DWORD key, DWORD keyType, DWORD val, DWORD valType, DWORD allowUnset);
|
||||
|
||||
// number of elements in list or pairs in map
|
||||
int _stdcall LenArray(DWORD id);
|
||||
|
||||
// change array size (only works with list)
|
||||
void _stdcall ResizeArray(DWORD id, int newlen);
|
||||
|
||||
// make temporary array persistent
|
||||
void _stdcall FixArray(DWORD id);
|
||||
|
||||
// searches for a given element in array and returns it's index (for list) or key (for map) or int(-1) if not found
|
||||
int _stdcall ScanArray(DWORD id, DWORD val, DWORD datatype, DWORD* resultType);
|
||||
|
||||
// get saved array by it's key
|
||||
DWORD _stdcall LoadArray(DWORD key, DWORD keyType);
|
||||
|
||||
// make array saved into the savegame with associated key
|
||||
void _stdcall SaveArray(DWORD key, DWORD keyType, DWORD id);
|
||||
|
||||
// return keys of all saved arrays as a temp list
|
||||
DWORD _stdcall SavedArrays();
|
||||
|
||||
// special function that powers array expressions
|
||||
DWORD _stdcall StackArray(DWORD key, DWORD keyType, DWORD val, DWORD valType);
|
||||
+5
-6
@@ -21,20 +21,21 @@
|
||||
#include "BarBoxes.h"
|
||||
#include "FalloutEngine.h"
|
||||
|
||||
static const DWORD DisplayBoxesRet1 = 0x4615A8;
|
||||
static const DWORD DisplayBoxesRet2 = 0x4615BE;
|
||||
struct sBox {
|
||||
DWORD msg;
|
||||
DWORD colour;
|
||||
void* mem;
|
||||
};
|
||||
static sBox boxes[10];
|
||||
static DWORD boxesEnabled[5];
|
||||
|
||||
static sBox boxes[10] = {0};
|
||||
static DWORD boxesEnabled[5] = {0};
|
||||
|
||||
static const DWORD bboxMemAddr[] = {
|
||||
0x461266, 0x4612AC, 0x461374, 0x4613E8, 0x461479, 0x46148C, 0x4616BB,
|
||||
};
|
||||
|
||||
static const DWORD DisplayBoxesRet1 = 0x4615A8;
|
||||
static const DWORD DisplayBoxesRet2 = 0x4615BE;
|
||||
static void __declspec(naked) DisplayBoxesHook() {
|
||||
__asm {
|
||||
mov ebx, 0;
|
||||
@@ -64,8 +65,6 @@ void BarBoxesInit() {
|
||||
SafeWrite32(0x4612FE, (DWORD)boxes + 4); //.colour
|
||||
SafeWrite32(0x46133C, (DWORD)boxes + 0); //.msg
|
||||
|
||||
memset(boxes, 0, 12 * 10);
|
||||
memset(boxesEnabled, 0, 5 * 4);
|
||||
memcpy(boxes, (void*)0x518FE8, 12 * 5);
|
||||
|
||||
for (int i = 5; i < 10; i++) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user