Compare commits

..
105 Commits
Author SHA1 Message Date
NovaRain 11dfb3e94a Added MainMenuOffsetX/Y and MainMenuCreditsOffsetX/Y settings back to ddraw.ini.
Corrected document file name in README.txt.
2016-11-08 10:25:41 +08:00
NovaRain 3668a1c94f Improved the functionality of ProcessorIdle (from Crafty) 2016-11-07 15:04:55 +08:00
NovaRain 5cb3ca2a59 Removed queue9x and vector9x.
Disabled ComputeSprayMod by default.
Updated version number.
2016-11-07 10:16:57 +08:00
phobos2077 4ef88959e3 Moved argument validation to opcodeMetaTable. Now old-style opcode and sfall_funcX scripting functions work almost identical and their handlers can be interchanged.
Fixed some bugs with sfall_funcX.
2016-11-06 17:37:25 +07:00
phobos2077 4cc9cb0b83 - Refactor opcode handling.
- Made new-style "sfall_funcX" functions compatible with old-style opcodes, this allows to use one handler function to act as both metarule and normal opcode.
- Added table of opcode meta-data.
2016-11-06 16:52:09 +07:00
phobos2077 363d7a1cc5 Rename types in function references for consistency and clarity. 2016-11-06 00:56:59 +07:00
phobos2077 d9d86e3fe4 Added macros for new scripting functions 2016-11-06 00:32:28 +07:00
phobos2077 ce1fd719cf Limit maximum string length for arrays to prevent certain strange crashes 2016-11-06 00:15:25 +07:00
phobos2077 1595d75f7c Added docs for new opcodes and scripting functions 2016-11-06 00:14:25 +07:00
phobos2077 6287eefd7c Merge branch 'feature/issue-55-metarule' into develop 2016-11-05 18:07:30 +07:00
phobos2077 3bc84a0040 Refactor: encapsulated opcode-related functions and variables into classes 2016-11-05 03:34:09 +07:00
phobos2077 18b34767b6 Added new scripting functions to show/hide/redraw main interface and to exec map_update_p_proc for all map objects #51 2016-11-05 01:17:42 +07:00
phobos2077 af4bad36d4 Added validation for null arguments #55;
Added scripting function "spatial_radius";
Added scripting function "critter_inven_obj2" #38.
2016-11-04 17:22:05 +07:00
phobos2077 1a40c40cd3 Added full definitions for metarules and automatic argument validation of with detailed error messages 2016-11-04 03:37:30 +07:00
phobos2077 9367139957 Remove condition for vsnprintf_s - always use long variant 2016-11-03 21:04:46 +07:00
phobos2077 87f45d26db Merge remote-tracking branch 'origin/feature/issue-55-metarule' into feature/issue-55-metarule 2016-11-03 20:57:09 +07:00
phobos2077 bd2f83d6a8 Refactor opcode handling;
Write metarule errors to debug.log (added reusable function);
Fixed some warnings
2016-11-03 20:55:59 +07:00
phobos2077 d29b51d5ea Implemented new way of handling sfall opcodes - now almost without any ASM code
Added bunch of engine function wrappers
2016-11-03 19:30:42 +07:00
NovaRain d276da3d68 Added VS2008 compatibility (vsnprintf_s uses 4 args by C11 standard, which is supported in VS2010 but not VS2008) 2016-11-03 14:56:32 +08:00
phobos2077 502897cb6f Fixed a nasty bug in dlog_f function that only shows when compiling w/o optimization 2016-11-03 04:43:10 +07:00
NovaRain e3739ba7aa Initialized scriptDialog pointer properly and deleted it on game exit. 2016-11-02 08:59:02 +08:00
phobos2077 02beff2b04 Implemented sfall_funcX opcodes 2016-11-02 04:10:50 +07:00
phobos2077 cf82440753 Testing implementation for universal opcode #55 2016-11-01 03:53:07 +07:00
NovaRain e78e76e35d Edited a couple of log entries.
Simplified the memory address edits of MultiPatches.
2016-10-31 15:56:19 +08:00
NovaRain 47783c802e Added a C++11 emulator for compiling with VS2008. 2016-10-26 11:38:57 +08:00
phobos2077 ce72ef51f8 Bug fix 2016-10-24 20:23:43 +07:00
phobos2077 dbc0ebd36f Do not allow to save game on Party-Controlled turn regardless of SaveInCombatFix value 2016-10-24 20:21:52 +07:00
phobos2077 db89f5760c Do not allow to use sneak when controlling party members 2016-10-24 20:16:02 +07:00
phobos2077 e864f1f961 Added DelayedExperience feature for party control 2016-10-24 19:32:05 +07:00
phobos2077 fafc4a317f Bug fixing 2016-10-24 18:38:09 +07:00
phobos2077 5d689c0641 Improve party control by temporarily changing more dude-related properties 2016-10-24 17:59:04 +07:00
phobos2077 4a65a6753f Remove some duplicated variables, use consistent naming 2016-10-24 12:49:12 +07:00
phobos2077 5dec063c1c Add more game global variable pointers to FalloutEngine 2016-10-24 12:36:02 +07:00
NovaRain dbdf414cd9 Tweaked the style of global/hook script log entries a bit. 2016-10-18 11:45:00 +08:00
NovaRain 3e2a22fad8 Fixed bugs in set*_stat_min functions that set max values instead of min.
Unified the style of global/hook script log entries.
Updated the code of "reading global/hook scripts from DAT files" with Crafty's newer code base.
2016-10-18 10:59:10 +08:00
NovaRain 13ee06dee2 Improved the 'print to file' fix and added the ability to use long filenames in dat files (from Crafty) 2016-10-17 11:58:22 +08:00
NovaRain 2d3031e583 sfall can now load global/hook scripts from dat files (from Crafty's mod) 2016-10-14 13:57:20 +08:00
NovaRain de5c12484d Added DataLoadOrderPatch option to use a modified data load order for the engine to find game data (from Crafty's mod)
Updated version number.
2016-10-11 11:58:17 +08:00
NovaRain c880ae93a9 Removed unused code in ScriptExtender.cpp and rename obj_outline_all_items_* functions slightly to prevent using the same names as game engine functions.
Minor edits on main.cpp and Bugs.cpp.
2016-10-07 10:31:46 +08:00
NovaRain 295a5d1437 Replaced NumberPatchLoop with a simple toggleable MultiPatches. Reason: While NumberPatchLoop allows even larger patch numbers, the built-in valid range of patch numbers of 000 ~ 999 is more than enough already. 2016-10-05 16:09:22 +08:00
NovaRain e726ee54ba Tweaked set_bodypart_hit_modifier function to follow the removal of BodyHit_Uncalled from ddraw.ini, e.g. setting modifier for torso (3) will also set for uncalled (8), and vice versa. 2016-10-04 10:23:17 +08:00
NovaRain 712eafc241 Now sfall loads global/hook scripts, shaders, 32-bit talking heads images, and avi movies according to the paths variables in the cfg file, instead of from the fixed "Data\".
Removed GainStatPerkFix from ddraw.ini.
Removed BodyHit_Uncalled from ddraw.ini. Now "uncalled" shares the same modifier with "torso", because separating them would result in some illogical setups.
2016-10-03 14:46:51 +08:00
NovaRain d1bf22ec8d Expanded DisableHorrigan to also skip the forced encounter check, to compatible with old saves that are not started with DisableHorrigan=1.
Changed the description of PipBoyAvailableAtGameStart=2 to be more precise.
Simplified the skipping code in PerkSetup(), because it's redundant to change two bytes that the same effect can be done with changing the conditional jump next to them.
2016-09-29 13:37:58 +08:00
NovaRain 21d496f392 Added a new setting to PipBoyAvailableAtGameStart to skip the vault suit movie check and make the PipBoy always available.
Improved the functionality of PipBoyAvailableAtGameStart (from Crafty's mod)
2016-09-26 16:05:18 +08:00
NovaRain 07948206fb Removed CarryWeightLimit option, because it can be scripted with set_stat_max function. 2016-09-21 09:33:11 +08:00
NovaRain 6a71bf086d Added a partial fix for incorrect positioning after exiting small locations (e.g. Ghost Farm) (from Crafty's mod) 2016-09-19 13:15:57 +08:00
NovaRain ec585529c8 Changed BodypartHitMod# to BodyHit_(part names) in ddraw.ini, to make them easier for users to understand. 2016-08-31 10:27:03 +08:00
NovaRain e6aad27e44 Moved ImportedProcedureFix to Bugs.cpp and added comments to it.
Added more descriptions to options in ddraw.ini, especially DebugMode,  to make things clearer and save the trouble to look up debug patch readme.
2016-08-30 13:11:06 +08:00
NovaRain f0528740a4 Removed the redundant loop in the unlimited ammo exploit fix. 2016-08-22 09:42:01 +08:00
NovaRain bfd8b38547 Merge branch 'develop', preparing for 3.7.3 release. 2016-08-15 14:54:40 +08:00
NovaRain e6086f984e Merge branch 'Vennor-feature/extra_msg'
Feature tested/verified.
2016-08-15 14:38:53 +08:00
NovaRain 2e766cd3c9 Merge branch 'feature/extra_msg' of https://github.com/Vennor/sfall into Vennor-feature/extra_msg
# Conflicts:
#	sfall/Message.cpp
#	sfall/Message.h
2016-08-15 14:38:18 +08:00
NovaRain 48f53388fd Fixed checking the horizontal position on the y-axis instead of x when setting coordinates on the world map.
Added more item flag defines in define_extra.h.
2016-08-15 10:32:53 +08:00
NovaRain 6199f95c38 Fixed incorrect death animations being used when killing critters with kill_critter_type function, e.g. ghouls die standing. (from Crafty) 2016-08-04 12:19:00 +08:00
NovaRain a6d84bd470 Fixed incorrect savegame path detection when reading/writing sfallgv.sav and sfallfs.sav under certain circumstances. (from Crafty) 2016-08-01 16:45:12 +08:00
NovaRain a11228a5ec Fixed get_screen_width/height functions not returning correct values when using older versions of hi-res patch.
Corrected the parameter for intface_update_ac_ in wield_obj_critter fix.
Update the unlimited ammo exploit fix from Crafty's mod.
Removed unnecessary engine-related defines and constants that were added since 3.7b.
2016-07-28 17:05:40 +08:00
NovaRain 7784e199af Integrated NumbersInDialogue option from Crafy's mod.
Moved NPCLevelFix to Bugs.cpp.
Used "push retn" instead of "mov jmp" for some jumps, to skip using registers (at least in logic).
Changed the displayed version number to the same as the internal version number.
2016-07-26 11:03:56 +08:00
NovaRain 53895a4af2 Added CreditsAtBottom option to display sfall built-in credits at the bottom of credits.txt contents.
Unified log message format in main.cpp and bugs.cpp.
2016-07-18 16:54:13 +08:00
phobos2077 354b938d60 Added optional function to show additional sfall credits at the bottom of CREDITS.TXT contents 2016-07-17 23:11:43 +07:00
NovaRain 643d8d3886 Added fix for destroy_p_proc not being called if the critter is killed by explosives when you leave the map.
Integrated Crafty's explosives crash fix.
Updated the link of NMA forum post in the comment.
2016-07-13 15:59:14 +08:00
NovaRain 924c35d011 Improved the unlimited ammo exploit fix to prevent crashes during map transition in RP new areas. (from Crafty)
Updated set_new_results_hack with Crafty's newer code base.
2016-07-12 09:47:26 +08:00
NovaRain 86163bf94c Changed the script procs defines in ScriptExtender.h to their real procedure names in SSL. 2016-07-06 17:15:05 +08:00
NovaRain 21b2d34432 Added some new engine-related defines and constants. 2016-06-03 09:38:31 +08:00
NovaRain 98508a9c76 Added a bug fix for incorrect initialization of action points at the beginning of each turn (from Crafty's mod)
Removed unused code in Bugs.cpp.
2016-05-27 10:37:12 +08:00
NovaRain f8b232cc09 Changed how SpeedInterfaceCounterAnims=2 works (from Crafty's mod). Now it updates the hp/ac counter instantly no matter what.
Fixed get_screen_width/height functions not returning correct values when using the windowed mode in the hi-res patch.
Added some new engine-related defines and constants.
2016-05-17 12:20:22 +08:00
NovaRain 394b4b9967 Edited the description of ExtraGameMsgFileList a bit. 2016-05-11 15:33:01 +08:00
NovaRain 1bea84eb3c Added ExtraGameMsgFileList setting to ddraw.ini, and updated message_str_game reference in sfall function notes.txt.
Added a couple of new engine-related defines.
Updated version number. (Need to consider changing to semantic versioning for 3.8.)
2016-05-10 17:18:31 +08:00
NovaRain 26159138e0 Removed the duplicated include from HeroAppearance.cpp. 2016-05-10 12:48:17 +08:00
NovaRain 1883009930 Cleaned up some artifacts in codes. 2016-05-10 12:42:34 +08:00
NovaRain f1289c1e7d Merge branch 'feature/extra_msg' of https://github.com/Vennor/sfall into Vennor-feature/extra_msg
# Conflicts:
#	sfall/Message.cpp
#	sfall/Message.h
2016-05-10 12:33:44 +08:00
Vennor c3e4894243 Moved opening brace to the same line as the function prototype. 2016-05-09 19:34:07 +02:00
Vennor 2330dd97bb Refactored op_message_str_game2 function to always return a valid string value. Now an "Error" string will be returned on error instead of an uninitialized char pointer or an integer value. 2016-05-09 19:10:25 +02:00
Vennor 90b718122d Added string header inclusion to Message.cpp. 2016-05-08 20:15:37 +02:00
Vennor 5ca7ed0dc5 - Renamed ClearExtraGameMsgFiles function to ClearReadExtraGameMsgFiles.
- Moved ClearReadExtraGameMsgFiles function to Message.cpp.
- Added map clearing to ClearReadExtraGameMsgFiles.
- Changed formatting.
2016-05-08 20:13:13 +02:00
Vennor 9bd03bfb76 Changed std::unordered_map to std::tr1::unordered_map for compatibility with older compilers. 2016-05-08 20:09:56 +02:00
Vennor 07b7e270b8 - Encapsulated and moved ReadExtraGameMsgFiles function call from NewGame2 to MainMenu. 2016-05-08 16:11:51 +02:00
Vennor f9dbbcdca2 - Tidied up extra game message getter a bit.
- Removed unnecessary function call.
2016-05-08 15:53:05 +02:00
NovaRain fcdb5633d4 Edited the description of InstantWeaponEquip a bit. 2016-04-21 09:21:12 +08:00
NovaRain 4e2bfd6b08 Some minor document edits: fixing typos, removing double/trailing spaces, unifying space/tab usages, and lining up some lines. 2016-04-20 10:20:05 +08:00
NovaRain 8c0fab1f6b Added an example mod of hs_keypress. 2016-04-19 17:18:26 +08:00
NovaRain 05f15f0262 Removed incorrect information from sfall function notes.
Edited the description in ddraw.ini with less self-advertising.
Added a few new engine-related defines and constants.
2016-04-18 10:28:12 +08:00
NovaRain 147cb50a66 Moved existing msg file reading functions and structs from HeroAppearance.cpp to a dedicated Message.h/.cpp file pair, for preparing to merge with Vennor's new feature.
Enabled ComputeSprayMod by default (reason: more reasonable bullet distribution than vanilla logic, even with default ratios.)
Fixed a minor typo in sfall function list document.
2016-04-07 12:04:24 +08:00
Vennor b8968c5334 - Added extra msg file reading based on names given in ddraw.ini.
- Added fetching strings from extra msg files.
2016-04-02 18:43:52 +02:00
Vennor 4f6b68ca93 - Moved existing msg file reading functions and structs from HeroAppearance.cpp to a dedicated Message.h/.cpp file pair.
- Added extern map to hold read extra msg files.
2016-04-02 18:41:59 +02:00
NovaRain 0ff6157b42 Added a few new engine-related defines and constants. 2016-03-31 09:43:15 +08:00
NovaRain 2bbb92420f Simplified the code of inventory drag and drop fix a bit (from Crafty's mod)
Added a few new engine-related defines and constants.
Updated credits.
2016-03-28 11:21:43 +08:00
phobos2077 4678f41b5a Merge remote-tracking branch 'origin/master' into develop 2016-03-26 23:59:41 +07:00
Vlad 7439ba2634 Merge pull request #40 from Oppen/master
Precompute CRC table.
2016-03-26 23:58:23 +07:00
Mario J. Rugiero 4c047bf8a3 Precompute CRC table. 2016-03-26 12:20:09 -03:00
NovaRain 694b699f15 Changed the order of script array element data removal from C++ containers. Without this std::unordered_map's keys were modified before erasure which lead to undefined behavior.
(cherry picked from commit bdffc061d3)

Added keyHash map clearing after each for loop pass. Without this arrays could load hashed indices of elements they don't actually contain, which in turn could lead to crashes if certain conditions are met.

(cherry picked from commit 25094253e5)

Updated credits.
2016-03-25 09:51:18 +08:00
Vlad 25b408816a Merge pull request #39 from Vennor/master
Script array fixes
2016-03-25 01:12:39 +07:00
phobos2077 b819423d2a added check for invalid array index in GetArray() 2016-03-25 01:10:56 +07:00
NovaRain 720f937b4f Integrated Crafty's updated fix to prevent the game with old (pre-3.0) versions of f2_res from crashing/hanging while trying to use drag&drop to reload weapons in the inventory list.
Added a few new engine-related defines and constants.
2016-03-21 11:58:56 +08:00
Vennor 25094253e5 Added keyHash map clearing after each for loop pass. Without this arrays could load hashed indices of elements they don't actually contain, which in turn could lead to crashes if certain conditions are met. 2016-03-12 17:08:15 +01:00
Vennor bdffc061d3 Changed the order of script array element data removal from C++ containers. Without this std::unordered_map's keys were modified before erasure which lead to undefined behavior. 2016-03-12 17:05:20 +01:00
NovaRain dfe4b6b2e0 Re-added CarChargingFix option back in ddraw.ini for other mods with custom vehicles. 2016-03-11 11:32:24 +08:00
phobos2077 972d978882 #37 fixed sfall_ver_* functions 2016-03-08 22:21:32 +07:00
NovaRain e99cca2b87 Added a few new engine-related defines and constants. 2016-03-07 11:41:04 +08:00
NovaRain 108719ac83 Added rounding calculation to ComputeSprayMod to give roundsCenter & roundsMainTarget some advantages.
Added CarryWeightLimit option for changing the carry weight limit. (max value: 2^31 − 1, probably an overkill.)
2016-03-07 11:29:26 +08:00
NovaRain 6feda61424 Added a check for old (pre-3.0) versions of f2_res to prevent the game from crashing/hanging while trying to use drag&drop to reload weapons in the inventory list. 2016-02-26 11:13:58 +08:00
NovaRain 19c94b8513 Simplified the code of Haenlomal's MultiHexFix a bit. 2016-02-24 09:47:26 +08:00
NovaRain af7b5cbb6b Condensed a few block of code in main.cpp with constant arrays, also made the DLL a bit smaller in size.
Added new engine-related defines and constants.
2016-02-19 11:08:00 +08:00
NovaRain 56009e1634 Moved the code of MultiHexFix to Bugs.cpp, and removed it from ddraw.ini.
Optimized AnimationsAtOnceLimit.cpp using Crafty's method, which made the DLL about 10KB less in size.
2016-02-18 15:25:56 +08:00
NovaRain 7bd3bd4128 Integrated InstantWeaponEquip option from Crafty's mod.
Added PipboyTimeAnimDelay option to allow player to control the speed of pipboy alarm clock animations in certain degree.
2016-02-16 16:44:24 +08:00
NovaRain 696be7fac5 Integrated the expanded SpeedInterfaceCounterAnims from Crafty's mod.
Added new engine-related defines and constants.
2016-02-15 13:13:31 +08:00
61 changed files with 3706 additions and 1999 deletions
+66 -28
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v3.7a
;v3.8
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -201,9 +201,14 @@ WorldMapSlots=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.
;If you want to load multiple patch files at once, uncomment the NumberPatchLoop line and set it to the number of files to check for
;If you want to load multiple patch files (up to 1000) at once, uncomment the MultiPatches line and set it to 1
;PatchFile=patch%03d.dat
;NumberPatchLoop=100
;MultiPatches=0
;Set to 1 to enable the modified data load order for the engine to find game data
;Original: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat
;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
DataLoadOrderPatch=0
;To change the default and starting player models, uncomment the next four lines.
;The default models can also be changed ingame via script
@@ -247,6 +252,7 @@ Movie17=credits.mve
;PerksFile=Perks.ini
;Set to 1 if you want the pipboy to be available at the start of the game
;Set to 2 to make the pipboy available by only skipping the vault suit movie check
PipBoyAvailableAtGameStart=0
;Set to 1 to double the number of available kill types
@@ -290,9 +296,6 @@ SingleCore=1
;Set to 1 to override the art_chache_size setting in fallout2.cfg
OverrideArtCacheSize=0
;Set to 1 to fix issues with the GainXXX perks not giving all the bonuses that they should
GainStatPerkFix=1
;Prevents you from saving in combat except at the start of your turn to avoid a few bugs
;Note that even with this option enabled, it is still not advisable to save in combat at all.
;Set to 2 to block all saving in combat
@@ -301,7 +304,7 @@ SaveInCombatFix=1
;Point at an ini file containing elevator data
;ElevatorsFile=Elevators.ini
;Uncomment and set to a comma delimited list of numbers to use a custom xp table.
;Uncomment and set a comma delimited list of numbers to use a custom xp table.
;Players level is capped once the highest specified level is reached
;XPTable=50,100,200
@@ -311,15 +314,14 @@ SaveInCombatFix=1
AdditionalWeaponAnims=1
;Uncomment these lines to modify the default modifiers for aimed shots at specific bodyparts
;BodypartHitMod0=-40
;BodypartHitMod1=-30
;BodypartHitMod2=-30
;BodypartHitMod3=0
;BodypartHitMod4=-20
;BodypartHitMod5=-20
;BodypartHitMod6=-60
;BodypartHitMod7=-30
;BodypartHitMod8=0
;BodyHit_Head=-40
;BodyHit_Left_Arm=-30
;BodyHit_Right_Arm=-30
;BodyHit_Torso=0
;BodyHit_Right_Leg=-20
;BodyHit_Left_Leg=-20
;BodyHit_Eyes=-60
;BodyHit_Groin=-30
;Set to 1 to use a CriticalOverrides.ini file to override the default critical table
;Set to 2 to use the default critical with bug fixes (doesn't require an ini)
@@ -343,7 +345,7 @@ CorpseLineOfFireFix=0
;Set a number of milliseconds to idle each input loop
;Set to -1 to disable
;Set to 0 to idle only if other processes are waiting for processor time
;Set to 1 (or some higher number if needed) to prevent 100% cpu use
;Set to 1 (or some higher number if needed, the maximum is 127) to prevent 100% cpu use
ProcessorIdle=-1
;Set to 1 if using the hero appearance mod
@@ -395,6 +397,7 @@ UseScrollingQuestsList=1
ExtraSaveSlots=0
;Set to 1 to speed up the hp/ac counter animations
;Set to 2 to update the hp/ac counters instantly
SpeedInterfaceCounterAnims=0
;These lines allow you to control the karma frm's displayed on the character screen
@@ -419,7 +422,7 @@ BonusHtHDamageFix=1
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
DisplayBonusDamage=0
;Modify the maximum number of animations allowed to run on a map. (Default is 32)
;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127)
AnimationsAtOnceLimit=120
;Set to 1 to remove the limits that stop the player rolling critical successes/misses in the first few days of game time
@@ -428,9 +431,6 @@ RemoveCriticalTimelimits=0
;Set to 1 to enable party members with level 6 protos to reach level 6
NPCStage6Fix=0
;Set to 1 to fix the problem with melee weapon equiped npcs being unable to attack multi-hex critters
MultiHexPathingFix=1
;Change the colour of the font used on the main menu for the Fallout/sfall version number
;It's the last byte ('3c' by default,) that picks the colour used. The first byte supplies additional flags
;MainMenuFontColour=0x0600003c
@@ -472,6 +472,12 @@ EncounterTableSize=0
;Set to 1 to disable the pipboy alarm button
DisablePipboyAlarm=0
;Uncomment the next four lines to move the main menu buttons and credit text (the 'Copyright(c)' line on the main menu)
;MainMenuOffsetX=0
;MainMenuOffsetY=0
;MainMenuCreditsOffsetX=0
;MainMenuCreditsOffsetY=0
;Prevents you from using super stims on a critter who is at full health.
SuperStimExploitFix=0
@@ -482,13 +488,15 @@ QuickPocketsApCostReduction=2
;Set to 1 to allow objects seeing through other objects with their ShootThru flag set
ObjCanSeeObj_ShootThru_Fix=0
;These options change the bullet distribution of burst attacks
;All the bullets are divided into three groups: central, left and right. These three groups will then travel along three parallel tracks, trying to hit targets on the way
;Set the mod to 1 to enable the next four lines
;Set to 1 to enable the balanced bullet distribution formula for burst attacks
ComputeSprayMod=0
;These options modify the bullet distribution of burst attacks if ComputeSprayMod is 1
;All the bullets are divided into three groups: central, left and right
;These three groups will then travel along three parallel tracks, trying to hit targets on the way
;CenterMult/Div set the ratio of how many bullets go to the central group, and remaining bullets are divided equally to left and right sides
;TargetMult/Div set the ratio of how many bullets in the central group will attack the primary target directly
;Multipliers are capped at divisor values.
ComputeSprayMod=0
;Multipliers are capped at divisor values
ComputeSpray_CenterMult=1
ComputeSpray_CenterDiv=3
ComputeSpray_TargetMult=1
@@ -524,12 +532,14 @@ CheckWeaponAmmoCost=0
CombatPanelAnimDelay=1000
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
DialogPanelAnimDelay=33
;Controls the speed of pipboy alarm clock animations (lower - faster; valid range: 0..127)
PipboyTimeAnimDelay=50
;Allows you to directly control other critters in combat
;Set to 0 to disable
;Set to 1 to control all critters in combat
;Set to 2 to control all party members
;If you want to control only specific critters, uncomment the ControlCombatPIDList line and set it to a comma delimited list of PIDs
;If you want to control only specific critters, uncomment the ControlCombatPIDList line and set a comma delimited list of PIDs
ControlCombat=0
;ControlCombatPIDList=62,89,97,107,160,161
@@ -552,6 +562,22 @@ EnableMusicInDialogue=0
;Set to 1 to fix the bug that unable to sell used geiger counters or stealth boys
CanSellUsedGeiger=1
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenary/critters
CarChargingFix=1
;Set to 1 to skip weapon equip/unequip animations when performing various actions
InstantWeaponEquip=0
;To add additional game msg files, uncomment the next line and set a comma delimited list of filenames without .msg extension
;You need to use the message_str_game script function to get messages from the files
;ExtraGameMsgFileList=
;Set to 1 to display numbered dialogue options
NumbersInDialogue=0
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging]
;Extra sfall configuration settings that can be used by modders
@@ -560,8 +586,20 @@ CanSellUsedGeiger=1
;Set to 1 to enable sfall debugging mode
Enable=0
;Fallout 2 Debug Patch
;Set to 1 to enable debugging output to screen or 2 to create a debug.log file
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg
;-------
;[debug]
;mode=environment
;output_map_data_info=1
;show_load_info=1
;show_script_messages=1
;show_tile_num=1
;[sound]
;debug=1
;debug_sfxc=1
;-------
DebugMode=0
;Change to 1 to skip the compatibility mode check
@@ -581,7 +619,7 @@ 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
;These options control what output is saved in the debug log
;These options control what output is saved in the debug log (sfall-log.txt)
;Prints messages duing sfall initialization
Init=0
Binary file not shown.
@@ -0,0 +1,16 @@
procedure start;
#include ".\HEADERS\dik.h"
procedure start begin
variable event, keyDX;
if not init_hook then begin
event := get_sfall_arg;
keyDX := get_sfall_arg;
if ((event == 1) and (keyDX == DIK_SEMICOLON)) then begin
tap_key(DIK_CAPITAL);
tap_key(DIK_A);
tap_key(DIK_CAPITAL);
end
end
end
@@ -0,0 +1,9 @@
"Take All" Hotkey mod for Fallout 2 by NovaRain
----------------------------------------
- makes pressing the semicolon key send an uppercase A after a semicolon.
- the uppercase A (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen.
To use, copy hs_keypress.int file to your scripts folder.
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
+1 -1
View File
@@ -6,7 +6,7 @@ This folder contains documentation about sfall scripting extensions.
dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS
sfall function notes.txt - incomplete reference for new opcodes
sfall function list.txt - list of all sfall opcodes (w/o descriptions)
sfall opcode list.txt - list of all sfall opcodes (w/o descriptions)
hookscripts.txt - detailed manual for using hook scripts to modify engine behavior
arrays.txt - manual for sfall arrays
+40 -21
View File
@@ -2,16 +2,6 @@
#ifndef DEFINE_EXTRA_H
#define DEFINE_EXTRA_H
#define ATTACK_MODE_NONE 0
#define ATTACK_MODE_PUNCH 1
#define ATTACK_MODE_KICK 2
#define ATTACK_MODE_SWING 3
#define ATTACK_MODE_THRUST 4
#define ATTACK_MODE_THROW 5
#define ATTACK_MODE_SINGLE 6
#define ATTACK_MODE_BURST 7
#define ATTACK_MODE_FLAME 8
#define OBJ_TYPE_ITEM (0)
#define OBJ_TYPE_CRITTER (1)
#define OBJ_TYPE_SCENERY (2)
@@ -20,18 +10,47 @@
#define OBJ_TYPE_MISC (5)
#define OBJ_TYPE_SPATIAL (6)
/* Item Common Flags */
#define HIDDEN_ITEM 134217728 // 0x08000000 - Hidden Item
#define ITEM_ACTION_USE 2048 // 0x00000800 - Use (can be used)
#define ITEM_ACTION_USEON 4096 // 0x00001000 - Use On Smth (can be used on anything)
#define ITEM_ACTION_PICKUP 32768 // 0x00008000 - PickUp
#define WEAPON_BIGGUN 256 // 0x00000100 - Big Gun
#define WEAPON_2HAND 512 // 0x00000200 - 2Hnd (weapon is two-handed)
#define ATKMODE_PRI_NONE 0
#define ATKMODE_PRI_PUNCH 1
#define ATKMODE_PRI_KICK 2
#define ATKMODE_PRI_SWING 3
#define ATKMODE_PRI_THRUST 4
#define ATKMODE_PRI_THROW 5
#define ATKMODE_PRI_SINGLE 6
#define ATKMODE_PRI_BURST 7
#define ATKMODE_PRI_FLAME 8
#define ATKMODE_SEC_NONE 0
#define ATKMODE_SEC_PUNCH 16 // 0x00000010
#define ATKMODE_SEC_KICK 32 // 0x00000020
#define ATKMODE_SEC_SWING 48 // 0x00000030
#define ATKMODE_SEC_THRUST 64 // 0x00000040
#define ATKMODE_SEC_THROW 80 // 0x00000050
#define ATKMODE_SEC_SINGLE 96 // 0x00000060
#define ATKMODE_SEC_BURST 112 // 0x00000070
#define ATKMODE_SEC_FLAME 128 // 0x00000080
/* Critter Flags */
#define CFLG_BARTER 2 //0x00000002 - Barter (can trade with)
#define CFLG_NOSTEAL 32 //0x00000020 - Steal (cannot steal from)
#define CFLG_NODROP 64 //0x00000040 - Drop (doesn't drop items)
#define CFLG_NOLIMBS 128 //0x00000080 - Limbs (cannot lose limbs)
#define CFLG_NOAGES 256 //0x00000100 - Ages (dead body does not disappear)
#define CFLG_NOHEAL 512 //0x00000200 - Heal (damage is not cured with time)
#define CFLG_INVULN 1024 //0x00000400 - Invulnerable (cannot be hurt)
#define CFLG_FLATTN 2048 //0x00000800 - Flatten (leaves no dead body)
#define CFLG_SPECIAL 4096 //0x00001000 - Special (there is a special type of death)
#define CFLG_RANGED 8192 //0x00002000 - Range (melee attack is possible at a distance)
#define CFLG_NOKNOCKDOWN 16384 //0x00004000 - Knock (cannot be knocked down)
#define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with)
#define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot steal from)
#define CFLG_NODROP 64 // 0x00000040 - Drop (doesn't drop items)
#define CFLG_NOLIMBS 128 // 0x00000080 - Limbs (cannot lose limbs)
#define CFLG_NOAGES 256 // 0x00000100 - Ages (dead body does not disappear)
#define CFLG_NOHEAL 512 // 0x00000200 - Heal (damage is not cured with time)
#define CFLG_INVULN 1024 // 0x00000400 - Invulnerable (cannot be hurt)
#define CFLG_FLATTN 2048 // 0x00000800 - Flatten (leaves no dead body)
#define CFLG_SPECIAL 4096 // 0x00001000 - Special (there is a special type of death)
#define CFLG_RANGED 8192 // 0x00002000 - Range (melee attack is possible at a distance)
#define CFLG_NOKNOCKDOWN 16384 // 0x00004000 - Knock (cannot be knocked down)
//remove inven obj defines
#define RMOBJ_CONSUME_DRUG 4666772
+18 -18
View File
@@ -1,7 +1,7 @@
#ifndef H_DIK
#define H_DIK
// Listed are keyboard scan code constants (in decimal), taken from dinput.h
// Listed are keyboard scan code constants (in decimal), taken from dinput.h
#define DIK_ESCAPE 1
#define DIK_1 2
@@ -14,9 +14,9 @@
#define DIK_8 9
#define DIK_9 10
#define DIK_0 11
#define DIK_MINUS 12 /* - on main keyboard */
#define DIK_MINUS 12 /* - on main keyboard */
#define DIK_EQUALS 13
#define DIK_BACK 14 /* backspace */
#define DIK_BACK 14 /* backspace */
#define DIK_TAB 15
#define DIK_Q 16
#define DIK_W 17
@@ -116,20 +116,20 @@
#define DIK_RWIN 0xDC /* Right Windows key */
#define DIK_APPS 0xDD /* AppMenu key */
#define DIK_BACKSPACE DIK_BACK /* backspace */
#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
#define DIK_LALT DIK_LMENU /* left Alt */
#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
#define DIK_RALT DIK_RMENU /* right Alt */
#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
#define DIK_BACKSPACE DIK_BACK /* backspace */
#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
#define DIK_LALT DIK_LMENU /* left Alt */
#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
#define DIK_RALT DIK_RMENU /* right Alt */
#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
#endif
+31 -22
View File
@@ -16,32 +16,32 @@
#define SKILLDEX (0x4000)
//Valid arguments to register_hook
#define HOOK_TOHIT (0)
#define HOOK_AFTERHITROLL (1)
#define HOOK_CALCAPCOST (2)
#define HOOK_DEATHANIM1 (3)
#define HOOK_DEATHANIM2 (4)
#define HOOK_COMBATDAMAGE (5)
#define HOOK_ONDEATH (6)
#define HOOK_FINDTARGET (7)
#define HOOK_USEOBJON (8)
#define HOOK_REMOVEINVENOBJ (9)
#define HOOK_BARTERPRICE (10)
#define HOOK_MOVECOST (11)
#define HOOK_HEXMOVEBLOCKING (12)
#define HOOK_HEXAIBLOCKING (13)
#define HOOK_TOHIT (0)
#define HOOK_AFTERHITROLL (1)
#define HOOK_CALCAPCOST (2)
#define HOOK_DEATHANIM1 (3)
#define HOOK_DEATHANIM2 (4)
#define HOOK_COMBATDAMAGE (5)
#define HOOK_ONDEATH (6)
#define HOOK_FINDTARGET (7)
#define HOOK_USEOBJON (8)
#define HOOK_REMOVEINVENOBJ (9)
#define HOOK_BARTERPRICE (10)
#define HOOK_MOVECOST (11)
#define HOOK_HEXMOVEBLOCKING (12)
#define HOOK_HEXAIBLOCKING (13)
#define HOOK_HEXSHOOTBLOCKING (14)
#define HOOK_HEXSIGHTBLOCKING (15)
#define HOOK_ITEMDAMAGE (16)
#define HOOK_AMMOCOST (17)
#define HOOK_USEOBJ (18)
#define HOOK_KEYPRESS (19)
#define HOOK_MOUSECLICK (20)
#define HOOK_USESKILL (21)
#define HOOK_STEAL (22)
#define HOOK_ITEMDAMAGE (16)
#define HOOK_AMMOCOST (17)
#define HOOK_USEOBJ (18)
#define HOOK_KEYPRESS (19)
#define HOOK_MOUSECLICK (20)
#define HOOK_USESKILL (21)
#define HOOK_STEAL (22)
#define HOOK_WITHINPERCEPTION (23)
#define HOOK_INVENTORYMOVE (24)
#define HOOK_INVENWIELD (25)
#define HOOK_INVENWIELD (25)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
@@ -187,3 +187,12 @@
#define party_member_list_critters party_member_list(0)
#define party_member_list_all party_member_list(1)
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
#define intface_redraw sfall_func0("intface_redraw")
#define intface_hide sfall_func0("intface_hide")
#define intface_show sfall_func0("intface_show")
#define intface_is_hidden sfall_func0("intface_is_hidden")
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
+1 -1
View File
@@ -390,7 +390,7 @@ What you can do:
- add AP costs for all inventory movement including reloading
- apply or remove some special scripted effects depending on PC's armor
int arg1 - Target slot (0 - main backback, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo)
int arg1 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo)
Item arg2 - Item being moved
Item arg3 - Item being replaced or weapon being reloaded (can be 0)
+118 -65
View File
@@ -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 it's 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 setup the font colours in ddraw.ini if you're going to use custom boxes.
@@ -62,7 +62,7 @@ nb_* functions are reserved for the brotherhood tactical training mod, and shoul
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 seperator. 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.
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, and is equal to the file offset minus 12. Changes are not stored on disc, and are not permenent. If you modify the protos, and then fallout subsequently reloads the file your changes will be lost.
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 permenent. If you modify the protos, and then fallout subsequently reloads the file your changes will be lost.
the list_xxx functions can be used to loop over all items on a map. list_begin takes an argument telling sfall what you want to list. (Defined in sfall.h) It returns a list pointer, which you iterate through with list_next. Finally, when you've finished with the list use list_end on it. Not calling list_end will result in a memory leak. Alternatively, use list_as_array to get the whole list at once as a temp array variable, which can be looped over using len_array and which you don't need to remember to free afterwards.
@@ -77,48 +77,64 @@ force_aimed_shots and disable_aimed_shots allow overriding the normal rules rega
get/set_critter_skill_points will get/set the number of additional points a critter has in a skill, on top of whatever they have from their stats and other bonuses. Note that skill points are part of the proto, so calling set_skill_points on a critter will affect all critters that share the same proto.
------------------------------
------ TYPES REFERENCE -------
------------------------------
> Data types mentioned in this document:
void - means opcode does not return any value
any - any type
int - integer number
float - floating point number
string - string (text) value
object - pointer to game object (actually an integer)
array - array ID to be used with array-related functions (actually an integer)
----------------------------------------------
------ FUNCTION REFERENCE (incomplete) -------
----------------------------------------------
> int game_loaded()
> 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.
> 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.
> 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.
> int get_npc_level(string npc)
- also takes the npc name as an argument, and returns the npc's current level. Again, the npc needs to be in your party.
> int get_ini_setting(string setting)
- reads an integer value from an ini file in the fallout directory.
- It only takes a single argument; seperate the file name, section and key with a '|' character; e.g. 'myvar:=get_ini_setting("myini.ini|mysec|var1")' If the file or key cannot be found, -1 is returned.
- The file name is limited to 16 chars, including the extension.
- The section name is limited to 8 characters.
> int get_ini_setting(string setting)
- reads an integer value from an ini file in the fallout directory.
- It only takes a single argument; seperate the file name, section and key with a '|' character; e.g. 'myvar:=get_ini_setting("myini.ini|mysec|var1")' If the file or key cannot be found, -1 is returned.
- The file name is limited to 16 chars, including the extension.
- The section name is limited to 8 characters.
- It can also be used to get sfalls settings, by using ddraw.ini as the file name.
> string get_ini_string(string setting)
- reads a string value from an ini file in the fallout directory.
- reads a string value from an ini file in the fallout directory.
> int get_game_mode()
- is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in.
- is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in.
- These flags are the same as those used in the set_shader_mode function.
> int get_uptime()
- is just a wrapper around the windows GetTickCount() function. It's useful for making time fade effects in shaders, since they already have access to the current tick count.
> boolean in_world_map()
- returns 1 if the player is looking at the world map, or 0 at any other time.
> boolean in_world_map()
- returns 1 if the player is looking at the world map, or 0 at any other time.
- Obviously this is only useful in global scripts, since normal scripts will never get the chance to run on the world map.
> void force_encounter(int map)
- can be called either from a global script while traveling on the world map, or from a normal script while on a local map.
> void force_encounter(int map)
- can be called either from a global script while traveling on the world map, or from a normal script while on a local map.
- In either case the encounter occurs shortly after the next time the player moves on the world map.
- The player will not get an outdoorsman skill check.
> void force_encounter_with_flags(int map, int flags)
- does the same thing as force_encounter, but allows the specification of some extra options.
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
- does the same thing as force_encounter, but allows the specification of some extra options.
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
> int get_light_level()
@@ -129,40 +145,40 @@ get/set_critter_skill_points will get/set the number of additional points a crit
- adjusts how fast time passes while you're on the world map. It takes a single float as an argument, where 1 is the normal speed.
- This function works in addition to the WorldMapTimeMod setting in ddraw.ini and the pathfinder perk, rather than overriding it, so calling set_map_time_multi(0.5) when the player has 2 levels of pathfinder would result in time passing at 25% the normal speed on the world map.
> void remove_script(objptr)
- accepts a pointer to an object and will remove the script from that object.
> void remove_script(object)
- accepts a pointer to an object and will remove the script from that object.
> void set_script(objptr, int scriptid)
> void set_script(object, int scriptid)
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6)
- If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided.
- if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run.
> int get_script(objptr)
- accepts a pointer to an object and returns it's scriptID (line number in scripts.lst), or -1 if the object is unscripted.
> int get_script(object)
- accepts a pointer to an object and returns it's scriptID (line number in scripts.lst), or -1 if the object is unscripted.
> void set_self(int obj)
- 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;
> void set_self(int obj)
- 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
- source_obj, target_obj, and similar functions will not work if preceeded by "set_self"
> 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 recieves when they level up.
- This is a modification of what would otherwise happen, rather than a replacement.
- accepts a value of between -100 and 100, and modifies the number of skill points the player recieves when they level up.
- This is a modification of what would otherwise happen, rather than a replacement.
- The value is not saved into the save game, so should be reset in the game_loaded section of a script.
> void seq_perk_freq(int x)
- sets the number of levels between each perk.
- Setting 0 will reset it back to the default.
- This overrides the effects of the skilled trait.
- It is not saved into the save game, so needs to be called once per reload.
- sets the number of levels between each perk.
- Setting 0 will reset it back to the default.
- This overrides the effects of the skilled trait.
- It is not saved into the save game, so needs to be called once per reload.
- Be careful not to let the player obtain a perk when no perks are available to pick, or the game may crash.
> ObjectPtr get_last_target(objptr)
- will return the last critter to be deliberately attacked
> ObjectPtr get_last_attacker(objptr)
- will return the last critter to deliberately launch an attack against the argument critter.
> object get_last_target(object)
- will return the last critter to be deliberately attacked
> object get_last_attacker(object)
- will return the last critter to deliberately launch an attack against the argument critter.
- If a critter has not launched/recieved an attack, it will return 0. This is only stored for the duration of combat, and outside of combat both functions will always return 0.
> void set_base_pickpocket_mod(int max, int mod)
@@ -170,46 +186,46 @@ get/set_critter_skill_points will get/set the number of additional points a crit
- "max" will replace 95% success chance cap (so you can set 100% maximum chance, for instance)
- "mod" will add this much percent to each success chance. for example if your chance is 50% and "mod" is 20, you will get 70% actual success rate
> void set_critter_pickpocket_mod(CritterPtr, int max, int mod)
> void set_critter_pickpocket_mod(object, int max, int mod)
- the same as above, but applies only to specific critter
> void reg_anim_combat_check
> void reg_anim_combat_check
- allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before "reg_anim_begin" - "reg_anim_end" block.
Some additional reg_anim_* functions were introduced. They all work in the same convention as vanilla functions and use the same underlying code.
> void reg_anim_destroy(object)
Some additional reg_anim_* functions were introduced. They all work in the same convention as vanilla functions and use the same underlying code.
> void reg_anim_destroy(object)
- given object is destroyed at the end of current animation set
> void reg_anim_animate_and_hide(object, animID, delay)
> void reg_anim_animate_and_hide(object, animID, delay)
- exactly like "reg_anim_animate" but the object will automatically disappear after the last animation frame (but not destroyed)
> void reg_anim_light(object, light, delay)
> void reg_anim_light(object, light, delay)
- change light of any object. light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF).
> void reg_anim_change_fid(object, fid, delay)
> void reg_anim_change_fid(object, fid, delay)
- should work like art_change_fid_num but in reg_anim sequence
> void reg_anim_take_out(object, holdFrameID, delay)
> void reg_anim_take_out(object, holdFrameID, delay)
- plays "take out weapon" animation for given holdFrameID. It is not required to have such weapon in critter's inventory.
> void reg_anim_turn_towards(object, tile/target, delay)
> void reg_anim_turn_towards(object, tile/target, delay)
- makes object change it's direction to face given tile num or target object.
> int metarule2_explosions(int arg1, int arg2)
was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h:
> void set_attack_explosion_pattern(x, y)
> void set_attack_explosion_pattern(x, y)
- 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)
> 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.
> void set_attack_explosion_radius(x)
> 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
> 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 recieve fire damage.
@@ -219,20 +235,20 @@ Some utility/math functions are available:
- takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters.
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
> string substr(string, start, length)
> string substr(string, start, length)
- cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te")
> int strlen(char* string)
> int strlen(string string)
- returns string length
> string sprintf(char* format, any value)
- formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
> string sprintf(string format, any value)
- formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
- can be used to get character by ASCII code ("%c")
> int typeof(any value)
> int typeof(any value)
- returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR.
> int charcode(char* string)
> int charcode(string string)
- returns ASCII code for the first character in given string
> ^ operator (exponentiation)
@@ -276,7 +292,8 @@ Some utility/math functions are available:
> string message_str_game(int fileId, int messageId)
- works exactly the same as message_str, except you get messages from files in "text/english/game" folder
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
- Additional game msg files added by ExtraGameMsgFileList setting will have consecutive fileIds assigned beginning from 0x2000. (e.g. if you set ExtraGameMsgFileList=foo,bar in ddraw.ini, foo.msg will be associated with 0x2000 and bar.msg with 0x2001.)
> int sneak_success
- returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise
@@ -285,12 +302,12 @@ Some utility/math functions are available:
> int tile_light(int elevation, int tileNum)
- returns light intensity at the given tile in range from 0 to 65535
> ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)
> 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)
- if path is clear (no blocker was encountered by selected function) - returns 0
- objFrom is always excluded from calculations, but is required to be a valid object
> ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType)
> object obj_blocking_tile(int tileNum, int elevation, int blockingType)
- returns first object blocking given tile using given blocking function or 0 if tile is clear
> array tile_get_objs(int tileNum, int elevation)
@@ -300,22 +317,58 @@ Some utility/math functions are available:
> array party_member_list(int includeHidden)
- returns array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)
> array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType)
> array path_find_to(object objFrom, int tileTo, int blockingType)
- returns the shortest path to a given tile using given blocking function as an array of tile directions (0..5) to move on each step
- array length equals to a number of steps
- empty array means that specified target cannot be reached
> ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius)
> object create_spatial(int scriptID, int tile, int elevation, int radius)
- creates new spatial script with given SID, at given tile, and radius
> int art_exists(int artFID)
- checks if given artFID exists in the game
- useful when you want to check if critter can use specific weapon: art_exists((artFid bwand 0xffff0fff) bwor (weaponAnim * 0x1000))
> int obj_is_carrying_obj(ObjectPtr invenObj, ObjectPtr itemObj)
> int obj_is_carrying_obj(object invenObj, object itemObj)
- returns number of itemObj inside invenObj's inventory, note that both arguments are object pointers
- useful when dealing with different stacks of same item (obj_is_carrying_obj_pid just returns total for all stacks of the same PID)
> any sfall_funcX(string funcName, ...)
- these opcodes allows to use additional scripting functions, that do not require new opcode
- first argument is always function name (string)
- there are 7 versions of this opcode for different number of additional arguments (for convenience)
- opcodes have return value, but it is not neccessary to use it
------------------------------------
------ sfall_funcX functions -------
------------------------------------
> array sfall_func0("get_metarule_table")
- returns names of all currently available scripting functions (via sfall_funcX)
> int sfall_func1("spatial_radius", object object)
- return radius of spatial script, associated with given dummy-object (returned by create_spatial)
> object sfall_func2("critter_inven_obj2", object invenObj, int type)
- works just like vanilla critter_inven_obj, but correctly reports item in player's inactive hand slot
> void sfall_func0("intface_redraw")
- redraws main game interface
- useful after direct changes to current player weapons or stats to reflect changes
> void sfall_func0("intface_hide")
- hides main interface
> void sfall_func0("intface_show")
- shows main interface
> int sfall_func0("intface_is_hidden")
- returns 1 if interface is currently hidden, 0 otherwise
> void sfall_func0("exec_map_update_scripts")
- executes map_update_p_proc for all objects on map and global/hook scripts as well
------------------------
------ MORE INFO -------
------------------------
@@ -2,12 +2,12 @@
*0x8156 - int read_byte(int address)
*0x8157 - int read_short(int address)
*0x8158 - int read_int(int address)
*0x8159 - char* read_string(int address)
*0x8159 - string read_string(int address)
*0x81cf - void write_byte(int address, int value)
*0x81d0 - void write_short(int address, int value)
*0x81d1 - void write_int(int address, int value)
*0x821b - void write_string(int address, char* value)
*0x821b - void write_string(int address, string value)
*0x81d2 - void call_offset_v0(int address)
*0x81d3 - void call_offset_v1(int address, int arg1)
@@ -25,10 +25,10 @@
0x815c - int get_pc_base_stat(int StatID)
0x815d - int get_pc_extra_stat(int StatID)
0x815e - void set_critter_base_stat(CritterPtr, int StatID, int value)
0x815f - void set_critter_extra_stat(CritterPtr, int StatID, int value)
0x8160 - int get_critter_base_stat(CritterPtr, int StatID)
0x8161 - int get_critter_extra_stat(CritterPtr, int StatID)
0x815e - void set_critter_base_stat(object, int StatID, int value)
0x815f - void set_critter_extra_stat(object, int StatID, int value)
0x8160 - int get_critter_base_stat(object, int StatID)
0x8161 - int get_critter_extra_stat(object, int StatID)
0x8242 - void set_critter_skill_points(int critter, int skill, int value)
0x8243 - int get_critter_skill_points(int critter, int skill)
0x8244 - void set_available_skill_points(int value)
@@ -43,7 +43,7 @@
0x81ba - void set_npc_stat_min(int stat, int value)
0x816b - int input_funcs_available()
ox816c - int key_pressed(int dxScancode)
0x816c - int key_pressed(int dxScancode)
0x8162 - void tap_key(int dxScancode)
0x821c - int get_mouse_x()
0x821d - int get_mouse_y()
@@ -55,18 +55,18 @@ ox816c - int key_pressed(int dxScancode)
0x8164 - bool game_loaded()
0x8165 - bool graphics_funcs_available()
0x8166 - int load_shader(char* path)
0x8166 - int load_shader(string path)
0x8167 - void free_shader(int ID)
0x8168 - void activate_shader(int ID)
0x8169 - void deactivate_shader(int ID)
0x816d - void set_shader_int(int ID, char* param, int value)
0x816e - void set_shader_float(int ID, char* param, float value)
0x816f - void set_shader_vector(int ID, char* param, float f1, float f2, float f3, float f4)
0x816d - void set_shader_int(int ID, string param, int value)
0x816e - void set_shader_float(int ID, string param, float value)
0x816f - void set_shader_vector(int ID, string param, float f1, float f2, float f3, float f4)
0x81ad - int get_shader_version()
0x81ae - void set_shader_mode(int mode)
0x81b0 - void force_graphics_refresh(bool enabled)
0x81b1 - int get_shader_texture(int ID, int texture)
0x81b2 - void set_shader_texture(int ID, char* param, int texID)
0x81b2 - void set_shader_texture(int ID, string param, int texID)
0x816a - void set_global_script_repeat(int frames)
0x819b - void set_global_script_type(int type)
@@ -82,9 +82,9 @@ ox816c - int key_pressed(int dxScancode)
0x8173 - int get_world_map_x_pos()
0x8174 - int get_world_map_y_pos()
0x8175 - void set_dm_model(char* name)
0x8176 - void set_df_model(char* name)
0x8177 - void set_movie_path(char* filename, int movieid)
0x8175 - void set_dm_model(string name)
0x8176 - void set_df_model(string name)
0x8177 - void set_movie_path(string filename, int movieid)
0x8178 - void set_perk_image(int perkID, int value)
0x8179 - void set_perk_ranks(int perkID, int value)
@@ -103,8 +103,8 @@ ox816c - int key_pressed(int dxScancode)
0x8196 - void set_perk_int(int perkID, int value)
0x8187 - void set_perk_agl(int perkID, int value)
0x8188 - void set_perk_lck(int perkID, int value)
0x8189 - void set_perk_name(int perkID, char* value)
0x818a - void set_perk_desc(int perkID, char* value)
0x8189 - void set_perk_name(int perkID, string value)
0x818a - void set_perk_desc(int perkID, string value)
0x8247 - void set_perk_freq(int value)
0x818b - void set_pipboy_available(int available)
@@ -116,18 +116,18 @@ ox816c - int key_pressed(int dxScancode)
0x818f - void set_perk_owed(int value)
0x8190 - int get_perk_available(int perk)
0x8191 - int get_critter_current_ap(CritterPtr)
0x8192 - void set_critter_current_ap(CritterPtr, int ap)
0x8191 - int get_critter_current_ap(object critter)
0x8192 - void set_critter_current_ap(object critter, int ap)
0x8193 - int active_hand()
0x8194 - void toggle_active_hand()
0x8195 - void set_weapon_knockback(WeaponPtr, int type, float value)
0x8196 - void set_target_knockback(CritterPtr, int type, float value)
0x8197 - void set_attacker_knockback(CritterPtr, int type, float value)
0x8198 - void remove_weapon_knockback(WeaponPtr)
0x8199 - void remove_target_knockback(CritterPtr)
0x819a - void remove_attacker_knockback(CritterPtr)
0x8195 - void set_weapon_knockback(object weapon, int type, float value)
0x8196 - void set_target_knockback(object critter, int type, float value)
0x8197 - void set_attacker_knockback(object critter, int type, float value)
0x8198 - void remove_weapon_knockback(object weapon)
0x8199 - void remove_target_knockback(object critter)
0x819a - void remove_attacker_knockback(object critter)
0x819d - void set_sfall_global(string/int varname, int/float value)
0x819e - int get_sfall_global_int(string/int varname)
@@ -152,26 +152,26 @@ ox816c - int key_pressed(int dxScancode)
0x81aa - void set_xp_mod(int percentage)
0x81ab - void set_perk_level_mod(int levels)
0x81c5 - void set_critter_hit_chance_mod(CritterPtr, int max, int mod)
0x81c5 - void set_critter_hit_chance_mod(object, int max, int mod)
0x81c6 - void set_base_hit_chance_mod(int max, int mod)
0x81c7 - void set_critter_skill_mod(CritterPtr, int max)
0x81c7 - void set_critter_skill_mod(object, int max)
0x81c8 - void set_base_skill_mod(int max)
0x81c9 - void set_critter_pickpocket_mod(CritterPtr, int max, int mod)
0x81c9 - void set_critter_pickpocket_mod(object, int max, int mod)
0x81ca - void set_base_pickpocket_mod(int max, int mod)
0x81a3 - int eax_available()
0x81a4 - void set_eax_environment(int environment)
0x81a5 - void inc_npc_level(char* npc)
0x8241 - int get_npc_level(char* npc)
0x81a5 - void inc_npc_level(string npc)
0x8241 - int get_npc_level(string npc)
0x81a6 - int get_viewport_x()
0x81a7 - int get_viewport_y()
0x81a8 - void set_viewport_x(int view_x)
0x81a9 - void set_viewport_y(int view_y)
0x81ac - int get_ini_setting(char* setting)
0x81eb - char* get_ini_string(char* setting)
0x81ac - int get_ini_setting(string setting)
0x81eb - string get_ini_string(string setting)
0x81af - int get_game_mode()
@@ -179,14 +179,14 @@ ox816c - int key_pressed(int dxScancode)
0x81b6 - void set_car_current_town(int town)
0x81bb - void set_fake_perk(char* name, int level, int image, char* desc)
0x81bc - void set_fake_trait(char* name, int active, int image, char* desc)
0x81bd - void set_selectable_perk(char* name, int active, int image, char* desc)
0x81be - void set_perkbox_title(char* title)
0x81bb - void set_fake_perk(string name, int level, int image, string desc)
0x81bc - void set_fake_trait(string name, int active, int image, string desc)
0x81bd - void set_selectable_perk(string name, int active, int image, string desc)
0x81be - void set_perkbox_title(string title)
0x81bf - void hide_real_perks()
0x81c0 - void show_real_perks()
0x81c1 - int has_fake_perk(char* name)
0x81c2 - int has_fake_trait(char* name)
0x81c1 - int has_fake_perk(string name)
0x81c2 - int has_fake_trait(string name)
0x81c3 - void perk_add_mode(int type)
0x81c4 - void clear_selectable_perks()
0x8225 - void remove_trait(int traitID)
@@ -231,11 +231,11 @@ ox816c - int key_pressed(int dxScancode)
0x8266 - int ceil(float)
0x8267 - int round(float)
0x81f2 - void set_palette(char* path)
0x81f2 - void set_palette(string path)
0x81f3 - void remove_script(objptr)
0x81f4 - void set_script(objptr, int scriptid)
0x81f5 - int get_script(objptr)
0x81f3 - void remove_script(object)
0x81f4 - void set_script(object, int scriptid)
0x81f5 - int get_script(object)
0x81f6 - int nb_create_char()
@@ -258,10 +258,10 @@ ox816c - int key_pressed(int dxScancode)
0x8202 - void fs_seek(int id, int pos)
0x8203 - void fs_resize(int id, int size)
0x8204 - int get_proto_data(objptr, int offset)
0x8205 - void set_proto_data(objptr, int offset, int value)
0x8204 - int get_proto_data(object, int offset)
0x8205 - void set_proto_data(object, int offset, int value)
0x8206 - void set_self(objptr)
0x8206 - void set_self(object)
0x8207 - void register_hook(int hook)
0x820d - int list_begin(int type)
@@ -277,19 +277,19 @@ ox816c - int key_pressed(int dxScancode)
0x8214 - void set_hero_race(int style)
0x8215 - void set_hero_style(int style)
0x8216 - void set_critter_burst_disable(objptr critter, int disable)
0x8216 - void set_critter_burst_disable(object critter, int disable)
0x8217 - int get_weapon_ammo_pid(objptr weapon)
0x8218 - void set_weapon_ammo_pid(objptr weapon, int pid)
0x8219 - int get_weapon_ammo_count(objptr weapon)
0x821a - void set_weapon_ammo_count(objptr weapon, int count)
0x8217 - int get_weapon_ammo_pid(object weapon)
0x8218 - void set_weapon_ammo_pid(object weapon, int pid)
0x8219 - int get_weapon_ammo_count(object weapon)
0x821a - void set_weapon_ammo_count(object weapon, int count)
0x8220 - int get_screen_width()
0x8221 - int get_screen_height()
0x8222 - void stop_game()
0x8223 - void resume_game()
0x8224 - void create_message_window(char* message)
0x8224 - void create_message_window(string message)
0x8226 - int get_light_level()
@@ -297,16 +297,16 @@ ox816c - int key_pressed(int dxScancode)
0x8228 - int get_attack_type
0x822b - int play_sfall_sound(char* file, int loop)
0x822b - int play_sfall_sound(string file, int loop)
0x822c - void stop_sfall_sound(int ptr)
0x8235 - array string_split(char* string, char* split)
0x8237 - int atoi(char* string)
0x8238 - float atof(char* string)
0x824e - char* substr(char* string, int start, int length)
0x824f - int strlen(char* string)
0x8250 - char* sprintf(char* format, any value)
0x8251 - int charcode(char* string)
0x8235 - array string_split(string string, string split)
0x8237 - int atoi(string string)
0x8238 - float atof(string string)
0x824e - string substr(string string, int start, int length)
0x824f - int strlen(string string)
0x8250 - string sprintf(string format, any value)
0x8251 - int charcode(string string)
0x8253 - int typeof(any value)
0x823a - int get_tile_fid(int tile)
@@ -318,35 +318,45 @@ ox816c - int key_pressed(int dxScancode)
0x8240 - void mark_movie_played(int id)
0x8248 - objptr get_last_target(objptr critter)
0x8249 - objptr get_last_attacker(objptr critter)
0x8248 - object get_last_target(object critter)
0x8249 - object get_last_attacker(object critter)
0x824b - int tile_under_cursor
0x824c - int gdialog_get_barter_mod
0x824d - void set_inven_ap_cost
0x825c - void reg_anim_combat_check(int enable)
0x825a - void reg_anim_destroy(objptr object)
0x825b - void reg_anim_animate_and_hide(objptr object, int animID, int delay)
0x825d - void reg_anim_light(objptr object, int radius, int delay)
0x825e - void reg_anim_change_fid(objptr object, int FID, int delay)
0x825f - void reg_anim_take_out(objptr object, int holdFrameID, int delay)
0x8260 - void reg_anim_turn_towards(objptr object, int tile/targetObj, int delay)
0x825a - void reg_anim_destroy(object object)
0x825b - void reg_anim_animate_and_hide(object object, int animID, int delay)
0x825d - void reg_anim_light(object object, int radius, int delay)
0x825e - void reg_anim_change_fid(object object, int FID, int delay)
0x825f - void reg_anim_take_out(object object, int holdFrameID, int delay)
0x8260 - void reg_anim_turn_towards(object object, int tile/targetObj, int delay)
0x8261 - int metarule2_explosions(objptr object)
0x8261 - int metarule2_explosions(object object)
0x8262 - void register_hook_proc(int hook, procedure proc)
0x8266 - char* message_str_game(int fileId, int messageId)
0x8267 - int sneak_success
0x8268 - int tile_light(int elevation, int tileNum)
0x8269 - ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)
0x826a - ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType)
0x826b - array tile_get_objs(int tileNum, int elevation)
0x826c - array party_member_list(int includeHidden)
0x826d - array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType)
0x826e - ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius)
0x826f - int art_exists(int artFID)
0x8270 - int obj_is_carrying_obj(ObjectPtr invenObj, ObjectPtr itemObj)
0x826b - string message_str_game(int fileId, int messageId)
0x826c - int sneak_success
0x826d - int tile_light(int elevation, int tileNum)
0x826e - object obj_blocking_line(object objFrom, int tileTo, int blockingType)
0x826f - object obj_blocking_tile(int tileNum, int elevation, int blockingType)
0x8270 - array tile_get_objs(int tileNum, int elevation)
0x8271 - array party_member_list(int includeHidden)
0x8272 - array path_find_to(object objFrom, int tileTo, int blockingType)
0x8273 - object create_spatial(int scriptID, int tile, int elevation, int radius)
0x8274 - int art_exists(int artFID)
0x8275 - int obj_is_carrying_obj(object invenObj, object itemObj)
0x8276 - any sfall_func0(string funcName)
0x8277 - any sfall_func1(string funcName, arg1)
0x8278 - any sfall_func2(string funcName, arg1, arg2)
0x8279 - any sfall_func3(string funcName, arg1, arg2, arg3)
0x827a - any sfall_func4(string funcName, arg1, arg2, arg3, arg4)
0x827b - any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
+2 -2
View File
@@ -658,8 +658,8 @@ static void __declspec(naked) DisplayBonusHtHDmg2() {
push eax
call sprintf_
add esp, 4*5
mov eax, 0x472569
jmp eax
push 0x472569
retn
}
}
File diff suppressed because it is too large Load Diff
+24 -5
View File
@@ -250,6 +250,7 @@ void LoadArrays(HANDLE h) {
if (nextarrayid == 0) nextarrayid++;
arrays.insert(array_pair(nextarrayid, arrayVar));
savedArrays[arrayVar.key] = nextarrayid++;
arrayVar.keyHash.clear();
}
}
@@ -310,9 +311,26 @@ void DESetArray(int id, const DWORD* types, const void* data) {
/*
Array manipulation functions for script operators
TODO: move somewhere else
*/
const char* _stdcall GetSfallTypeName(DWORD dataType) {
switch (dataType) {
case DATATYPE_NONE:
return "(none)";
case DATATYPE_STR:
return "string";
case DATATYPE_FLOAT:
return "float";
case DATATYPE_INT:
return "integer";
default:
return "(unknown)";
}
}
DWORD _stdcall getSfallTypeByScriptType(DWORD varType) {
varType&=0xffff;
varType &= 0xffff;
switch (varType) {
case VAR_TYPE_STR:
case VAR_TYPE_STR2:
@@ -408,7 +426,8 @@ DWORD _stdcall GetArray(DWORD id, DWORD key, DWORD keyType, DWORD* resultType) {
return 0;
} else {
el = key;
if (arr.size() <= el) return 0;
// check for invalid index
if (el < 0 || el >= arr.size()) return 0;
}
switch(arr.val[el].type) {
case DATATYPE_NONE: return 0;
@@ -436,9 +455,6 @@ void _stdcall SetArray(DWORD id, DWORD key, DWORD keyType, DWORD val, DWORD valT
if (valType == DATATYPE_INT && val == 0 && allowUnset) {
// after assigning zero to a key, no need to store it, because "get_array" returns 0 for non-existent keys: try unset
if (el >= 0) {
// remove key=>value pair from vector
arr.clearRange(el, el + 2);
arr.val.erase(arr.val.begin() + el, arr.val.begin() + (el + 2));
// remove from hashtable
arr.keyHash.erase(elIter);
// shift all keyHash references
@@ -446,6 +462,9 @@ void _stdcall SetArray(DWORD id, DWORD key, DWORD keyType, DWORD val, DWORD valT
if (elIter->second >= (DWORD)el)
elIter->second -= 2;
}
// remove key=>value pair from vector
arr.clearRange(el, el + 2);
arr.val.erase(arr.val.begin() + el, arr.val.begin() + (el + 2));
}
} else {
if (el == -1) {
+5 -1
View File
@@ -4,7 +4,7 @@
#include <unordered_map>
#include <set>
#define ARRAY_MAX_STRING (1024) // maximum length of string to be stored as array key or value
#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
@@ -16,6 +16,7 @@
extern char get_all_arrays_special_key[];
// TODO: rewrite
class sArrayElement
{
public:
@@ -79,6 +80,8 @@ typedef std::tr1::unordered_map<sArrayElement, DWORD, sArrayElement_HashFunc, sA
/**
This class represents sfall array
It can be both list (normal array) and map (associative)
TODO: rewrite for better interface (especially associate arrays)
*/
class sArrayVar
{
@@ -139,6 +142,7 @@ void GetArrays(int* arrays);
void DEGetArray(int id, DWORD* types, void* data);
void DESetArray(int id, const DWORD* types, const void* data);
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)
+330 -120
View File
File diff suppressed because it is too large Load Diff
+8 -1
View File
@@ -34,6 +34,10 @@ static void __declspec(naked) compute_spray_rounds_distribution() {
imul ebx; // multiply eax by ebx and store result in edx:eax
mov ebx, compute_spray_center_div; // divisor
idiv ebx; // divide edx:eax by ebx and store result in eax (edx)
test edx, edx; // if remainder (edx) is not 0
jz divEnd1;
inc eax; // round up
divEnd1:
mov [esp+16], eax; // roundsCenter
test eax, eax; // if (roundsCenter == 0)
jnz loc_42350F;
@@ -52,7 +56,10 @@ loc_42350F:
imul ebx;
mov ebx, compute_spray_target_div;
idiv ebx;
test edx, edx; // if remainder (edx) is not 0
jz divEnd2;
inc eax; // round up
divEnd2:
mov ebp, eax;
mov ebx, [esp+16];
// at this point, eax should contain the same value as ebp (roundsMainTarget); ebx should contain value of roundsCenter
+36 -12
View File
@@ -27,21 +27,45 @@ static const DWORD ExpectedCRC[]= {0xe1680293, 0xef34f989};
static void inline Fail(const char* a) { MessageBoxA(0, a, "Error", MB_TASKMODAL); ExitProcess(1); }
static DWORD crcInternal(BYTE* data, DWORD size) {
DWORD table[256];
const DWORD kPoly = 0x1EDC6F41;
for (DWORD i = 0;i < 256;i++) {
DWORD r = i;
for (int j = 0;j < 8;j++) {
if ((r & 1) != 0) r = (r >> 1) ^ kPoly;
else r >>= 1;
}
table[i] = r;
}
static const DWORD CRC_table[256] = {
0x00000000, 0x0A5F4D75, 0x14BE9AEA, 0x1EE1D79F, 0x14C5EB57, 0x1E9AA622, 0x007B71BD, 0x0A243CC8,
0x1433082D, 0x1E6C4558, 0x008D92C7, 0x0AD2DFB2, 0x00F6E37A, 0x0AA9AE0F, 0x14487990, 0x1E1734E5,
0x15DECED9, 0x1F8183AC, 0x01605433, 0x0B3F1946, 0x011B258E, 0x0B4468FB, 0x15A5BF64, 0x1FFAF211,
0x01EDC6F4, 0x0BB28B81, 0x15535C1E, 0x1F0C116B, 0x15282DA3, 0x1F7760D6, 0x0196B749, 0x0BC9FA3C,
0x16054331, 0x1C5A0E44, 0x02BBD9DB, 0x08E494AE, 0x02C0A866, 0x089FE513, 0x167E328C, 0x1C217FF9,
0x02364B1C, 0x08690669, 0x1688D1F6, 0x1CD79C83, 0x16F3A04B, 0x1CACED3E, 0x024D3AA1, 0x081277D4,
0x03DB8DE8, 0x0984C09D, 0x17651702, 0x1D3A5A77, 0x171E66BF, 0x1D412BCA, 0x03A0FC55, 0x09FFB120,
0x17E885C5, 0x1DB7C8B0, 0x03561F2F, 0x0909525A, 0x032D6E92, 0x097223E7, 0x1793F478, 0x1DCCB90D,
0x11B258E1, 0x1BED1594, 0x050CC20B, 0x0F538F7E, 0x0577B3B6, 0x0F28FEC3, 0x11C9295C, 0x1B966429,
0x058150CC, 0x0FDE1DB9, 0x113FCA26, 0x1B608753, 0x1144BB9B, 0x1B1BF6EE, 0x05FA2171, 0x0FA56C04,
0x046C9638, 0x0E33DB4D, 0x10D20CD2, 0x1A8D41A7, 0x10A97D6F, 0x1AF6301A, 0x0417E785, 0x0E48AAF0,
0x105F9E15, 0x1A00D360, 0x04E104FF, 0x0EBE498A, 0x049A7542, 0x0EC53837, 0x1024EFA8, 0x1A7BA2DD,
0x07B71BD0, 0x0DE856A5, 0x1309813A, 0x1956CC4F, 0x1372F087, 0x192DBDF2, 0x07CC6A6D, 0x0D932718,
0x138413FD, 0x19DB5E88, 0x073A8917, 0x0D65C462, 0x0741F8AA, 0x0D1EB5DF, 0x13FF6240, 0x19A02F35,
0x1269D509, 0x1836987C, 0x06D74FE3, 0x0C880296, 0x06AC3E5E, 0x0CF3732B, 0x1212A4B4, 0x184DE9C1,
0x065ADD24, 0x0C059051, 0x12E447CE, 0x18BB0ABB, 0x129F3673, 0x18C07B06, 0x0621AC99, 0x0C7EE1EC,
0x1EDC6F41, 0x14832234, 0x0A62F5AB, 0x003DB8DE, 0x0A198416, 0x0046C963, 0x1EA71EFC, 0x14F85389,
0x0AEF676C, 0x00B02A19, 0x1E51FD86, 0x140EB0F3, 0x1E2A8C3B, 0x1475C14E, 0x0A9416D1, 0x00CB5BA4,
0x0B02A198, 0x015DECED, 0x1FBC3B72, 0x15E37607, 0x1FC74ACF, 0x159807BA, 0x0B79D025, 0x01269D50,
0x1F31A9B5, 0x156EE4C0, 0x0B8F335F, 0x01D07E2A, 0x0BF442E2, 0x01AB0F97, 0x1F4AD808, 0x1515957D,
0x08D92C70, 0x02866105, 0x1C67B69A, 0x1638FBEF, 0x1C1CC727, 0x16438A52, 0x08A25DCD, 0x02FD10B8,
0x1CEA245D, 0x16B56928, 0x0854BEB7, 0x020BF3C2, 0x082FCF0A, 0x0270827F, 0x1C9155E0, 0x16CE1895,
0x1D07E2A9, 0x1758AFDC, 0x09B97843, 0x03E63536, 0x09C209FE, 0x039D448B, 0x1D7C9314, 0x1723DE61,
0x0934EA84, 0x036BA7F1, 0x1D8A706E, 0x17D53D1B, 0x1DF101D3, 0x17AE4CA6, 0x094F9B39, 0x0310D64C,
0x0F6E37A0, 0x05317AD5, 0x1BD0AD4A, 0x118FE03F, 0x1BABDCF7, 0x11F49182, 0x0F15461D, 0x054A0B68,
0x1B5D3F8D, 0x110272F8, 0x0FE3A567, 0x05BCE812, 0x0F98D4DA, 0x05C799AF, 0x1B264E30, 0x11790345,
0x1AB0F979, 0x10EFB40C, 0x0E0E6393, 0x04512EE6, 0x0E75122E, 0x042A5F5B, 0x1ACB88C4, 0x1094C5B1,
0x0E83F154, 0x04DCBC21, 0x1A3D6BBE, 0x106226CB, 0x1A461A03, 0x10195776, 0x0EF880E9, 0x04A7CD9C,
0x196B7491, 0x133439E4, 0x0DD5EE7B, 0x078AA30E, 0x0DAE9FC6, 0x07F1D2B3, 0x1910052C, 0x134F4859,
0x0D587CBC, 0x070731C9, 0x19E6E656, 0x13B9AB23, 0x199D97EB, 0x13C2DA9E, 0x0D230D01, 0x077C4074,
0x0CB5BA48, 0x06EAF73D, 0x180B20A2, 0x12546DD7, 0x1870511F, 0x122F1C6A, 0x0CCECBF5, 0x06918680,
0x1886B265, 0x12D9FF10, 0x0C38288F, 0x066765FA, 0x0C435932, 0x061C1447, 0x18FDC3D8, 0x12A28EAD
};
static DWORD crcInternal(BYTE* data, DWORD size) {
DWORD crc=0xffffffff;
for (DWORD i = 0;i < size;i++) {
crc = table[(((BYTE)(crc)) ^ data[i])] ^ (crc >> 8);
crc = CRC_table[(((BYTE)(crc)) ^ data[i])] ^ (crc >> 8);
}
return crc^0xffffffff;
}
+44
View File
@@ -0,0 +1,44 @@
/*
* sfall
* Copyright (C) 2008-2016 The sfall team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cstddef>
// https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/nullptr
const // It is a const object...
class nullptr_t {
public:
template<class T>
inline operator T*() const // convertible to any type of null non-member pointer...
{ return 0; }
template<class C, class T>
inline operator T C::*() const // or any type of null member pointer...
{ return 0; }
private:
void operator&() const; // Can't take address of nullptr
} nullptr = {};
// http://stackoverflow.com/questions/33026118/c-stdbeginc-for-vs-2008
template<typename T, std::size_t N>
T* std_begin(T (&a)[N]) { return a; }
template<typename T, std::size_t N>
T* std_end(T (&a)[N]) { return a + N; }
+54 -24
View File
@@ -22,14 +22,14 @@
#include "FalloutEngine.h"
#include "version.h"
static DWORD InCredits=0;
static DWORD CreditsLine=0;
static DWORD InCredits = 0;
static DWORD CreditsLine = 0;
static const char* ExtraLines[]={
static const char* ExtraLines[] = {
"#SFALL " VERSION_STRING,
"",
"sfall is free software, licensed under the GPL",
"Copyright 2008-2015 The sfall team",
"Copyright 2008-2016 The sfall team",
"",
"@Author",
"Timeslip",
@@ -52,6 +52,8 @@ static const char* ExtraLines[]={
"Tehnokrat",
"Crafty",
"Slider2k",
"Vennor",
"Oppen",
"",
"@Additional thanks to",
"Nirran",
@@ -69,42 +71,43 @@ static const char* ExtraLines[]={
"#FALLOUT 2",
""
};
static DWORD ExtraLineCount=sizeof(ExtraLines)/4;
static DWORD ExtraLineCount = sizeof(ExtraLines)/4;
static const char* creditsFile="credits.txt";
static const char* creditsFile = "credits.txt";
static void _stdcall ShowCreditsHook() {
InCredits=1;
CreditsLine=0;
InCredits = 1;
CreditsLine = 0;
__asm {
mov eax, creditsFile;
mov eax, creditsFile;
call credits_;
}
InCredits=0;
InCredits = 0;
}
static DWORD _stdcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
if(!InCredits||CreditsLine>=ExtraLineCount) return 0;
const char* line=ExtraLines[CreditsLine++];
if(strlen(line)) {
if(line[0]=='#') {
if (!InCredits || CreditsLine >= ExtraLineCount) return 0;
const char* line = ExtraLines[CreditsLine++];
if (strlen(line)) {
if (line[0] == '#') {
line++;
*font=*(DWORD*)_name_font;
*colour=*(BYTE*)0x6A7F01;
} else if(line[0]=='@') {
*font = *(DWORD*)_name_font;
*colour = *(BYTE*)0x6A7F01;
} else if (line[0] == '@') {
line++;
*font=*(DWORD*)_title_font;
*colour=*(DWORD*)_title_color;
*font = *(DWORD*)_title_font;
*colour = *(DWORD*)_title_color;
} else {
*font=*(DWORD*)_name_font;
*colour=*(DWORD*)_name_color;
*font = *(DWORD*)_name_font;
*colour = *(DWORD*)_name_color;
}
}
strcpy_s(buf, 256, line);
return 1;
}
static void __declspec(naked) CreditsNextLineHook() {
// Additional lines will be at the top of CREDITS.TXT contents
static void __declspec(naked) CreditsNextLineHook_Top() {
__asm {
pushad;
push ebx;
@@ -113,7 +116,7 @@ static void __declspec(naked) CreditsNextLineHook() {
call CreditsNextLine;
test eax, eax;
popad;
jz fail;
jz fail;
xor eax, eax;
inc eax;
retn;
@@ -122,8 +125,35 @@ fail:
}
}
// Additional lines will be at the bottom of CREDITS.TXT contents
static void __declspec(naked) CreditsNextLineHook_Bottom() {
__asm {
pushad;
call credits_get_next_line_; // call default function
test eax, eax;
popad;
jnz morelines; // if not the end yet, skip custom code
pushad;
push ebx;
push edx;
push eax;
call CreditsNextLine; // otherwise call out function
test eax, eax; // if any extra lines left, return 1 (from function), 0 otherwise
popad;
jnz morelines;
mov eax, 0x0;
retn;
morelines:
mov eax, 0x1;
retn;
}
}
void CreditsInit() {
HookCall(0x480C49, &ShowCreditsHook);
HookCall(0x43F881, &ShowCreditsHook);
HookCall(0x42CB49, &CreditsNextLineHook);
if (GetPrivateProfileIntA("Misc", "CreditsAtBottom", 0, ini))
HookCall(0x42CB49, &CreditsNextLineHook_Bottom);
else
HookCall(0x42CB49, &CreditsNextLineHook_Top);
}

Some files were not shown because too many files have changed in this diff Show More