Compare commits

...
106 Commits
Author SHA1 Message Date
NovaRain 35d9b9439c Included Define.h in FalloutEngine.h
* it removes the need to include Define.h separately across the code.
(similar to Fallout2.h in 4.x code)

Added StrNormalizePath() to Utils.cpp.
2019-12-25 09:25:36 +08:00
NovaRain a1968f7f86 Minor edits to the built-in item highlighting function
Removed the redundant struct define in Tiles.cpp.

Added a comment to ScriptUtils.hpp.
2019-12-24 20:58:03 +08:00
NovaRain 85a5ee2a52 Some edits to hookscripts.txt & function notes.txt 2019-12-24 00:57:16 +08:00
NovaRain 310c392759 Added lootable corpses to the built-in item highlighting 2019-12-23 21:22:15 +08:00
NovaRain 3a24d0bdfd Replaced _stricmp in previous commit with strcmp.
Minor edits to Inventory.cpp.
2019-12-16 15:46:09 +08:00
NovaRain a9ad1a62eb Tweaked the path to load global shaders in the previous commit
* although 3.8 doesn't have the path issue as 4.x due to the lack of
loading custom .dat, it's better to unify the path in this case.

Refactored the code for DataLoadOrderPatch in the same way as 4.x.
2019-12-15 10:31:50 +08:00
NovaRain d73859fa5f Applied proper ptr_patches to some code 2019-12-14 11:41:43 +08:00
NovaRain 04043989c6 Restored loading global shaders at game start from pre-3.0
Added GlobalShaderFile option to ddraw.ini.
Added an example global shader file to modderspack.
Minor edits to HeroAppearance.cpp.
2019-12-14 11:05:12 +08:00
NovaRain 3b82232b46 Edited the description of the functions in the previous commit
Rewrote ASM code for tile_under_cursor script function.
2019-12-14 00:35:05 +08:00
NovaRain 5e704d206f Added "objects_in_radius" and "tile_by_position" script functions 2019-12-13 10:56:15 +08:00
NovaRain 5e65510797 Rewrote the code of some hook in 4.x style
* TOHIT, AFTERHITROLL, REMOVEINVENOBJ
2019-12-11 15:55:29 +08:00
NovaRain b4dac84ddd Rewrote some script functions in ObjectsOps in C++
* remove_script, set/get_script, set_critter_burst_disable.

Changed the return value of get_script to 0 for unscripted objects.
2019-12-09 11:07:40 +08:00
NovaRain cbc822c9e0 Minor edits to code 2019-12-07 09:56:43 +08:00
NovaRain 6cc68ed3de Re-fixed the previous commit
Replaced calling full substring with a simplified one for get_array.
2019-12-05 09:49:07 +08:00
NovaRain 6d4aea216b Fix for printing game messages to debug log 2019-12-04 13:07:04 +08:00
NovaRain 569790acb2 Code refactoring for ASM code in opcodes 2019-12-04 11:37:44 +08:00
NovaRain 7016690f99 Added "string_format" script function
Rewrote ASM code of opcode handlers in MemoryOp.hpp.
2019-12-03 10:52:56 +08:00
NovaRain eeb97a4299 Some code refactoring 2019-12-01 12:10:33 +08:00
NovaRain 66c237d297 Refactored the code for "substr" script function
* fixed the crashing bug and added a new behavior.

Changed the error message due to missing critter frame (again):
* replaced the interruption with printing the error message to in-game
message window.
2019-11-29 12:13:36 +08:00
NovaRain 3629c90fa9 Simplified _RET_VAL_INT2 in AsmMacros.h (from dev)
Changed related ASM code in various script functions.

Minor refactoring on some script functions.
2019-11-29 12:10:08 +08:00
NovaRain 1f99855500 Changed the error msg due to missing critter frame
* now the game only "crashes" when both Enable and DebugMode are
enabled in [Debugging] in ddraw.ini.
2019-11-28 14:43:00 +08:00
NovaRain cdf0bdf23e Refactored script function handlers
Changed error return values of list_begin/next to the same as dev.
2019-11-28 14:42:07 +08:00
NovaRain 2c67058016 Code refactoring for opcodes/metarules
* added proper arg validation for some opcodes using WRAP_OPCODE macro.
* changed return values of some opcodes/metarules to be the same as dev.
2019-11-28 10:24:40 +08:00
NovaRain 29f0affd72 Re-fixed commit e62b5c0 (correct variant) 2019-11-26 07:49:31 +08:00
NovaRain e01569637d Backported additional check in DialogHook from 4.x
Renamed inLoop/saveInCombatFix variables in LoadGameHook.cpp.
2019-11-25 09:58:12 +08:00
NovaRain 78f0ac473d Restored calling original engine functions from HRP hacks. 2019-11-25 07:29:29 +08:00
NovaRain bbe9a2d26d Added "get_text_width" and "string_compare" script functions
Rewrote set_dm/df_model, set_movie_path functions with WRAP_OPCODE.
2019-11-23 20:32:57 +08:00
NovaRain 7bcb76e70c Restored and fixed RemoveWindowRounding option
Reorganized ddraw.ini a bit.
2019-11-21 00:58:41 +08:00
NovaRain 3348d8b716 Backported "draw_image" and "draw_image_scaled" functions from 4.1 2019-11-19 20:51:22 +08:00
NovaRain 4767ad2753 Fixed a crash bug in CorpseLineOfFireFix (from commit d9a440f)
Minor edits to HookScripts/FalloutEngine.
2019-11-19 14:27:19 +08:00
NovaRain 04ebbaa182 Added three new script window functions:
"show_window", "hide_window", "set_window_flag"

Updated documents.
2019-11-17 08:40:18 +08:00
NovaRain 3c5dc6853a Added "get_sfall_arg_at" script function
Improved the functionality of "inventory_redraw" function.
2019-11-16 22:54:09 +08:00
NovaRain a70a776e46 Tweaked/fixed reg_anim_callback function 2019-11-15 10:01:39 +08:00
NovaRain 83c3d6b1a8 Added "reg_anim_callback" script function(opcode)
Updated documents.
2019-11-14 13:02:10 +08:00
NovaRain 6a566087ca Implemented executing timed_event_p_proc in sfall global scripts
Added "add_g_timer_event" and "remove_timer_event" script functions
for timed_event_p_proc in global scripts.

Fixed the check on the 'hidden' flag for previous commit.
2019-11-11 10:01:38 +08:00
NovaRain e62b5c03db Added a fix for scripted interface windows
* prevents player's movement when clicking on the window.

* the mouse cursor will not be toggled when the cursor hovers over
a hidden window.

Updated version number.
2019-11-10 18:24:43 +08:00
NovaRain 29da6d7071 Minor edits to FalloutStructs.h
Removed unnecessary AfterAttackCleanup on reset in LoadGameHook.cpp.
Fixed Debug build configuration in project file.
2019-11-05 09:27:41 +08:00
NovaRain ec4a58e19e Updated define_extra.h
Added define of OBJ_DATA_SCRIPT_INDEX to define_extra.h.
Moved Stats related reset code from ScriptExtender.cpp to Stats.cpp.
2019-11-04 21:28:06 +08:00
NovaRain b023999c5e Updated script mods. 2019-11-03 10:10:11 +08:00
NovaRain ee711d8f81 Added "get_inven_ap_cost" script function 2019-11-02 10:26:28 +08:00
NovaRain d26a06872a Backported the advanced BarBoxes features from 4.x:
* Added BoxBarCount option.
* Added "set_iface_tag_text" and "add_iface_tag" script functions.
* Now number of simultaneously displayed boxes depends on game res.
* Updated documents.
2019-11-01 21:14:03 +08:00
NovaRain c4f8912490 Added support for displaying item AP cost up to 19
* Requires an extended MVENUM.frm in the art\intrface\ directory to
display properly (will be included in modderspack).
2019-10-31 12:47:57 +08:00
NovaRain d9a440f667 Fixed PM's weapon being misplaced after level up
Moved some codes from Worldmap.cpp to new Interface.cpp (same as 4.x).

Moved some option codes from main.cpp to other modules.

Removed CorpseLineOfFireFix from ddraw.ini (always enabled).
2019-10-31 11:42:20 +08:00
NovaRain 49bc2d3241 Some code fixes/edits. 2019-10-29 10:45:46 +08:00
NovaRain d07603f1b0 Renamed AnimationsAtOnceLimit.cpp/h to Animations
Renamed SuperSave.cpp/h to ExtraSaveSlots (same as 4.x)
2019-10-28 09:51:20 +08:00
NovaRain 76346c24b3 Added a debug message about missing art file for critters 2019-10-25 10:24:40 +08:00
NovaRain dee3e2f596 Minor code edit to previous commit 2019-10-23 09:37:10 +08:00
NovaRain 648eb9b2f1 Engine now uses 'English' as the fallback language for all msg files 2019-10-22 15:56:04 +08:00
NovaRain fcbf4d3972 Cleanup in vcxproj file 2019-10-22 10:27:59 +08:00
NovaRain 3ef6056a77 Added "add_trait" script function
Replaced some C-style casting with pre-defined ptr_* variables.
2019-10-20 19:31:08 +08:00
NovaRain ac10bce231 Moved code from main.cpp to new LoadOrder/Karma.cpp
Slightly refactored list_* functions with 4.x codebase.

Changed the initialization order in main.cpp to 4.x's.
2019-10-18 11:15:10 +08:00
NovaRain 6780a21b07 Fixed amount argument for critter_add/rm_trait functions 2019-10-17 10:27:28 +08:00
NovaRain 25fabde434 Replaced GetPrivateProfileInt/String with wrapper functions
Fixed crash when a name in PremadePaths exceeds 11 characters.
2019-10-16 14:29:04 +08:00
NovaRain da7cd2a060 Implemented new ini reading funcs (part 2)
Refactored Premade.cpp, Reputations.cpp, KarmaFRMs in main.cpp, and
XPTable in Stats.cpp using 4.x implementation.
2019-10-15 21:57:49 +08:00
NovaRain 8924257aee Added a new flag to MainMenuFontColour option
* set bit 1 of the first byte to only change the color of version text
(old behavior)
2019-10-15 11:58:49 +08:00
NovaRain 90ef9e273d Implemented new ini reading funcs in various codes 2019-10-14 23:55:54 +08:00
NovaRain b447e8e9b8 Rewrote set_xp_mod function with WRAP_OPCODE.
Cleanup in ASM scripting handlers code.

Code edits to Perks.cpp and Stats.cpp.
2019-10-14 21:36:25 +08:00
NovaRain 3744c0b165 Added optional options to the perks ini file
* to toggle modification sections for perks and traits.

Backported ini reading functions from 4.x to main.cpp, and edited
related code in Perks.cpp (need to implement to other source later)

Added error/warning icons to message boxes.
2019-10-14 15:30:46 +08:00
NovaRain c98af496b3 Added command_lite.h header file to modderspack 2019-10-11 00:53:22 +08:00
NovaRain c7eaff7ff5 Fixed art_change_fid_num when the hero appearance mod is enabled
* before it set player's FID incorrectly if PC is in other appearance.

Prevented the player from equipping a weapon when player's current
appearance doesn't have the animation for it.

Fixed the player name while controlling other critters.

Edited texts for some error message boxes.
2019-10-10 12:00:30 +08:00
NovaRain 37acec7115 Added "unwield_slot" script function
Re-fixed obj_art_fid for player's FID (commit 36523d8)
2019-10-08 10:56:49 +08:00
NovaRain f6ec543f40 Fixed inven_unwield script function
* now it updates the interface slot for the player properly.

Fixed some code in PartyControl.cpp.
2019-10-07 13:34:35 +08:00
NovaRain 5cfd5f99e3 Moved object unique id code from ScriptExtender to new Objects.cpp/h
Backported set_unjam_locks_time function from 4.0.
2019-10-07 09:36:46 +08:00
NovaRain dafee58c77 Fixed arg1 of HOOK_INVENWIELD when calling move_obj_inven_to_obj
Moved get/set_proto_data functions from MiscOps.hpp to ObjectsOps.hpp.
2019-10-05 07:53:50 +08:00
NovaRain 4cf0c6688f Improved the implementation of HOOK_INVENWIELD
* it now runs for the player and NPCs when removing equipped items.
* added an additional argument.

Fixed drop_obj script function not removing the equipped armor properly
for the player and party members.
2019-10-04 22:04:05 +08:00
NovaRain 27ec2d24fe Fixed move_obj_inven_to_obj script function
* it didn't remove the equipped armor properly for the player and party
members, resulting in broken armor stats.

Added a check for valid objects to get/set_object_data functions.

Some code edits to HeroAppearance.cpp.
2019-09-30 07:51:43 +08:00
NovaRain e3a3ff2540 Improved file searching for hero appearance mod (#251)
* now it will search files in .dat files and folders simultaneously.

* files in folders have higher priority than .dat files.
2019-09-28 10:52:48 +08:00
NovaRain e6a51f965f Removed NPCStage6Fix from ddraw.ini (always enabled)
Moved the code of NPCStage6Fix to BugFixes.cpp.
(to its original relative location, right above MultiHexPathingFix)

Reorganized some code in BugFixes.cpp.

Tweaked the error printing for ResizeArray in Arrays.cpp.
2019-09-27 20:51:34 +08:00
NovaRain 552a2a185e Refactored code in Arrays.cpp and fixed save_array() script function. 2019-09-24 16:50:50 +08:00
NovaRain 04d47d10ad Some minor changes:
* Improved the display of the car fuel gauge on the world map interface.

* Expanded set_critter_stat function to allow changing STAT_unused and
STAT_dmg_* stats for the player, and STAT_unused for other critters.

* Changed AllowUnsafeScripting to not require sfall debugging mode.

* Changed NPCStage6Fix to be enabled by default.

* Added a new value to AIBestWeaponFix to change the priority multiplier
for having weapon perk to 3x.

Updated version number.
2019-09-24 16:01:39 +08:00
NovaRain 749e248c8b Changed CorpseLineOfFireFix to be enabled by default 2019-09-15 07:18:13 +08:00
NovaRain 52290b09d2 Removed duplicate code from intface_redraw_ engine function
Minor edits to code/documents.
2019-09-14 08:56:05 +08:00
NovaRain a6a8e2e42f Backported HEROWIN, DIALOGVIEW, COUNTERWIN game mode flags from 4.x
Updated UI hotkeys example mod.
2019-09-13 08:09:07 +08:00
NovaRain 9693c0d439 Added "register_hook_proc_spec" script function
Updated documents to address the new function.
2019-09-12 22:23:02 +08:00
NovaRain aa22575ec9 Backported optimization for global/hook scripts execution from 4.x 2019-09-11 13:18:20 +08:00
NovaRain 8f4fd1dec8 Fixed AllowLargeTiles option (broken in 3.8.18)
(due to commit f7fa62a)
2019-09-10 10:09:15 +08:00
NovaRain d26097e9ae Fixed some code in AnimationsAtOnceLimit.cpp
Renamed F1EngineBehavior option to Fallout1Behavior.
2019-09-10 06:53:48 +08:00
NovaRain 4bb9828f3e Added F1EngineBehavior option to change some of F2 engine funcs to F1
* disables playing the final movie/credits after the endgame slideshow.
* disables halving the weight for power armor items.

Moved FastShotFix and Ray's combat_p_proc fix from main.cpp to other
files.
2019-09-09 15:19:37 +08:00
NovaRain 2d2f539826 Added a call to load f2_res.dll library from sfall code
Fixed code that depends on HRP addresses in Tiles.cpp.
2019-09-08 10:46:53 +08:00
NovaRain 97bd2cee18 Changed CriticalOverrides.ini to be parsed only once at game start
* before the ini was always reparsed after each game load/reset. This
should improve the performance.
2019-09-07 21:24:19 +08:00
NovaRain 62f890d287 Removed the dependency of Body_Torso from Body_Uncalled hit modifier
Re-added BodyHit_Torso to ddraw.ini.
Reverted set_bodypart_hit_modifier function to pre-3.7.4 behavior.
2019-09-07 20:16:50 +08:00
NovaRain 4b28829983 Renamed Knockback.cpp/h to Combat.cpp/h and reorganized some code:
* Moved PickpocketMod to skills.cpp.
* Moved CheckWeaponAmmoCost to Combat.cpp.
2019-09-07 12:13:31 +08:00
NovaRain cbb739bd7c Added options for tweaking some engine perks to the perks ini file
Minor code edits to main.cpp and ObjectsOps.hpp.
2019-09-06 13:13:40 +08:00
NovaRain e00d02f1f0 Added a compute damage example script.
Updated compiled scripts due to main.h changes.
2019-09-01 11:38:34 +08:00
NovaRain c9e0feeb32 Increased the width of the car fuel gauge to 2px 2019-09-01 09:03:09 +08:00
NovaRain 272e58d873 Tweaked reordering the execution of functions before exiting the map
Added event clearing for active explosives before exiting the map.

Minor code edit to BARTERPRICE hook.
2019-08-31 20:01:51 +08:00
NovaRain 20cb24b385 Fixed some args in HOOK_BARTERPRICE hook when trading with PM
And added a new argument to indicate trading with a party member.

Refactored register_hook/register_hook_proc with _WRAP_OPCODE.
2019-08-27 22:31:10 +08:00
NovaRain 071581effc Replaced 'Take All' hotkey mod with UI hotkeys mod
Minor edits to code/documents.
2019-08-26 21:53:11 +08:00
NovaRain 155c14f4e7 Fixed player stuck at "climbing" frame after ladder climbing animation
Removed the previous fix about player's direction.

Minor code refactoring in AnimationsAtOnceLimit.cpp (from 4.x)
2019-08-25 10:25:30 +08:00
NovaRain c6d612f4a7 Added MainMenuBigFontColour option to change button text color
Changed the fix for player's direction after climbing ladder (61aa11)
2019-08-23 10:35:17 +08:00
NovaRain 61aa1104a1 Fixed player's position if entrance tile is blocked when entering a map
Fixed player's direction after leaving a map via ladder/stairs.

Fixed MainMenuFontColour not changing the font color for the copyright
text on the main menu (#261)

Code correction in main.cpp.
2019-08-22 13:32:18 +08:00
NovaRain 2bd8a6223d Added OverrideCriticalFile option for specifying alternative crit file
Added code for preparing clearing map_update_event in queue.

Fixed a crash bug in message_str_game function when passing a negative
fileId value.

Corrected/edited some code.
2019-08-20 16:47:37 +08:00
NovaRain 99bc47e3f8 Minor edits to Message.cpp and define_extra.h. 2019-08-17 20:56:48 +08:00
NovaRain 07ff16af75 Added an additional 'Energy Weapon' flag to ext flags in weapon protos
* it forces the weapon to use EW skill regardless of its damage type.

Placed an object with PID 0x5000004 (corpse blood) to the lower z-layer
of the tile.
2019-08-16 15:17:59 +08:00
NovaRain a7ea2a9a81 Set DAM_BACKWASH_ flag for attacker before calling combat damage (#246) 2019-08-14 14:36:35 +08:00
NovaRain 2bbb020a80 Fixed the lost car bug with using the Town/World button
(http://www.nma-fallout.com/threads/fallout-2-vehicle-bug.217993/)
2019-08-13 13:59:20 +08:00
NovaRain 81ba15d451 Rewrote the code of force_encounter functions
Added a new flag to force_encounter_with_flags.
2019-08-12 21:12:28 +08:00
NovaRain 36523d89e5 Fixed obj_art_fid for dude_obj when the hero appearance mod is enabled 2019-08-12 00:13:50 +08:00
NovaRain 53bb9ea5c7 Fixed create_message_window script function
* prevent it from creating multiple message windows.

Capped StartMonth/StartDay in case people didn't notice "0-indexed".
Minor fix for assigning an ID to objects when loading a map.
Small optimization for sfall gl/hs scripts.
2019-08-11 11:04:57 +08:00
NovaRain c0f9f142c4 Added a tweak for weapon perk modifier to AIBestWeaponFix
Minor edits to code/documents.
Updated version number.
2019-08-09 11:59:45 +08:00
NovaRain 8b9ffd08a8 Minor edits to ddraw.ini 2019-07-18 09:27:28 +08:00
NovaRain b26208141f Changed DebugMode to not require enabling sfall debugging mode
Changed version to 3.8.19.1 as maintenance release.
2019-07-17 10:10:28 +08:00
NovaRain 147382de25 Minor code edits to LoadGameHook, PartyControl, ScriptExtender.cpp 2019-07-16 13:01:44 +08:00
NovaRain 9529208c7c Fixed the error handling on loading sfallgv.sav
* to improve backward compatibility with older saved games.
2019-07-15 20:51:29 +08:00
NovaRain fc3b7180af Backported the code of COMBATDAMAGE hook from 4.x
Moved instadeath crit fix from COMBATDAMAGE hook to BugFixes.cpp.
Completed the compute_attack struct.
Updated version number.
2019-07-15 09:59:58 +08:00
NovaRain f53aa16923 Excluded Awareness from perks resetting in PartyControl.cpp 2019-07-14 10:46:56 +08:00
122 changed files with 9535 additions and 5935 deletions
+30
View File
@@ -7,6 +7,30 @@
; have an additional NoHardcode option in this file which can
; be used to remove their hardcoded effects, and add new stat/skill effects
[PerksTweak]
;Change the penalty distance and distance bonus for 'Weapon Scope Range' weapon perk
;0 - no penalty, 8 - default penalty
WeaponScopeRangePenalty=8
;2 - no bonus, 5 - default bonus
WeaponScopeRangeBonus=5
;Changes the distance bonus for 'Weapon Long Range' weapon perk
;2 - no bonus, 4 - default bonus
WeaponLongRangeBonus=4
;Changes the hit chance bonus for 'Weapon Accurate' weapon perk
;0 - no bonus, 200 - maximum bonus, 20 - default bonus
WeaponAccurateBonus=20
;Changes the strength bonus for 'Weapon Handling' perk
;0 - no bonus, 10 - maximum bonus, 3 - default bonus
WeaponHandlingBonus=3
;##############################################################################
[Perks]
;Set to 1 to enable the modifications for perks
Enable=0
;Name=The name of the perk (max 63 characters)
;Desc=The description of the perk (max 255 characters)
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
@@ -35,6 +59,7 @@
;If the value is set to -99999, the variable will be ignored (similar to comment out that line)
;##############################################################################
;This is a modification to perk 119
[119]
Name=Example
@@ -57,6 +82,11 @@ INT=0
AGL=0
LCK=0
;##############################################################################
[Traits]
;Set to 1 to enable the modifications for traits
Enable=0
;This is a modification to trait 0
[t0]
NoHardcode=0
+89 -59
View File
@@ -1,12 +1,12 @@
;sfall configuration settings
;v3.8.19
;v3.8.22
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
UseCommandLine=0
;Uncomment and point to a file to get alternate translations for some sfall messages
;TranslationsINI=.\Translations.ini
;TranslationsINI=sfall\Translations.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Sound]
@@ -15,7 +15,7 @@ UseCommandLine=0
NumSoundBuffers=0
;Set to 1 to allow attaching sound files to combat float messages
AllowSoundForFloats=1
AllowSoundForFloats=0
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
@@ -64,6 +64,10 @@ Mode=0
GraphicsWidth=0
GraphicsHeight=0
;Uncomment the option to use a hardware shader (requires DX9 graphics mode 4 or 5)
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
;GlobalShaderFile=global.fx
;Set to 1 to do the palette conversion on the GPU
;Set to 2 to do the palette conversion on the CPU
;Set to 0 to pick automatically
@@ -78,7 +82,7 @@ GPUBlt=0
Use32BitHeadGraphics=0
;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies
;Requires graphics mode 4 or 5
;Requires DX9 graphics mode 4 or 5
AllowDShowMovies=0
;Fade effect time percentage modifier
@@ -149,15 +153,18 @@ ToggleItemHighlightsKey=42
;Set to 1 to also highlight containers
HighlightContainers=1
;Set to 1 to also highlight lootable corpses
HighlightCorpses=1
;Set the color of outlines, available colors:
;0x01 - glowing red
;0x02 - red
;0x04 - grey
;0x08 - glowing green
;0x10 - bright yellow
;0x20 - dark yellow
;0x40 - purple
OutlineColor=0x10
;1 - glowing red
;2 - red
;4 - grey
;8 - glowing green
;16 - bright yellow
;32 - dark yellow
;64 - purple
OutlineColor=16
;A key to press to reload your currently equipped weapon
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
@@ -178,6 +185,11 @@ DebugEditorKey=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Misc]
;Changes some of Fallout 2 engine functions to Fallout 1 behavior:
;- disables playing the final movie/credits after the endgame slideshow
;- disables halving the weight for power armor items
Fallout1Behavior=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
@@ -255,7 +267,7 @@ Movie16=artimer4.mve
Movie17=credits.mve
;To change the starting year, month or day, uncomment the next 3 lines
;Both StartMonth and StartDay are 0-indexed
;Both StartMonth and StartDay are 0-indexed (i.e. 0 is January or the first day of a month)
;StartYear=-1
;StartMonth=-1
;StartDay=-1
@@ -266,9 +278,6 @@ Movie17=credits.mve
;LocalMapXLimit=480
;LocalMapYLimit=400
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
;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
@@ -319,9 +328,6 @@ OverrideArtCacheSize=0
;Set to 2 to block all saving in combat
SaveInCombatFix=1
;Point at an ini file containing elevator data
;ElevatorsFile=Elevators.ini
;Uncomment and set a comma delimited list of numbers to use a custom xp table.
;Player's level is capped once the highest specified level is reached
;XPTable=50,100,200
@@ -332,14 +338,17 @@ SaveInCombatFix=1
AdditionalWeaponAnims=1
;Uncomment these lines to modify the default modifiers for aimed shots at specific bodyparts
;Modifiers affect both NPCs and the player
;BodyHit_Head=-40
;BodyHit_Left_Arm=-30
;BodyHit_Right_Arm=-30
;BodyHit_Torso_Uncalled=0
;BodyHit_Torso=0
;BodyHit_Right_Leg=-20
;BodyHit_Left_Leg=-20
;BodyHit_Eyes=-60
;BodyHit_Groin=-30
;The modifier for unaimed shots
;BodyHit_Torso_Uncalled=0
;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)
@@ -357,9 +366,6 @@ AlwaysReloadMsgs=0
;Set to 1 to force the player to play the idle animation when reloading their weapon
PlayIdleAnimOnReload=0
;Set to 1 to prevent corpses from blocking line of fire
CorpseLineOfFireFix=0
;Changes the timer (in days) for deleting corpses on a map after you leave (valid range: 0..13)
;The corpses of critters with 'Ages' flag or on maps with 'dead_bodies_age=No' set in maps.txt will not disappear
;Default is 6. Set to 0 for a 12-hour timer
@@ -372,6 +378,7 @@ CorpseDeleteTime=6
ProcessorIdle=-1
;Set to 1 if using the hero appearance mod
;Set to 2 for backward compatibility with scripts that manually fix obj_art_fid/art_change_fid_num script functions for dude_obj
;You can add AppChCrt.frm and AppChEdt.frm files to art\intrface\ to set a custom background for the character screen
EnableHeroAppearanceMod=0
@@ -384,8 +391,9 @@ SkipOpeningMovies=0
;Set to 0 to disable
NPCsTryToSpendExtraAP=0
;Set to 1 to fix NPCs not checking weapon perks properly when searching for the best weapon
;Note that enabling this option can significantly affect the weapon choice of some NPCs in combat
;Set to 1 to fix NPCs not checking weapon perks properly when choosing the best weapon in combat
;Set to 2 to change the priority multiplier for having weapon perk to 3x (the original is 5x)
;Note that enabling this option can significantly affect the weapon of choice for some NPCs
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
@@ -409,6 +417,9 @@ Doctor=293
Science=293
Repair=293
;Set to 1 to remove window position rounding for script-created windows
RemoveWindowRounding=1
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
;Set to 2 to use a different set of scroll buttons
UseScrollingQuestsList=1
@@ -420,16 +431,16 @@ UseScrollingQuestsList=1
;Uncomment these lines to control the premade characters offered when starting a new game
;Multiple options should be separated by commas, and there must be the same number of entries in both lines
;Each name in PremadePaths is limited to 11 characters
;PremadePaths=combat,diplomat,stealth
;PremadeFIDs=201,203,202
;Use this line to modify the list of cities and their associated global variables used for city reputations
;Syntax is 'city id:global id', with each city/global pair separated by a comma.
;CityRepsCount=19
;CityRepsList=0:47,2:48,1:49,4:50,5:51,3:52,8:53,6:54,7:55,13:56,10:57,11:59,14:61,17:63,19:64,18:65,25:66,9:294,20:308
;Set this to a valid path to save a copy of the console contents
;ConsoleOutputPath="bingle.txt"
;ConsoleOutputPath=console.txt
;Set to 1 to add additional pages of save slots
ExtraSaveSlots=0
@@ -441,7 +452,6 @@ SpeedInterfaceCounterAnims=0
;These lines allow you to control the karma FRMs displayed on the character screen
;Number of KarmaPoints should be 1 less than number of KarmaFRMs
;KarmaFRMsCount=3
;KarmaFRMs=47,48,49
;KarmaPoints=-100,100
@@ -452,8 +462,11 @@ ScienceOnCritters=0
;Default is 166
SpeedInventoryPCRotation=166
;Uncomment to set the text colour of the extra 5 interface boxes
;The line must contain 5 digits, each either a 0 for green or 1 for red
;Modify the number of the extra interface boxes available to modders. (Default is 5, and the maximum is 95)
BoxBarCount=5
;Uncomment to set the text colour of the extra interface boxes
;The line must contain the same number of digits as the value of BoxBarCount, 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.
@@ -471,12 +484,11 @@ 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
RemoveCriticalTimelimits=0
;Set to 1 to enable party members with level 6 protos to reach level 6
NPCStage6Fix=0
;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
;Change the colour of the font used on the main menu for the Fallout/sfall version number and copyright text
;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option
;MainMenuFontColour=0x00003C
;Change the colour of the font used on the main menu for the button text
;MainMenuBigFontColour=0x3C
;Two alternate fixes to the interaction between HtH attacks and the fast shot trait
;0 - Fallout 2 original behaviour
@@ -487,14 +499,6 @@ FastShotFix=1
;Set to 1 to boost the maximum number of script names from 1450 to 10000
BoostScriptDialogLimit=0
;Allows you to edit the skill tables
;Point the next line at an ini file containing the replacement skill data
;SkillsFile=Skills.ini
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
;See the Stats.ini in the modders pack for an example file
;DerivedStats=Stats.ini
;These options modify the checks to see if a critter can carry an additional item, changing which items are counted towards the weight limit and adding an additional size check
;Set the mode to 0 to disable the size check, 1 to apply to the PC only, 2 to apply to the PC and party members, or 3 to apply to all critters
;Only the PC uses CritterInvSizeLimit. Other critters will use the unused stat (STAT_unused = 10) or have the size limit of 100 if the stat is not set
@@ -576,17 +580,13 @@ ExplosionsEmitLight=0
;MovieTimer_artimer3=270
;MovieTimer_artimer4=360
;Set to 1 to enable the new arrays behavior
;Set to 1 to enable the new arrays behavior (default behavior)
;Set to 0 for backward compatibility with pre-3.4 scripts
arraysBehavior=1
;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot
CheckWeaponAmmoCost=0
;To add additional books to the game, uncomment the next line and point to a file containing book information
;See the Books.ini in the modders pack for an example file
;BooksFile=Books.ini
;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
CombatPanelAnimDelay=1000
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
@@ -612,7 +612,7 @@ StackEmptyWeapons=0
;If the amount of ammo boxes in the inventory is less than or equal to the reserve, only one box will be used
ReloadReserve=-1
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number except in the barter screen
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
ItemCounterDefaultMax=0
;Set to 1 to leave the music playing in dialogue with talking heads
@@ -628,10 +628,14 @@ UseWalkDistance=3
;Set to 1 to fix the bug of being 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
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenery/critters
;Set to 0 if another mod you're using has custom vehicles
CarChargingFix=1
;Set to 1 to prevent the car from being lost when entering a location via the Town/World button and then leaving on foot
;Note that the global variable 633 (GVAR_CAR_PLACED_TILE) will be set to -1 when the player leaves a location
CarPlacedTileFix=1
;Set to 1 to skip weapon equip/unequip animations when performing various actions
InstantWeaponEquip=0
@@ -665,13 +669,38 @@ SpecialDeathGVAR=491
;Note that enabling this option can break the map changes in Modoc and Vault 15
DisableSpecialMapIDs=0
;Changes the base value of the duration of the knockout effect (valid range: 35..100)
;Changes the base value of the duration of the knockout effect (valid range: 35..100; default is 35)
;The formula for the duration in ticks is: 10 * (value - 3 * EN)
KnockoutTime=35
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; Configuration ini files
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;To change the path and filename of the critical table file, uncomment the next line
;OverrideCriticalFile=sfall\CriticalOverrides.ini
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
;See the Stats.ini in the modders pack for an example file
;DerivedStats=sfall\Stats.ini
;Allows you to edit the skill tables
;Point the next line to an ini file containing the replacement skill data
;SkillsFile=sfall\Skills.ini
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
;PerksFile=sfall\Perks.ini
;To add additional books to the game, uncomment the next line and point to a file containing book information
;See the Books.ini in the modders pack for an example file
;BooksFile=sfall\Books.ini
;Point to an ini file containing elevator data
;ElevatorsFile=sfall\Elevators.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging]
;Extra sfall configuration settings that can be used by modders
@@ -681,7 +710,8 @@ CreditsAtBottom=0
Enable=0
;Fallout 2 Debug Patch
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and a debug.log file
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and debug.log
;Does not require sfall debugging mode
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
;-------
;[debug]
@@ -691,11 +721,14 @@ Enable=0
;show_script_messages=1
;show_tile_num=1
;[sound]
;debug=1
;debug_sfxc=1
;debug=0
;debug_sfxc=0
;-------
DebugMode=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
;Change to 1 to skip the compatibility mode check
SkipCompatModeCheck=0
@@ -713,17 +746,14 @@ SkipSizeCheck=0
DontDeleteProtos=0
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
;Does not require sfall debugging mode
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
;Set to 1 to force critters to display combat float messages
;Requires AllowSoundForFloats to be enabled
Test_ForceFloats=0
;These options control what output is saved in the debug log (sfall-log.txt)
;Prints messages duing sfall initialization
Init=0
;Prints messages relating to hook scripts
@@ -0,0 +1,206 @@
/*
Example algorithm of how the game engine calculates combat damage
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
procedure start;
procedure compute_damage_F2;
procedure item_w_damage_hook;
procedure item_w_subtype(variable weapon, variable hit_mode);
procedure get_ammo_value(variable weapon, variable param);
variable item_w_damage;
procedure start begin
if game_loaded then begin
register_hook_proc(HOOK_COMBATDAMAGE, compute_damage_F2);
register_hook_proc(HOOK_ITEMDAMAGE, item_w_damage_hook);
end
end
procedure compute_damage_F2 begin
variable dmg_type, weapon_perk, dmg_thresh, dmg_resist, weapon_subtype, bonus_ranged, difficulty, i, dmg_mult, dmg_div, damage;
variable target, flags, knockback, amount;
variable
ctdTarget := get_sfall_arg,
ctdSource := get_sfall_arg,
amountTarget := get_sfall_arg,
amountSource := get_sfall_arg,
flagsTarget := get_sfall_arg,
flagsSource := get_sfall_arg,
weapon := get_sfall_arg,
bodypart := get_sfall_arg,
damageMultiplier := get_sfall_arg,
rounds := get_sfall_arg,
amountKnockback := get_sfall_arg,
hit_mode := get_sfall_arg;
if (flagsSource bwand DAM_HIT) then begin
target := ctdTarget;
flags := flagsTarget;
knockback := 1;
end else begin
target := ctdSource;
flags := flagsSource;
knockback := 0;
end
//amount := 0;
if target and (obj_type(target) == OBJ_TYPE_CRITTER) then begin
if weapon then begin
dmg_type := weapon_dmg_type(weapon);
weapon_perk := get_proto_data(obj_pid(weapon), PROTO_WP_PERK);
end else begin
dmg_type := DMG_normal_dam;
weapon_perk := -1;
end
dmg_thresh := get_critter_stat(target, STAT_dmg_thresh + dmg_type);
dmg_resist := get_critter_stat(target, STAT_dmg_resist + dmg_type);
if (flags bwand DAM_BYPASS) and (dmg_type != DMG_emp) then begin
dmg_thresh := dmg_thresh * 20 / 100;
dmg_resist := dmg_resist * 20 / 100;
end else begin
if (weapon_perk == PERK_weapon_penetrate)
or (hit_mode == ATKTYPE_PALMSTRIKE or hit_mode == ATKTYPE_PIERCINGSTRIKE
or hit_mode == ATKTYPE_HOOKKICK or hit_mode == ATKTYPE_PIERCINGKICK) then
dmg_thresh := dmg_thresh * 20 / 100;
if ctdSource == dude_obj and has_trait(TRAIT_TRAIT, ctdSource, TRAIT_finesse) then
dmg_resist += 30;
end
weapon_subtype := item_w_subtype(weapon, hit_mode); // item_w_subtype_
if (ctdSource != dude_obj) or (weapon_subtype != WEAPON_TYPE_GUNS) then
bonus_ranged := 0;
else
bonus_ranged := has_trait(TRAIT_PERK, ctdSource, PERK_bonus_ranged_damage) * 2;
difficulty := 100;
if (has_trait(TRAIT_OBJECT, ctdSource, OBJECT_TEAM_NUM) != has_trait(TRAIT_OBJECT, dude_obj, OBJECT_TEAM_NUM)) then begin
if (combat_difficulty == 0) then
difficulty := 75;
else if (combat_difficulty == 2) then
difficulty := 125;
end
// F2 default start
// Damage = (1 - (DR_armor + DR_ammo_adjust) * (((raw_damage * (dmg_mult * damageMultiplier)) / dmg_div) - dmg_thresh)
dmg_resist += get_ammo_value(weapon, PROTO_AM_DR_MOD); // item_w_dr_adjust_ (DR Adjust %)
if (dmg_resist < 100) then begin
if (dmg_resist < 0) then dmg_resist := 0;
dmg_mult := damageMultiplier * get_ammo_value(weapon, PROTO_AM_DMG_MULT); // item_w_dam_mult_ (Dmg mod A)
dmg_div := get_ammo_value(weapon, PROTO_AM_DMG_DIV); // item_w_dam_div_ (Dmg mod B)
for (i := 1; i <= rounds; i++) begin
damage := (item_w_damage + bonus_ranged) * dmg_mult; // item_w_damage_ (raw_damage)
if dmg_div then damage /= dmg_div;
damage := (((damage / 2) * difficulty) / 100) - dmg_thresh;
if (damage > 0) then begin
damage := damage - ((damage * dmg_resist) / 100); // reduce damage by the percentage of DR_armor + DR_Ammo
if (damage > 0) then amount += damage;
end
end
end
// F2 default end
if (ctdSource == dude_obj) then begin
if has_trait(TRAIT_PERK, ctdSource, PERK_living_anatomy_perk) and (critter_kill_type(ctdTarget) != KILL_TYPE_robot_kills)
and (critter_kill_type(ctdTarget) != KILL_TYPE_alien_kills) then
amount += 5;
if has_trait(TRAIT_PERK, ctdSource, PERK_pyromaniac_perk) and (dmg_type == DMG_fire) then
amount += 5;
end
if knockback and ((get_flags(target) bwand FLAG_MULTIHEX) == 0)
and (dmg_type == DMG_explosion or weapon == 0 or weapon_subtype == WEAPON_TYPE_MELEE)
and ((get_proto_data(obj_pid(target), PROTO_CR_FLAGS) bwand CFLG_NOKNOCKDOWN) == 0) then begin // critter_flag_check_
damage := 0;
if (target == dude_obj) and has_trait(TRAIT_PERK, target, PERK_stonewall_perk) then begin
damage := 1;
if (random(0, 100) < 50) then knockback := 0;
end
if knockback then begin
if (weapon_perk == PERK_weapon_knockback) then
amountKnockback := amount / 5;
else
amountKnockback := amount / 10;
if damage then amountKnockback /= 2;
end
end
end
if (flagsSource bwand DAM_HIT) then begin
display_msg("amountTarget = " + amountTarget+ ", amount = " + amount);
amountTarget := amount;
flagsTarget := flags;
end else begin
display_msg("amountSource = " + amountSource+ ", amount = " + amount);
amountSource := amount;
flagsSource := flags;
end
set_sfall_return(amountTarget);
set_sfall_return(amountSource);
set_sfall_return(flagsTarget);
set_sfall_return(flagsSource);
set_sfall_return(amountKnockback);
end
procedure item_w_damage_hook begin
variable
item_w_damage_min := get_sfall_arg,
item_w_damage_max := get_sfall_arg;
//weapon := get_sfall_arg,
//source := get_sfall_arg,
//hit_mode := get_sfall_arg,
//isMelee := get_sfall_arg;
item_w_damage := (item_w_damage_min + (item_w_damage_max - item_w_damage_min) / 2);
display_msg("item_w_damage_ = " + item_w_damage);
set_sfall_return(item_w_damage);
end
procedure item_w_subtype(variable weapon, variable hit_mode) begin
variable attack_mode, type := WEAPON_TYPE_UNARMED;
if weapon and (hit_mode <= ATKTYPE_RWEP2) then begin
attack_mode := (get_proto_data(obj_pid(weapon), PROTO_IT_FLAGS));
if (hit_mode == ATKTYPE_LWEP2) or (hit_mode == ATKTYPE_RWEP2) then
attack_mode := (attack_mode bwand 0xF0) / 16; // shift 4 bits to the right
else
attack_mode := (attack_mode bwand 0x0F);
if (attack_mode > ATKMODE_PRI_THROW) then
type := WEAPON_TYPE_GUNS;
else if (attack_mode == ATKMODE_PRI_THROW) then
type := WEAPON_TYPE_THROWN;
else if (attack_mode > ATKMODE_PRI_KICK) then
type := WEAPON_TYPE_MELEE;
end
return type;
end
procedure get_ammo_value(variable weapon, variable param) begin
variable pid := -1, value := 0; // default DR value
if weapon then begin
pid := get_weapon_ammo_pid(weapon);
if (pid > -1) then value := get_proto_data(pid, param);
end
if (pid == -1 and param != PROTO_AM_DR_MOD) then value := 1; // default value for Mult/Div
return value;
end
@@ -0,0 +1,116 @@
// Status: WIP
texture bloomMap;
sampler s0;
sampler BloomSampler : samplerstate
{
Texture = bloomMap;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
// pseudo gauss blur
static const float2 offsets[12] = {
-0.326212, -0.405805,
-0.840144, -0.073580,
-0.695914, 0.457137,
-0.203345, 0.620716,
0.962340, -0.194983,
0.473434, -0.480026,
0.519456, 0.767022,
0.185461, -0.893124,
0.507431, 0.064425,
0.896420, 0.412458,
-0.321940, -0.932615,
-0.791559, -0.597705,
};
float w;
float h;
static const float2 resolution = float2(w, h);
// blur setting
static const float blurFalloff = 8;
static const float sharpness = 4;
float4 AdjustSaturation(float4 color, float saturation) {
float grey = dot(color, float3(0.3, 0.59, 0.11));
return lerp(grey, color, saturation);
}
float Brightness(float3 color)
{
return color.r * color.g - 0.75 * color.b;
}
float3 BlurFunction(float2 uv, float brightness, inout float totalWeight)
{
float3 pointColor =(tex2Dlod(s0, float4(uv, 0, 0)).rgb);
float diff = abs(brightness - Brightness(pointColor));
float weight = exp2(-0.25 * blurFalloff - diff * sharpness);
totalWeight += weight;
return pointColor * weight;
}
float4 BlurPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
{
float3 sumColor = (tex2D(s0, uv).rgb);
float totalWeight = 1;
float brightness = Brightness(sumColor);
delta *= (1 / resolution);
float radius = 1;
float2 pointUV = uv + delta * radius;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - delta * radius;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight),1);
// return AdjustSaturation(Color, 0.5);
}
float4 BloomT(float2 texCoord : TEXCOORD0) : COLOR0 {
float4 c = tex2D(s0, texCoord);
float BloomThreshold = 0.2;
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
}
float4 Bloom(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 {
float BaseIntensity = 1.0;
float BaseSaturation = 1;
float BloomIntensity = 1; // 0.4
float BloomSaturation = 0.5;
float BlurPower = 0.01;
float BloomThreshold = 0.5;
float4 original = tex2D(s0, texCoord);
// blur
float4 sum = tex2D(s0, texCoord);
for(int i = 0; i < 12; i++){
sum += tex2D(s0, texCoord + BlurPower * offsets[i]);
}
sum /= 13;
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
sum = AdjustSaturation(sum, BloomSaturation) * BloomIntensity;
sum = saturate((sum - BloomThreshold) / (1 - BloomThreshold));
return sum + original;
// return sum;
}
technique Blur
{
// pass P2 { PixelShader = compile ps_2_0 BloomT(); }
// pass P3 { PixelShader = compile ps_2_0 Bloom(); }
Pass P0 { PixelShader = compile ps_3_0 BlurPS(float2(1, 0)); }
Pass P1 { PixelShader = compile ps_3_0 BlurPS(float2(0, 1)); }
}
@@ -2,29 +2,45 @@
#include "..\scripting\headers\sfall.h"
#include "..\scripting\headers\define_lite.h"
#include "..\scripting\headers\define_extra.h"
#include "..\scripting\headers\dik.h"
/*
#include "..\scripting\headers\lib.arrays.h"
#include "..\scripting\headers\lib.strings.h"
// #include "..\scripting\headers\lib.inven.h"
#include "..\scripting\headers\lib.inven.h"
*/
variable ini := "sfall-mods.ini";
variable translationIni;
// Gets the integer value from ini
// Gets the integer value from the specified ini
procedure GetIniConfig(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_setting(inifile + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from the specified ini
procedure GetIniConfigStr(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_string(inifile + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the integer value from sfall-mods.ini
procedure GetConfig(variable section, variable key, variable def) begin
variable val := get_ini_setting(ini + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from ini
// Gets the string value from sfall-mods.ini
procedure GetConfigStr(variable section, variable key, variable def) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the value from ini as a temp array of strings
// Gets the value from sfall-mods.ini as a temp array of strings
procedure GetConfigList(variable section, variable key) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then return [];
@@ -32,7 +48,7 @@ procedure GetConfigList(variable section, variable key) begin
return string_split(val, ",");
end
// Gets the value from ini as a temp array of ints
// Gets the value from sfall-mods.ini as a temp array of ints
procedure GetConfigListInt(variable section, variable key) begin
variable arr, i, item;
@@ -53,5 +69,5 @@ procedure Translate(variable id, variable def) begin
end
procedure InitConfigs begin
translationIni := GetConfigStr("Main", "TranslationsINI", "./Translations.ini");
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
end
+2 -2
View File
@@ -1,5 +1,5 @@
Master Theif cheat for fallout 2 by phobos2077
----------------------------------------
Master Thief cheat for fallout 2 by phobos2077
----------------------------------------------
- forces all steal attempts to succeed
@@ -1,20 +0,0 @@
procedure start;
// adjust include paths if needed
#include "..\..\scripting_docs\headers\sfall.h"
#include "..\..\scripting_docs\headers\dik.h"
procedure start begin
if game_loaded then begin
register_hook(HOOK_KEYPRESS);
end else begin
variable
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
@@ -1,9 +0,0 @@
"Take All" Hotkey mod for Fallout 2 by NovaRain
----------------------------------------
- makes pressing the semicolon key send an uppercase A after a semicolon.
- Note: 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 *.int file to your scripts folder.
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
Binary file not shown.
@@ -0,0 +1,54 @@
/*
UI Hotkeys mod for Fallout 2 by NovaRain
----------------------------------------
- closes some game interfaces by pressing their hotkeys again:
* 'I' key for Inventory
* 'S' key for Skilldex
* 'Z' key for Pip-Boy
- extends the functionality of the 'Space' key (Caps Lock must be off):
* takes all items in the loot screen
* makes the offer in the barter screen
Requires sfall 3.5 or higher
*/
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\dik.h"
procedure start;
procedure start begin
if game_loaded then begin
register_hook(HOOK_KEYPRESS);
end else begin
variable
event := get_sfall_arg,
keyDX := get_sfall_arg,
mode;
if (event) then begin
mode := get_game_mode;
if (mode bwand COUNTERWIN) then return; // new mode from sfall 4.2/3.8.20
if (keyDX == DIK_I and (mode bwand INVENTORY)) then begin
tap_key(DIK_ESCAPE);
end else if (keyDX == DIK_S and (mode bwand SKILLDEX)) then begin
tap_key(DIK_ESCAPE);
end else if (keyDX == DIK_Z and (mode bwand PIPBOY)) then begin
tap_key(DIK_ESCAPE);
end else if (keyDX == DIK_SPACE) then begin
if (mode bwand INTFACELOOT) then begin
tap_key(DIK_CAPITAL);
tap_key(DIK_A);
tap_key(DIK_CAPITAL);
end else if (mode bwand BARTER) then begin
play_sfx("IB2P1XX1");
tap_key(DIK_M);
end
end
end
end
end
@@ -0,0 +1,22 @@
UI Hotkeys mod for Fallout 2 by NovaRain
----------------------------------------
- closes some game interfaces by pressing their hotkeys again:
* 'I' key for Inventory
* 'S' key for Skilldex
* 'Z' key for Pip-Boy
- extends the functionality of the 'Space' key (Caps Lock must be off):
* takes all items in the loot screen
* makes the offer in the barter screen
- Note:
* the uppercase 'A' (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen
* the lowercase 'm' is the built-in hotkey for the OFFER button on the barter screen
Requires sfall 3.5 or higher
To use, copy gl_uihotkeys.int to your scripts folder.
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
+2
View File
@@ -212,9 +212,11 @@ use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfa
- always returns 0
> void save_array(mixed key, int arrayID):
- makes the array saveable; it will be saved in sfallgv.sav file when saving the game
- arrayID is associated with given "key"
- array becomes permanent (if it was temporary) and "saved"
- key can be of any type (int, float or string)
- if you specify 0 as the key for the array ID, it will make the array "unsaved"
> int load_array(mixed key):
- load array from savegame data by the same key provided in "save_array"
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -2,6 +2,16 @@
#ifndef DEFINE_EXTRA_H
#define DEFINE_EXTRA_H
#define BODY_HIT_HEAD (0)
#define BODY_HIT_LEFT_ARM (1)
#define BODY_HIT_RIGHT_ARM (2)
#define BODY_HIT_TORSO (3)
#define BODY_HIT_RIGHT_LEG (4)
#define BODY_HIT_LEFT_LEG (5)
#define BODY_HIT_EYES (6)
#define BODY_HIT_GROIN (7)
#define BODY_UNCALLED (8)
#define OBJ_TYPE_ITEM (0)
#define OBJ_TYPE_CRITTER (1)
#define OBJ_TYPE_SCENERY (2)
@@ -31,6 +41,7 @@
#define WEAPON_BIGGUN 256 // 0x00000100 - Big Gun
#define WEAPON_2HAND 512 // 0x00000200 - 2Hnd (weapon is two-handed)
#define WEAPON_ENERGY 1024 // 0x00000400 - Energy Weapon (forces weapon to use Energy Weapons skill)
#define ATKMODE_PRI_NONE 0
#define ATKMODE_PRI_PUNCH 1 // 0001
@@ -76,7 +87,6 @@
#define FLAG_SEEN (0x40000000)
#define FLAG_SHOOTTHRU (0x80000000)
/* Critter Flags */
#define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with)
#define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot steal from)
@@ -90,6 +100,13 @@
#define CFLG_RANGED 8192 // 0x00002000 - Range (melee attack is possible at a distance)
#define CFLG_NOKNOCKDOWN 16384 // 0x00004000 - Knock (cannot be knocked down)
/* Window Flags */
#define WIN_FLAG_MOVEONTOP (0x4)
#define WIN_FLAG_HIDDEN (0x8)
#define WIN_FLAG_EXCLUSIVE (0x10)
#define WIN_FLAG_TRANSPARENT (0x20)
//remove inven obj defines
#define RMOBJ_CONSUME_DRUG 4666772
#define RMOBJ_CONTAINER 4683293 // same as RMOBJ_TRADE
@@ -109,7 +126,7 @@
#define RMOBJ_RM_MULT_OBJS 4563866
#define RMOBJ_REPLACE_WEAPON 4658526
#define RMOBJ_THROW 4266040
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from a container inside of an inventory
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from nested containers in the inventory
// common prototype offsets for get/set_proto_data
#define PROTO_PID (1)
@@ -300,10 +317,11 @@
#define OBJ_DATA_FID (0x20)
#define OBJ_DATA_ELEVATION (0x28)
#define OBJ_DATA_PID (0x64)
#define OBJ_DATA_CID (0x68) // combat id, used for savegame
#define OBJ_DATA_SID (0x78)
#define OBJ_DATA_CID (0x68) // combat ID, used for savegame
#define OBJ_DATA_SID (0x78) // script ID
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
// items
#define OBJ_DATA_CUR_CHARGES (0x3C)
#define OBJ_DATA_CUR_CHARGES (0x3C) // for key items it's the key code
// 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)
+33 -8
View File
@@ -1,6 +1,5 @@
//Recognised modes for set_shader_mode and get_game_mode
#define WORLDMAP (0x1)
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
#define DIALOG (0x4)
#define ESCMENU (0x8)
#define SAVEGAME (0x10)
@@ -17,6 +16,9 @@
#define INTFACEUSE (0x8000)
#define INTFACELOOT (0x10000)
#define BARTER (0x20000)
#define HEROWIN (0x40000)
#define DIALOGVIEW (0x80000)
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
//Valid arguments to register_hook
#define HOOK_TOHIT (0)
@@ -57,7 +59,8 @@
#define LIST_ALL (9)
//Valid flags for force_encounter_with_flags
#define ENCOUNTER_FLAG_NO_CAR (1)
#define ENCOUNTER_FLAG_NO_CAR (1)
#define ENCOUNTER_FLAG_LOCK (2) // block new forced encounter by the next function call until the current specified encounter occurs
//The attack types returned by get_attack_type
#define ATKTYPE_LWEP1 (0)
@@ -126,12 +129,13 @@
#define reverse_array(array) resize_array(array, -4)
// randomly shuffle elements in list/map
#define shuffle_array(array) resize_array(array, -5)
// sort map in ascending order by value
// sort map in ascending order by key 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)
// sort map in descending order by key value
#define sort_map_reverse(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
#define key_pressed_vk(key) (key_pressed(key bwor 0x80000000))
@@ -219,6 +223,9 @@
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks
// sfall_funcX macros
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
#define add_iface_tag sfall_func0("add_iface_tag")
#define add_trait(traitID) sfall_func1("add_trait", traitID)
#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)
@@ -226,15 +233,21 @@
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
#define dialog_obj sfall_func0("dialog_obj")
#define display_stats sfall_func0("display_stats")
#define draw_image(pathFile, frame, x, y, noTrans) sfall_func5("draw_image", pathFile, frame, x, y, noTrans)
#define draw_image_scaled(pathFile, frame, x, y, w, h) sfall_func6("draw_image_scaled", pathFile, frame, x, y, w, h)
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
#define floor2(value) sfall_func1("floor2", value)
#define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj)
#define get_cursor_mode sfall_func0("get_cursor_mode")
#define get_flags(obj) sfall_func1("get_flags", obj)
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define get_metarule_table sfall_func0("get_metarule_table")
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
#define get_outline(obj) sfall_func1("get_outline", obj)
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
#define get_text_width(text) sfall_func1("get_text_width", text)
#define hide_window(winName) sfall_func1("hide_window", winName)
#define intface_hide sfall_func0("intface_hide")
#define intface_is_hidden sfall_func0("intface_is_hidden")
#define intface_redraw sfall_func0("intface_redraw")
@@ -243,19 +256,31 @@
#define item_weight(obj) sfall_func1("item_weight", obj)
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
#define loot_obj sfall_func0("loot_obj")
#define metarule_exist(metarule) sfall_func1("metarule_exist", metarule)
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
#define obj_under_cursor(crSwitch, inclDude) sfall_func2("obj_under_cursor", crSwitch, inclDude)
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
#define objects_in_radius(tile, radius, elev, type) sfall_func4("objects_in_radius", tile, radius, elev, type)
#define outlined_object sfall_func0("outlined_object")
#define real_dude_obj sfall_func0("real_dude_obj")
#define remove_all_timer_events sfall_func0("remove_timer_event")
#define remove_timer_event(fixedParam) sfall_func1("remove_timer_event", fixedParam)
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
#define set_iface_tag_text(tag, text, color) sfall_func3("set_iface_tag_text", tag, text, color)
#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 set_unique_id(obj) sfall_func1("set_unique_id", obj)
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
#define set_window_flag(winID, flag, value) sfall_func3("set_window_flag", winID, flag, value)
#define show_window(winName) sfall_func1("show_window", winName)
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
#define string_format(format, a1, a2) sfall_func3("string_format", format, a1, a2)
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
#define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
+23 -19
View File
@@ -10,8 +10,6 @@ To aid in mods compatibility, avoid using hs_xxx .int scripts. Instead it is rec
Example setup for a hook-script based mod:
procedure tohit_hook_handler begin
display_msg("Modifying hit_hook " + get_sfall_arg);
set_hit_chance_max(100);
@@ -25,8 +23,6 @@ procedure start begin
end
There are script functions available, specific to hook scripts:
> int init_hook()
@@ -34,6 +30,7 @@ The hook script equivalent of game_loaded; it returns 2 when the script is first
> mixed get_sfall_arg()
Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left.
You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.
> array get_sfall_args()
Returns all hook arguments as a new temp array.
@@ -41,14 +38,17 @@ Returns all hook arguments as a new temp array.
> void set_sfall_return(int value)
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
> void set_sfall_arg(int argnum, int value)
Changes argument value. The argument number (argnum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
> void set_sfall_arg(int argNum, int value)
Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
> void register_hook(int hooktype)
> void register_hook(int hookID)
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be executed in a current global script. You can use all above functions like normal.
> void register_hook_proc(int hooktype, proc procedure)
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start"). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
> void register_hook_proc(int hookID, procedure proc)
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
> void register_hook_proc_spec(int hookID, procedure proc)
Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using register_hook/register_hook_proc functions.
NOTE: you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with "set_sfall_return", the next script may override this value if calls "set_sfall_return" again. Sometimes you need to multiply certain value in a chain of hook scripts.
Example: let's say we have a Mod A which reduces all "to hit" chances by 50%. The code might look like this:
@@ -69,7 +69,7 @@ This basically changes hook argument for the next script. Mod B code:
So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use "set_sfall_arg" in both hooks).
The defines to use for the hooktype are in sfall.h.
The defines to use for the hookID are in sfall.h.
-------------------------------------------
----------- HOOK SCRIPT TYPES -------------
@@ -189,9 +189,11 @@ 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. If you want to specify less than 4 targets, fill in the extra spaces with 0's. Pass -1 to skip the return value.
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.
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.
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
critter arg1 - The attacker
critter arg2 - A possible target
@@ -248,13 +250,14 @@ Obj arg1 - the owner that the object is being removed from
item arg2 - the item that is being removed
int arg3 - the number of items to remove
int arg4 - The reason the object is being removed (see RMOBJ_* constants)
Obj arg5 - The destination object when the item is moved to another object, otherwise 0
Obj arg5 - The destination object when the item is moved to another object, 0 otherwise
-------------------------------------------
HOOK_BARTERPRICE (hs_barterprice.int)
Runs whenever the value of goods being purchased is calculated
NOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC
critter arg1 - the critter doing the bartering (either dude_obj or inven_dude)
critter arg2 - the critter being bartered with
@@ -264,7 +267,8 @@ int arg5 - the amount of actual caps in the barter stack (as opposed to good
int arg6 - the value of all goods being traded before skill modifications
critter arg7 - table of offered goods (being sold to NPC)
int arg8 - the total cost of the goods offered by the player
int arg9 - set 1 if the "offers" button was pressed (not for a party member), otherwise 0
int arg9 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise
int arg10 - 1 if trading with a party member, 0 otherwise
int ret1 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)
int ret2 - the modified value of all offered goods
@@ -284,10 +288,10 @@ int ret1 - the new AP cost
-------------------------------------------
(DEPRECATED)
hs_hexmoveblocking.int
hs_hexaiblocking.int
hs_hexshootblocking.int
hs_hexsightblocking.int
HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)
HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)
HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)
HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
@@ -334,7 +338,6 @@ int arg4 - Type of hook (0 - when subtracting ammo after single shot attack,
int ret1 - new ammo cost value (set to 0 for unlimited ammo)
-------------------------------------------
HOOK_KEYPRESS (hs_keypress.int)
@@ -431,7 +434,7 @@ int ret1 - Override setting (-1 - use engine handler, any other value - prev
HOOK_INVENWIELD (hs_invenwield.int)
Runs before wielding or unwielding an armor or a weapon by a critter (except when using inventory by PC).
Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the 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 is already equipped when wielding hook is executed.
@@ -440,5 +443,6 @@ Critter arg1 - critter
Obj arg2 - item being wielded or unwielded (weapon/armor)
int arg3 - slot (INVEN_TYPE_*)
int arg4 - 1 when wielding, 0 when unwielding
int arg5 - 1 when removing an equipped item from inventory, 0 otherwise
int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED
+115 -9
View File
@@ -24,7 +24,7 @@ The input functions are only available if the user has the input hook turned on
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
load_shader takes a path relative to the data\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
load_shader takes a path relative to the <GameRoot>\<master_patches>\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
get_shader_version gives you the highest shader version supported by the player's graphics cards. Possible return values are 11, 12, 13, 14, 20, 21 and 30.
@@ -50,7 +50,7 @@ has_fake_trait and has_fake_perk return the number of levels the player has of t
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 player's traits, if bit 2 is set it is added to the player's 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.
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 (4 + the value of BoxBarCount in ddraw.ini) 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.
get/set_bodypart_hit_modifier alter the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload.
@@ -153,12 +153,13 @@ array - array ID to be used with array-related functions (actually an integer)
- accepts a pointer to an object and will remove the script from that object.
> 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)
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accepts the same values as create_object_sid)
- 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(object)
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or -1 if the object is unscripted.
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted.
- returns -1 on argument error.
> void set_self(int obj)
- overrides the scripts self_obj for the next function call.
@@ -218,6 +219,9 @@ Some additional reg_anim_* functions were introduced. They all work in the same
> void reg_anim_turn_towards(object, tile/target, delay)
- makes object change its direction to face given tile num or target object.
> void reg_anim_callback(procedure proc)
- adds the given procedure to an animation sequence-list and executes it in the registered sequence.
> int metarule2_explosions(int arg1, int arg2, int arg3)
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:
@@ -245,7 +249,10 @@ Some utility/math functions are available:
- 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)
- 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")
- cuts a substring from a string starting at "start" up to "length" characters. The first character position is 0 (zero).
- 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").
- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22
> int strlen(string string)
- returns string length
@@ -302,6 +309,10 @@ Some utility/math functions are available:
- second argument should be passed just like you pass procedures to functions like gsay_option, giq_option, etc (name without quotes)
- see "hookscripts.txt" for more details
> void register_hook_proc_spec(int hook, procedure proc)
- works just like "register_hook_proc", but allows to register a script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script)
- to unregister hook script from current global script, use the register_hook_proc function
> string message_str_game(int fileId, int messageId)
- works exactly the same as message_str, except you get messages from files in "text\<language>\game\" directory
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
@@ -439,6 +450,12 @@ Some utility/math functions are available:
- 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
> void sfall_func1("set_unjam_locks_time", int time)
- sets after how many hours (up to 127 hours) jammed locks will be unjammed if the player leaves the map
- also disables the auto unjam that occurs at midnight when the player is on the map
- passing 0 will disable the auto unjam mechanism completely
- The auto unjam mechanism will be reset each time the player reloads the game
> 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
@@ -452,9 +469,20 @@ Some utility/math functions are available:
> int sfall_func0("attack_is_aimed")
- returns 1 if the aimed attack mode is selected, 0 otherwise
> void sfall_func3("set_iface_tag_text", int tag, string text, int color)
- sets the text messages and colors for custom notification boxes to the interface without the need to add messages to intrface.msg and set up the font colors in ddraw.ini
- tag value is the same as used in show_iface_tag, hide_iface_tag, and is_iface_tag_active. The valid range is from 5 to (4 + the value of BoxBarCount in ddraw.ini) or the number of the last custom box added using the add_ifaca_tag function
- The text is limited to 19 characters
- available colors: 0 - green, 1 - red, 2 - white, 3 - yellow, 4 - dark yellow, 5 - blue, 6 - purple, 7 - dull pink
> int sfall_func0("add_iface_tag")
- adds one custom box to the current boxes, and returns the number of the added tag (-1 if the tags limit is exceeded)
- The maximum number of boxes is limited to 126 tags
> void sfall_func0("inventory_redraw")
> void sfall_func1("inventory_redraw", int invSide)
- redraws inventory list in the inventory/use inventory item on/loot/barter screens
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens)
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
> int sfall_func1("get_current_inven_size", object)
- returns the current inventory size of the container or the critter
@@ -467,10 +495,11 @@ Some utility/math functions are available:
> object sfall_func0("dialog_obj")
- returns a pointer to the object (critter) the player is having a conversation or bartering with
> object sfall_func2("obj_under_cursor", bool crSwitch, bool inclDude)
> object sfall_func2("obj_under_cursor", bool onlyCritter, bool includeDude)
- 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
- onlyCritter: 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 includeDude argument will ignore dude_obj
> object sfall_func0("loot_obj")
- returns a pointer to the target object (container or critter) of the loot screen
@@ -497,6 +526,83 @@ Some utility/math functions are available:
- there is also a unique ID number range for the player and party members from 18000 to 83535
- to assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument
> void sfall_func5("draw_image", string/int pathFile/artId, int frame, int x, int y, bool noTransparent)
> void sfall_func6("draw_image_scaled", string/int pathFile/artId, int frame, int x, int y, int width, int height)
- displays the specified PCX or FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
- pathFile/artId: path to the PCX/FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
optional arguments:
- frame: frame number, the first frame starts from zero
- x/y: offset relative to the top-left corner of the window
- width/height: image size, used to scale the image when displaying it. Pass -1 to either width or height to keep the aspect ratio when scaling
- noTransparent: pass true to display an image without transparent background
- NOTE: to omit optional arguments starting from the right, call the functions with different sfall_funcX (e.g. sfall_func4("draw_image", pathFile, frame, x, y))
- if draw_image_scaled is called without x/y/width/height arguments, the image will be scaled to fit the window without transparent background
> void sfall_func2("unwield_slot", object critter, int slot)
- unequips an item from the specified slot for a critter or the player
- can take off player's equipped item when the inventory is opened, or the player is in the barter screen
- slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h)
> void sfall_func1("add_trait", int traitID)
- adds the specified trait to the player
> int sfall_func0("get_inven_ap_cost")
- returns the current AP cost to access the inventory in combat
> void sfall_func2("add_g_timer_event", int time, int fixedParam)
- adds a timer event that calls the timed_event_p_proc procedure in the current global script
- time: the number of ticks after which the event timer is triggered
- fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function
> void sfall_func0("remove_timer_event")
- clears all set timer events for the current global script
> void sfall_func1("remove_timer_event", int fixedParam)
- removes all timer events with the specified 'fixedParam' value for the current global script
> mixed sfall_func1("get_sfall_arg_at", int argNum)
- gets the value of hook argument with the specified argument number (first argument of hook starts from 0)
> void sfall_func0("hide_window")
> void sfall_func1("hide_window", string winName)
- hides the specified or currently active (selected) script window
- winName: the window name, assigned to the window by the CreateWin/create_win function
> void sfall_func0("show_window")
> void sfall_func1("show_window", string winName)
- displays the specified hidden script window or the one previously hidden with the sfall_func0("hide_window") function
- winName: the window name, assigned to the window by the CreateWin/create_win function
> void sfall_func3("set_window_flag", string/int winName/winID, int flag, bool value)
- changes the specified flag for the created script or game interface window
- winName: the window name, assigned to the window by the CreateWin/create_win function
- winID: the ID number of the interface or script window obtained with the get_window_under_mouse function, or 0 for the current game interface
- flag: the flag to change (see WIN_FLAG_* constants in define_extra.h)
- value: true - set the flag, false - unset the flag
> int sfall_func1("get_text_width", string text)
- returns the text width in pixels for the currently set font
> bool sfall_func2("string_compare", string str1, string str2)
> bool sfall_func3("string_compare", string str1, string str2, int codePage)
- compares two strings case-insensitive, and returns True if the two strings are matched
- codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table
available encodings: 1250-1252, 866
> string sfall_func3("string_format", string format, any val1, any val2, ...)
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting up to 4 values
- formatting is only supported for %s and %d, and the format string is limited to 1024 characters
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
- passing -1 to the type argument or not specifying it will return all objects within the radius
- the radius is limited to 50 hexes
> int sfall_func2("tile_by_position", int x, int y)
- returns the tile number at the x, y position relative to the top-left corner of the screen
- if the position is outside of the range of tiles, it will return -1
------------------------
------ MORE INFO -------
------------------------
@@ -357,6 +357,9 @@
0x827b - any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
0x827d - void register_hook_proc_spec(int hook, procedure proc)
0x827e - void reg_anim_callback(procedure proc)
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini

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