Compare commits

..
122 Commits
Author SHA1 Message Date
NovaRain 76b0528e7f Merge branch 'develop' 2020-02-08 20:08:34 +08:00
NovaRain 87c4dd34f1 Updated stdafx.h and other code/doc files 2020-02-08 08:41:04 +08:00
NovaRain 7848e1612b Reverted part of changes in the previous commit 2020-02-07 19:16:37 +08:00
NovaRain 537bea45c0 Edited some wording in ddraw.ini and Enums.h 2020-02-07 10:03:16 +08:00
NovaRain a3f22b67d8 Fixed trying to loot corpses with the "NoSteal" flag (#280) 2020-02-06 10:45:40 +08:00
NovaRain c079d69291 Added the description for 'div' operator to notes.txt 2020-02-05 23:19:36 +08:00
NovaRain fc78983f77 Replaced all MAXINT with INT_MAX in QuestList.cpp (#279)
Added WINVER and _WIN32_WINNT defines to stdafx.h.
2020-02-05 16:15:40 +08:00
NovaRain 9122fcaf0c Fixed playing game movies with width less than 640px in DX9 mode
Fixed palette updating.
2020-02-05 09:46:24 +08:00
NovaRain aeb7ab4e32 Some code edits to ExtraSaveSlots.cpp 2020-02-04 10:58:14 +08:00
NovaRain 1f1c39a4bd Simplified the code in HeroAppearance.cpp 2020-02-03 11:21:43 +08:00
NovaRain 53b407b8a5 Added DivisionOperatorFix option for signed integer division (#278)
* it changes the behavior of vanilla division operator to use signed
integer division. Before it used signed division for floats but
unsigned for integers.

Added a new "div" operator for unsigned integer division.
Moved mathematical script functions from Utils.cpp to new Math.cpp.
Added include guard to sfall.h and main.h in modders pack.
2020-02-02 21:02:06 +08:00
NovaRain eb204f0a04 Fixed the barter button on the dialog window (from rotators repo)
* when first entering the dialog, it didn't animate on click.
2020-02-02 15:41:09 +08:00
NovaRain b5b2ef3b97 Reverted part of changes in previous commit 2020-02-02 13:49:32 +08:00
NovaRain c61fe596b1 Fixed palette in DX9 mode 2020-02-01 14:07:38 +08:00
NovaRain 1ac911a7c9 Fixed the timer event execution in global scripts 2020-01-31 01:14:00 +08:00
NovaRain 19f4901328 Small optimization for receiving/passing script arguments
* combined related engine interpreter functions into a single function
for aligning the compiled ASM code better.

Minor changes to some other code and documents.
2020-01-31 00:24:58 +08:00
NovaRain 90b547a472 Rewrote and rename "dialog_box" to "message_box"
Added support for '\n' control character to create_message_window.

Fix the playback of the speech sound file for the death screen.
2020-01-28 13:01:32 +08:00
NovaRain d812059030 Added "dialog_box" script function
Added a new attrType value to "get_window_attribute" function.
2020-01-27 20:41:21 +08:00
NovaRain fd11a5736e Fixed the timing of setting some game mode flags
* now WORLDMAP, PIPBOY, INVENTORY, INTFACEUSE, and INTFACELOOT are
toggled after creating/before deleting their corresponding interface
windows, same goes for triggering GameModeChange hook. (#276)

Fixed the array out of bounds bug in Skills.cpp.
2020-01-27 10:38:47 +08:00
NovaRain 863a232703 Added "set_town_title" script function
* for displaying custom title in floating text over a town.

Corrected some code.
2020-01-25 15:47:57 +08:00
NovaRain 869b3cf4bd Added some engine variables as fo::var constants
Removed redundant PlayAcm() from HeroAppearance.cpp.
2020-01-24 09:54:02 +08:00
NovaRain 27233d19a2 Removed TownMapHotkeysFix from ddraw.ini (always enabled)
Also move its code from Worldmap.cpp to BugFixes.cpp.
2020-01-23 23:13:50 +08:00
NovaRain b69640f09a Removed DisplaySecondWeaponRange from ddraw.ini (always enabled)
Minor edits to some code and documents.
2020-01-23 20:31:58 +08:00
NovaRain d387e009ee Added "get_window_attribute" script function (#276) 2020-01-22 21:13:22 +08:00
NovaRain 56f2ea46c2 Added a flashing icon to the Horrigan encounter
Minor edits to some code and documents.
2020-01-22 10:20:32 +08:00
NovaRain f57564c9ed Expanded the functionality of Fallout1Behavior
* calling endgame_movie now plays Movie11 or Movie12 depending on
the player's gender before the credits.

Added new flags to force_encounter_with_flags function.
2020-01-21 10:14:03 +08:00
NovaRain dc4c4c2524 Added a blinking icon to force_encounter/with_flags functions
* currently an icon is always shown for scripted force encounters.
2020-01-20 11:50:00 +08:00
NovaRain 957ed92498 Added a new hook: HOOK_ENCOUNTER
Added procedure and macros for unsigned integer comparison to lib.math.h.
2020-01-19 12:18:14 +08:00
NovaRain bf4c47d1c0 Added "set_terrain_name" script function
Fixed minor bugs in WorldMapTerrainInfo, TravelMarkerStyles features.

Minor edits to Console.cpp, Logging.cpp.
2020-01-18 17:28:05 +08:00
NovaRain 160a5b6053 Simplified the code of travel markers and string_to_case function
Added new addrs to CheckAddress.cpp.

Minor edits to some code and documents.
2020-01-17 21:53:41 +08:00
NovaRain 201fa1da0c Improved the avi playback function 2020-01-17 21:42:01 +08:00
NovaRain d1868d2eaf Combined tolower/toupper in previous commit to "string_to_case" 2020-01-16 20:33:36 +08:00
NovaRain dd7613c910 Added "tolower", "toupper" script functions
Renamed TravelMarkerDots to TravelMarkerStyles.
2020-01-16 09:34:53 +08:00
NovaRain 14e2ee2064 Fixed crashes in previous commit
* entering worldmap after teleport between maps.
* when clicking on worldmap when camera is away from player indicator.
2020-01-13 10:15:39 +08:00
NovaRain 39a89d50a1 Implemented TravelMarkerDots to replace TravelMarkerLength/Spaces
(from Rotators repo)
2020-01-12 20:22:38 +08:00
NovaRain 9dea6911a6 Moved the Combat Block patch from AI.cpp to new CombatBlocked.cpp
Added filter folders for the project files.

Updated credits.

Correction on ddraw.ini.
2020-01-10 10:42:06 +08:00
NovaRain fece180f0b Fixed duplicate critters being added to the target list for AI
Edited hookscripts.txt to mention the fix.

Tweaked the default settings for world map travel markers.

Some code correction.
2020-01-09 11:38:44 +08:00
NovaRain af049eaa38 Added WorldMapTerrainInfo option for toggling the display
Minor code refactoring in MiscPatches/PlayerModel modules.

Updated compiler document.
2020-01-08 16:50:49 +08:00
NovaRain e0305983de Added sslc documents to repo
Updated credits.

Minor edit to ddraw.ini.
2020-01-06 14:12:29 +08:00
NovaRain 323738f584 Rewrote DialogGenderWords option to allow more than one word (#274)
Re-fixed setting DIALOG game mode flag.
2020-01-06 00:20:22 +08:00
NovaRain 310a0df8f6 Fixed the timing of setting DIALOG game mode flag
(also fixed the issue of DialogGenderWords mentioned in previous commit)

Fixed AI disposition values in define_extra.h.
Minor code edits to world map travel markers.
2020-01-05 09:55:28 +08:00
NovaRain db4652c105 Added DialogGenderWords option to specify gender words for dialog msg
* they will be displayed depending on the player's gender.

* currently does not work for messages constructed with message_str.
2020-01-04 22:59:11 +08:00
NovaRain 5d9d11b4f5 Changed terrain type to not be displayed when in a location circle
Minor code correction.
2020-01-04 10:23:38 +08:00
NovaRain 756356dbf2 Added displaying terrain types on the world map
(from Rotators repo)
2020-01-03 10:12:03 +08:00
NovaRain fad2928fbf Added customization options to WorldTravelMarkers 2020-01-02 11:09:47 +08:00
NovaRain 85e70fe056 Implemented drawing red dots while traveling on the world map
(from rotators/Fo1in2#3 by ghost22238)
2020-01-02 00:38:01 +08:00
NovaRain 1af1eb2c70 Reverted the change on x offset in previous commit 2019-12-29 08:41:02 +08:00
NovaRain 3a4a9d7240 Increased the width of the total weight display in the inventory
(moved from the CritterInvSizeLimitMode option)

Updated version number and year.

Minor format edits to some code and README.md.
2019-12-29 01:55:59 +08:00
NovaRain cd674fede2 Removed redundant copies of version.h 2019-12-25 21:24:04 +08:00
NovaRain 5200be19c9 Merge branch 'develop' 2019-12-25 09:29:35 +08:00
NovaRain b984568b32 Added StrNormalizePath() to Utils.cpp. 2019-12-25 09:15:35 +08:00
NovaRain 71803ff06c Added a comment to Handlers\Utils.cpp 2019-12-24 20:50:52 +08:00
NovaRain 7cef7e8e54 Some edits to hookscripts.txt & function notes.txt 2019-12-24 00:55:31 +08:00
NovaRain 7990d230f2 Fixed the return value/object for HOOK_TARGETOBJECT 2019-12-23 23:41:11 +08:00
NovaRain cb9f759d71 Replaced _stricmp in previous commit with strcmp.
Minor edits to some code.
2019-12-16 15:31:50 +08:00
NovaRain 7ed8dd286c Fixed the path to load global shaders in the previous commit
* when DataLoadOrderPatch is disabled, the path was set to
"sfall.dat\shaders\".
2019-12-15 09:56:47 +08:00
NovaRain 9f3299b47a 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.
2019-12-14 10:49:08 +08:00
NovaRain a68498453c Edited the description of hook/functions in the previous commit
Rewrote ASM code for tile_under_cursor script function.
2019-12-14 00:43:09 +08:00
NovaRain 0bf9a322c1 Corrected code and renamed hook/functions from the previous commit 2019-12-13 10:49:24 +08:00
NovaRain a325dd18ea WIP - Added a new hook: HOOK_TARGETOBJ
Added "get_tile" and "get_objects_at_radius" script functions.

* their names are not final and documents are missing.
2019-12-11 15:52:03 +08:00
NovaRain 439de4aecc Re-fixed the return value of get_script function 2019-12-09 10:18:29 +08:00
NovaRain 702e62e610 Rewrote remove_script/set_script functions in C++
Fixed the return value of get_script function.
2019-12-08 23:16:56 +08:00
NovaRain ddf0ec7085 Added missing code for commit b149aaa
Some edits to script related namesapce in Enums.h.
2019-12-08 07:30:14 +08:00
NovaRain b539cab67d Change container from Map to Array for sfall opcodes 2019-12-07 09:54:40 +08:00
NovaRain b149aaa00c Changed the behavior of IniConfigFolder option 2019-12-07 09:41:06 +08:00
NovaRain a5bcfa8a6b Re-fixed the previous commit 2019-12-05 09:38:37 +08:00
NovaRain 80cf1a9ca7 Fix for printing game messages to debug log 2019-12-04 13:04:57 +08:00
NovaRain 4cffc455e2 Code refactoring for opcodes/functions 2019-12-04 10:39:35 +08:00
NovaRain 1bb04a6d45 Improved handling of incorrect formatting for "string_format" script function
Rewrote ASM code of opcode handlers in Memory.cpp.
2019-12-03 10:48:30 +08:00
NovaRain 2a2849537c Added "string_format" script function
Some code refactoring.
2019-12-01 12:09:58 +08:00
NovaRain 84076a2586 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 11:52:35 +08:00
NovaRain 11fee91f2f 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:17:22 +08:00
NovaRain 6d12481754 Refactored script function handlers 2019-11-28 14:05:36 +08:00
NovaRain 04d4a8dc5b Minor code refactoring for opcodes/metarules
Added separate settable value of return error for invalid arguments of
script functions.
2019-11-27 12:31:45 +08:00
NovaRain d1851cbde1 Added set/unset Special game mode flag when a party member joins/leaves in dialog
Re-fixed commit 227a062 (correct variant)
2019-11-26 07:43:58 +08:00
NovaRain accf564e6e Re-fixed GAMEMODECHANGE hook being triggered unexpectedly in dialog
(undo fix in commit 5053ab5)

Restored calling original engine functions from HRP hacks.
2019-11-25 07:28:08 +08:00
NovaRain 977e6a5ad7 Added "get_text_width" and "string_compare" script functions
Fixed the return value of charcode script function for characters in
the extended ASCII character set.

Rewrote set_dm/df_model, set_movie_path functions in C++.
2019-11-23 20:18:06 +08:00
NovaRain 0c42f6447d Restored and fixed RemoveWindowRounding option
Reorganized ddraw.ini a bit.
2019-11-21 00:58:10 +08:00
NovaRain 5053ab564d Added a new argument to HOOK_GAMEMODECHANGE
* now the previous game mode can be checked with arg2 (#211)

Fixed GAMEMODECHANGE hook being triggered even when the game mode is not
changed.

Added 'SPECIAL' flag to the game mode functions (when switching from
DIALOG mode to BARTER).
2019-11-20 10:41:21 +08:00
NovaRain f0f134d077 Fixed a crash bug in CorpseLineOfFireFix (from commit 521b6c7) 2019-11-19 14:19:58 +08:00
NovaRain 199502782b Fixed a crash bug in CorpseLineOfFireFix (from commit 521b6c7, #270)
Updated version number for hotfix.
2019-11-19 14:02:17 +08:00
NovaRain e93d878d1d Added a new hook: HOOK_STDPROCEDURE_END
* as an extension to HOOK_STDPROCEDURE hook script.

Updated documents.
2019-11-17 08:32:03 +08:00
NovaRain 18c10d8911 Added four new script functions:
"get_sfall_arg_at", "show_window", "hide_window", "set_window_flag"

Improved the functionality of "inventory_redraw" function.
2019-11-16 22:36:53 +08:00
NovaRain 996dd293c0 Tweaked/fixed reg_anim_callback function 2019-11-15 09:57:31 +08:00
NovaRain 9904423641 Added "reg_anim_callback" script function(opcode) (#257)
Updated documents.
2019-11-14 12:49:06 +08:00
NovaRain 534bc3e5cd 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:00:22 +08:00
NovaRain 227a062fa6 Added a fix for scripted interface windows (#25)
* 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:11:33 +08:00
NovaRain 09d97464c8 Merge branch 'develop' 2019-11-07 09:50:16 +08:00
NovaRain b8de20d455 Fixed gl_partycontrol change in commit 9fab4b3 2019-11-07 09:45:57 +08:00
NovaRain 4ae09522f0 Merge branch 'develop' 2019-11-05 09:28:03 +08:00
NovaRain 76cc0471d6 Minor edits to Structs.h and HookScripts.cpp
Fixed Debug build configuration in project file.
2019-11-05 09:18:46 +08:00
NovaRain 2e39325521 Updated define_extra.h
Added define of OBJ_DATA_SCRIPT_INDEX to define_extra.h.
2019-11-04 21:23:11 +08:00
NovaRain f3abea3462 Updated script mods. 2019-11-03 10:05:55 +08:00
NovaRain d0c4bc3b78 Added "get_inven_ap_cost" script function
Added grey outline to controlled critters at the beginning of the turn.
2019-11-02 10:24:05 +08:00
NovaRain 2e655945c0 Added support for displaying item AP cost up to 19 (#228)
* Requires an extended MVENUM.frm in the art\intrface\ directory to
display properly (included in sfal.dat).
2019-10-31 12:46:42 +08:00
NovaRain 521b6c7e08 Fixed the previous commit (conflict with INVENWIELD hook)
Moved some option codes from MiscPatches.cpp to other modules.

Removed CorpseLineOfFireFix from ddraw.ini (always enabled).
2019-10-31 11:28:05 +08:00
NovaRain c348925c95 Fixed PM's weapon being misplaced after level up 2019-10-30 21:13:46 +08:00
NovaRain 0d023c32db Improved and moved the address conflict checking to CheckAddress.cpp/h
Added ddraw_CheckAddr.ini file to check conflicts properly.
Some code fixes/edits.
2019-10-29 10:41:03 +08:00
NovaRain 0570062123 Renamed AnimationsAtOnceLimit module to Animations 2019-10-28 09:44:32 +08:00
NovaRain a6c09d4d5c Added a debug message about missing art file for critters
Minor edit to sfall.h.
2019-10-25 10:21:01 +08:00
NovaRain 20119daf3d Minor code edit to previous commit 2019-10-23 09:36:13 +08:00
NovaRain 3553d45e5c Engine now uses 'English' as the fallback language for all msg files (#256) 2019-10-22 15:42:25 +08:00
NovaRain fc9c260a9f Cleanup in solution files 2019-10-22 09:44:17 +08:00
NovaRain 9f27c160ff Added "add_trait" script function 2019-10-20 19:29:19 +08:00
NovaRain 1f156d39ae Fixed amount argument for critter_add/rm_trait functions 2019-10-17 09:38:28 +08:00
NovaRain 3d9febecb9 Replaced GetPrivateProfileInt/String with wrapper functions
Fixed crash when a name in PremadePaths exceeds 11 characters.
2019-10-16 13:09:02 +08:00
NovaRain 9fab4b32ee Fixed inherited perks in gl_partycontrol 2019-10-15 22:17:08 +08:00
NovaRain d762f57cbc 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:40:59 +08:00
NovaRain e13a27469f Refactored CritterStats.cpp
Minor edits to to some code.
2019-10-15 10:55:07 +08:00
NovaRain ab2283f0e3 Rewrote set_xp_mod, get_sfall_args, set_sfall_arg functions in C++
Cleanup in ASM scripting handlers code.
2019-10-14 15:29:03 +08:00
NovaRain 882a601b0c Added optional options to the perks ini file
* to toggle modification sections for perks and traits.

Reorganized ini reading functions in main.cpp, and edited related code
in Perks/Stats modules.

Added error/warning icons to message boxes.
2019-10-14 10:19:11 +08:00
NovaRain 85dfb35f01 Updated NPC armor appearance mod script
Added command_lite.h header file (from EcCo mod).
Added alternative npcarmor.ini for vanilla Fallout 2.
2019-10-11 00:49:15 +08:00
NovaRain 614caded92 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 11:48:33 +08:00
NovaRain 1b6d6179a1 Added "unwield_slot" script function
Re-fixed obj_art_fid for player's FID (commit 50f4885)
2019-10-08 10:53:47 +08:00
NovaRain 6ede19ceec Fixed inven_unwield script function
* now it updates the interface slot for the player properly.

Fixed some code in PartyControl module.
2019-10-07 13:30:49 +08:00
NovaRain 172495bdc5 Fixed arg1 of HOOK_INVENWIELD when calling move_obj_inven_to_obj
Moved critter stats code from Stats.cpp to a new CritterStats module.
Moved CRC files from Modules folder to the root folder of the project.
Moved get/set_proto_data functions from Misc to Objects handler.
2019-10-05 07:47:17 +08:00
NovaRain 2187854bf2 Improved the implementation of HOOK_INVENWIELD (#266)
* 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.

Fixed incorrect PIDs for RP new party members in npcarmor.ini.
2019-10-04 20:23:49 +08:00
NovaRain 8d29e04712 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:45:49 +08:00
NovaRain 8468fee7b4 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:45:36 +08:00
NovaRain 000b116895 Removed NPCStage6Fix from ddraw.ini (always enabled)
Moved the code of NPCStage6Fix to BugFixes module.
(to its original relative location, right above MultiHexPathingFix)

Reorganized some code in BugFixes.cpp.
2019-09-27 20:50:20 +08:00
NovaRain 98199b4e7e Refactored code in Arrays.cpp and fixed save_array() script function.
* related to "corrupted" savegames in #265.
2019-09-24 12:30:02 +08:00
NovaRain a17471b624 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.

* Added RP's extra weapon anim codes to vanilla PMs in npcarmor.ini.

Updated version number.
2019-09-24 12:20:16 +08:00
159 changed files with 9774 additions and 4506 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
# sfall # sfall
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself. A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
Engine modifications include: **Engine modifications include:**
- Better support for modern operating systems - Better support for modern operating systems
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc. - Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- Bug fixes - Bug fixes
@@ -10,7 +10,7 @@ Engine modifications include:
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions) - Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Original author: timeslip Original author: timeslip
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders. Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders.
+9
View File
@@ -27,6 +27,10 @@ WeaponAccurateBonus=20
WeaponHandlingBonus=3 WeaponHandlingBonus=3
;############################################################################## ;##############################################################################
[Perks]
;Set to 1 to enable the modifications for perks
Enable=0
;Name=The name of the perk (max 63 characters) ;Name=The name of the perk (max 63 characters)
;Desc=The description of the perk (max 255 characters) ;Desc=The description of the perk (max 255 characters)
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst ;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
@@ -119,6 +123,11 @@ Skill4Mod=0
Skill5=-1 Skill5=-1
Skill5Mod=0 Skill5Mod=0
;##############################################################################
[Traits]
;Set to 1 to enable the modifications for traits
Enable=0
;This is a modification to trait 0 ;This is a modification to trait 0
[t0] [t0]
NoHardcode=0 NoHardcode=0
@@ -0,0 +1,82 @@
;NPC armor appearance configuration for vanilla Fallout 2. Does not require any new graphics
;Party members will use player's armor appearance just like old B-Team mod
;WeaponAnims codes
; 1 - Knife (D)
; 2 - Club (E)
; 3 - Sledgehammer (F)
; 4 - Spear (G)
; 5 - Pistol (H)
; 6 - SMG (I)
; 7 - Rifle (J)
; 8 - Big Gun (K)
; 9 - Minigun (L)
; 10 - Rocket Launcher (M)
; 11-15 - sfall additional weapon animation codes
; This section maps 7 armor types to corresponding armor item PIDs
[ArmorTypes]
Jacket = 74,265
Leather = 1,379
Metal = 2,240,380
Power = 3,232
AdvPower = 348,349
Combat = 17,239,381
Robe = 113,524
; Default armor FIDs (the same for all NPCs)
[Default]
Jacket = 16777229
Leather = 16777228
Metal = 16777230
Combat = 16777226
Power = 16777217
AdvPower = 16777287
Robe = 16777218
; Sulik
[1]
PID=16777313
WeaponAnims=1,3,4,6
Default=16777280
; Vic
[2]
PID=16777278
WeaponAnims=1,5,7
Default=16777307
; Cassidy
[3]
PID=16777305
WeaponAnims=4,5,7
Default=16777260
Leather=16777260
; Myron
[4]
PID=16777376
WeaponAnims=1,5
Default=16777304
; Lenny
[5]
PID=16777323
WeaponAnims=1,5,6
Default=16777295
; Davin
[6]
PID=16777379
WeaponAnims=1,2,5
Default=16777264
; Miria
[7]
PID=16777380
WeaponAnims=1,6
Default=16777252
Jacket=16777222
Leather=16777221
Metal=16777223
Combat=16777219
+23 -25
View File
@@ -23,69 +23,67 @@ Robe = 113,524
; Default armor FIDs (the same for all NPCs) ; Default armor FIDs (the same for all NPCs)
[Default] [Default]
Power=16777217 Power = 16777217
AdvPower=16777287 AdvPower = 16777287
Robe=16777218 Robe = 16777218
; Sulik ; Sulik
[1] [1]
PID=16777313 PID=16777313
WeaponAnims=1,3,4,6 WeaponAnims=1,3,4,6,14
Default=16777280 Default=16777280
Leather=16777325
Power=16777324
Metal=16777323
Jacket=16777321 Jacket=16777321
Leather=16777325
Metal=16777323
Combat=16777322 Combat=16777322
Power=16777324
; Vic ; Vic
[2] [2]
PID=16777278 PID=16777278
WeaponAnims=1,5,7 WeaponAnims=1,5,7,13,14
Default=16777307 Default=16777307
Jacket=16777329 Jacket=16777329
Combat=16777330
Metal=16777331
Power=16777332
Leather=16777333 Leather=16777333
Metal=16777331
Combat=16777330
Power=16777332
; Cassidy ; Cassidy
[3] [3]
PID=16777305 PID=16777305
WeaponAnims=4,5,7 WeaponAnims=4,5,7,13
Default=16777354 Default=16777354
Leather=16777260
Power=16777328
Metal=16777327
Jacket=16777351 Jacket=16777351
Leather=16777260
Metal=16777327
Combat=16777326 Combat=16777326
Power=16777328
; Myron ; Myron
[4] [4]
PID=16777376 PID=16777376
WeaponAnims=1,5 WeaponAnims=1,5,14
Default=16777304 Default=16777304
Leather=
Power=16777349
Combat=16777350 Combat=16777350
Power=16777349
; Cat Jules ; Cat Jules (RP)
[5] [5]
PID=16777734 PID=16777720
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777353 Default=16777353
Jacket=16777346
Leather=16777347 Leather=16777347
Metal=16777348 Metal=16777348
Jacket=16777346
Combat=16777226 Combat=16777226
; Kitsune ; Kitsune (RP)
[6] [6]
PID=16777724 PID=16777718
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777222 Default=16777222
Jacket=16777222
Leather=16777221 Leather=16777221
Metal=16777223 Metal=16777223
Jacket=16777222
Combat=16777219 Combat=16777219
+90 -66
View File
@@ -1,12 +1,12 @@
;sfall configuration settings ;sfall configuration settings
;v4.2 ;v4.2.3
[Main] [Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file. ;Change to 1 if you want to use command line args to tell sfall to use another ini file.
UseCommandLine=0 UseCommandLine=0
;Uncomment and point to a file to get alternate translations for some sfall messages ;Uncomment and point to a file to get alternate translations for some sfall messages
;TranslationsINI=.\Translations.ini ;TranslationsINI=sfall\Translations.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[ExtraPatches] [ExtraPatches]
@@ -80,6 +80,10 @@ Mode=0
GraphicsWidth=0 GraphicsWidth=0
GraphicsHeight=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 1 to do the palette conversion on the GPU
;Set to 2 to do the palette conversion on the CPU ;Set to 2 to do the palette conversion on the CPU
;Set to 0 to pick automatically ;Set to 0 to pick automatically
@@ -94,7 +98,7 @@ GPUBlt=0
Use32BitHeadGraphics=0 Use32BitHeadGraphics=0
;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies ;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 AllowDShowMovies=0
;Fade effect time percentage modifier ;Fade effect time percentage modifier
@@ -103,6 +107,11 @@ FadeMultiplier=100
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Interface] [Interface]
;Set to 1 to expand the number of action points displayed on the interface bar
;Requires new IFACE_E.frm and HR_IFACE_<res>E.frm files in art\intrface\ (included in sfall.dat) to display correctly
;The minimum supported version of High Resolution Patch is 4.1.8
ActionPointsBar=0
;Set to 1 to use the expanded world map interface ;Set to 1 to use the expanded world map interface
;Set to 2 to skip correcting the position of entrance markers on town maps ;Set to 2 to skip correcting the position of entrance markers on town maps
;You can use resized FRMs in 700x682 for town maps in the expanded world map interface ;You can use resized FRMs in 700x682 for town maps in the expanded world map interface
@@ -110,10 +119,17 @@ FadeMultiplier=100
;The resolution of hi-res patch must be set to at least 890x720 ;The resolution of hi-res patch must be set to at least 890x720
ExpandWorldMap=0 ExpandWorldMap=0
;Set to 1 to expand the number of action points displayed on the interface bar ;Set to 1 to draw a dotted line while traveling on the world map (similar to Fallout 1)
;Requires new IFACE_E.frm and HR_IFACE_<res>E.frm files in art\intrface\ (included in sfall.dat) to display correctly WorldMapTravelMarkers=0
;The minimum supported version of High Resolution Patch is 4.1.8 ;Uncomment these lines to change the appearance of the markers
ActionPointsBar=0 ;The color index in Fallout default palette (valid range: 1..255; default is 134)
;TravelMarkerColor=134
;The length and spacing of the dots in pixels for each type of terrain in worldmap.txt
;Syntax is 'length:spacing', with each pair separated by a comma (valid range: 1..10; default is 2)
;TravelMarkerStyles=2:2,2:2,2:2,2:2
;Set to 1 to display terrain types when hovering the cursor over the player's marker on the world map
WorldMapTerrainInfo=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Input] [Input]
@@ -186,7 +202,7 @@ FastMoveFromContainer=0
;A key to press to open a debug game editor ;A key to press to open a debug game editor
;Set to 0 to disable, or a DX scancode otherwise ;Set to 0 to disable, or a DX scancode otherwise
;Requires sfall debugging mode to be enabled and FalloutClient.exe from the modders pack ;Requires sfall debugging mode and FalloutClient.exe from the modders pack
DebugEditorKey=0 DebugEditorKey=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -194,6 +210,7 @@ DebugEditorKey=0
;Changes some of Fallout 2 engine functions to Fallout 1 behavior: ;Changes some of Fallout 2 engine functions to Fallout 1 behavior:
;- disables playing the final movie/credits after the endgame slideshow ;- disables playing the final movie/credits after the endgame slideshow
;- disables halving the weight for power armor items ;- disables halving the weight for power armor items
;- endgame_movie script function plays movie 10 or 11 based on the player's gender before the credits
Fallout1Behavior=0 Fallout1Behavior=0
;Time limit in years. Must be between -3 and 13 ;Time limit in years. Must be between -3 and 13
@@ -245,10 +262,15 @@ UseFileSystemOverride=0
;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat ;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
DataLoadOrderPatch=1 DataLoadOrderPatch=1
;Set to 1 to enable loading alternative dialog msg files from text\<language>\dialog_female\ for female PC ;Set to 1 to load alternative dialog msg files from text\<language>\dialog_female\ for female PC
;Set to 2 to also load subtitle files from text\<language>\cuts_female\ for female PC ;Set to 2 to also load subtitle files from text\<language>\cuts_female\ for female PC
FemaleDialogMsgs=0 FemaleDialogMsgs=0
;Set to 1 to allow using the special '^' character in dialog msg files to specify the alternative text
;that will be displayed in the dialogue based on the player's gender
;The text must be enclosed in angle brackets (example: <MaleText^FemaleText>)
DialogGenderWords=0
;To change the default and starting player models, uncomment the next four lines. ;To change the default and starting player models, uncomment the next four lines.
;The default models can also be changed ingame via script ;The default models can also be changed ingame via script
;MaleStartModel=hmwarr ;MaleStartModel=hmwarr
@@ -288,9 +310,6 @@ Movie17=credits.mve
;LocalMapXLimit=480 ;LocalMapXLimit=480
;LocalMapYLimit=400 ;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 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 ;Set to 2 to make the pipboy available by only skipping the vault suit movie check
PipBoyAvailableAtGameStart=0 PipBoyAvailableAtGameStart=0
@@ -313,9 +332,6 @@ DamageFormula=0
;Prevents you from using 0 to escape from dialogue at any time. ;Prevents you from using 0 to escape from dialogue at any time.
DialogueFix=1 DialogueFix=1
;Prevents you from using number keys to enter unvisited areas on a town map
TownMapHotkeysFix=1
;Set to 1 to disable the horrigan encounter ;Set to 1 to disable the horrigan encounter
DisableHorrigan=0 DisableHorrigan=0
@@ -341,9 +357,6 @@ OverrideArtCacheSize=0
;Set to 2 to block all saving in combat ;Set to 2 to block all saving in combat
SaveInCombatFix=1 SaveInCombatFix=1
;Point to an ini file containing elevator data
;ElevatorsFile=Elevators.ini
;Uncomment and set 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.
;Player's level is capped once the highest specified level is reached ;Player's level is capped once the highest specified level is reached
;XPTable=50,100,200 ;XPTable=50,100,200
@@ -372,8 +385,6 @@ AdditionalWeaponAnims=1
;If the ExtraKillTypes option is enabled, this should be set to 3, with containing entries for any new types ;If the ExtraKillTypes option is enabled, this should be set to 3, with containing entries for any new types
;Must be non-zero to use the edit/get/reset_critical script functions ;Must be non-zero to use the edit/get/reset_critical script functions
OverrideCriticalTable=2 OverrideCriticalTable=2
;To change the path and filename of the critical table file, uncomment the next line
;OverrideCriticalFile=CriticalOverrides.ini
;Set to 1 to get notification of karma changes in the notification window ;Set to 1 to get notification of karma changes in the notification window
DisplayKarmaChanges=0 DisplayKarmaChanges=0
@@ -384,9 +395,6 @@ AlwaysReloadMsgs=0
;Set to 1 to force the player to play the idle animation when reloading their weapon ;Set to 1 to force the player to play the idle animation when reloading their weapon
PlayIdleAnimOnReload=0 PlayIdleAnimOnReload=0
;Set to 1 to prevent corpses from blocking line of fire
CorpseLineOfFireFix=1
;Changes the timer (in days) for deleting corpses on a map after you leave (valid range: 0..13) ;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 ;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 ;Default is 6. Set to 0 for a 12-hour timer
@@ -394,12 +402,12 @@ CorpseDeleteTime=6
;Set a number of milliseconds to idle each input loop ;Set a number of milliseconds to idle each input loop
;Set to -1 to disable ;Set to -1 to disable
;Set to 0 to idle only if other processes are waiting for processor time ;Set to 0 to idle only if other processes are waiting for processor time (WinXP/2000: if processes have equal priority)
;Set to 1 (or some higher number if needed, the maximum is 127) 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 ProcessorIdle=-1
;Set to 1 if using the hero appearance mod ;Set to 1 if using the hero appearance mod
;Set to 2 for backward compatibility with old scripts that manually fix obj_art_fid script function for dude_obj ;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 ;You can add AppChCrt.frm and AppChEdt.frm files to art\intrface\ to set a custom background for the character screen
EnableHeroAppearanceMod=0 EnableHeroAppearanceMod=0
@@ -412,8 +420,9 @@ SkipOpeningMovies=0
;Set to 0 to disable ;Set to 0 to disable
NPCsTryToSpendExtraAP=0 NPCsTryToSpendExtraAP=0
;Set to 1 to fix NPCs not checking weapon perks properly when searching for the best weapon ;Set to 1 to fix NPCs not checking weapon perks properly when choosing the best weapon in combat
;Note that enabling this option can significantly affect the weapon choice of some NPCs 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 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 ;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as drug use preference when using drugs in their inventory
@@ -437,6 +446,9 @@ Doctor=293
Science=293 Science=293
Repair=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 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 ;Set to 2 to use a different set of scroll buttons
UseScrollingQuestsList=1 UseScrollingQuestsList=1
@@ -448,6 +460,7 @@ UseScrollingQuestsList=1
;Uncomment these lines to control the premade characters offered when starting a new game ;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 ;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 ;PremadePaths=combat,diplomat,stealth
;PremadeFIDs=201,203,202 ;PremadeFIDs=201,203,202
@@ -456,7 +469,7 @@ UseScrollingQuestsList=1
;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 ;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 ;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 ;Set to 1 to add additional pages of save slots
ExtraSaveSlots=0 ExtraSaveSlots=0
@@ -499,18 +512,12 @@ BonusHtHDamageFix=1
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory ;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
DisplayBonusDamage=0 DisplayBonusDamage=0
;Set to 1 to display the range of the second attack mode in the inventory when you switch weapon modes in active item slots
DisplaySecondWeaponRange=1
;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127) ;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127)
AnimationsAtOnceLimit=120 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 ;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 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 and copyright text ;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 ;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option
;MainMenuFontColour=0x00003C ;MainMenuFontColour=0x00003C
@@ -526,18 +533,6 @@ FastShotFix=1
;Set to 1 to boost the maximum number of script names from 1450 to 10000 ;Set to 1 to boost the maximum number of script names from 1450 to 10000
BoostScriptDialogLimit=0 BoostScriptDialogLimit=0
;Allows you to edit the skill tables
;Point the next line to 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
;Allows you to change some parameters for drugs and their addictions
;See the Drugs.ini in the modders pack for an example file
;DrugsFile=Drugs.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 ;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 ;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 ;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
@@ -589,6 +584,10 @@ StartGDialogFix=0
;attacker_results - unused, must be 0 or not equal to the target_results argument when specifying result flags for the target ;attacker_results - unused, must be 0 or not equal to the target_results argument when specifying result flags for the target
AttackComplexFix=0 AttackComplexFix=0
;Set to 1 to fix the issue with the division operator treating negative integers as unsigned
;Note: To perform the unsigned integer division, use the new 'div' operator
DivisionOperatorFix=1
;Set to 1 to enable the balanced bullet distribution formula for burst attacks ;Set to 1 to enable the balanced bullet distribution formula for burst attacks
ComputeSprayMod=0 ComputeSprayMod=0
@@ -618,17 +617,13 @@ ExplosionsEmitLight=0
;MovieTimer_artimer3=270 ;MovieTimer_artimer3=270
;MovieTimer_artimer4=360 ;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 ;Set to 0 for backward compatibility with pre-3.4 scripts
arraysBehavior=1 arraysBehavior=1
;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot ;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot
CheckWeaponAmmoCost=0 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) ;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
CombatPanelAnimDelay=1000 CombatPanelAnimDelay=1000
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255) ;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
@@ -646,7 +641,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 ;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 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 ItemCounterDefaultMax=0
;Set to 1 to leave the music playing in dialogue with talking heads ;Set to 1 to leave the music playing in dialogue with talking heads
@@ -727,6 +722,35 @@ KnockoutTime=35
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top ;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0 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
;Allows you to change some parameters for drugs and their addictions
;See the Drugs.ini in the modders pack for an example file
;DrugsFile=sfall\Drugs.ini
;Point to an ini file containing elevator data
;ElevatorsFile=sfall\Elevators.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Scripts] [Scripts]
;Comma-separated list of masked paths to load global scripts from ;Comma-separated list of masked paths to load global scripts from
@@ -734,10 +758,11 @@ CreditsAtBottom=0
;Paths outside of scripts folder are supported ;Paths outside of scripts folder are supported
GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
;Uncomment the option to specify a common folder path for all ini files used by scripts ;Uncomment the option to specify an additional folder path for ini files used by scripts
;You will have to put all the available ini files of the mods in this directory ;The game will search for the ini files relative to this directory
;If the file is not found, the search will proceed relative to the root directory of the game
;The maximum length of the specified path is 61 characters ;The maximum length of the specified path is 61 characters
;IniConfigFolder=IniConfig ;IniConfigFolder=mods\iniConfigs
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging] [Debugging]
@@ -748,8 +773,8 @@ GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
Enable=0 Enable=0
;Fallout 2 Debug Patch ;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 enabling sfall debugging mode ;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: ;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
;------- ;-------
;[debug] ;[debug]
@@ -759,25 +784,24 @@ Enable=0
;show_script_messages=1 ;show_script_messages=1
;show_tile_num=1 ;show_tile_num=1
;[sound] ;[sound]
;debug=1 ;debug=0
;debug_sfxc=1 ;debug_sfxc=0
;------- ;-------
DebugMode=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 ;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
;Requires DebugMode to be enabled
HideObjIsNullMsg=0 HideObjIsNullMsg=0
;Change to 1 to skip the compatibility mode check ;Change to 1 to skip the compatibility mode check
SkipCompatModeCheck=0 SkipCompatModeCheck=0
;Set to 1 to skip the executable file size check ;Set to 1 to skip the executable file size check
;Does not require enabling sfall debugging mode ;Does not require sfall debugging mode
SkipSizeCheck=0 SkipSizeCheck=0
;If you're testing changes to the Fallout exe, you can override the CRC that sfall looks for here ;If you're testing changes to the Fallout exe, you can override the CRC that sfall looks for here
;You can use several hex values, separated by commas ;You can use several hex values, separated by commas
;Does not require enabling sfall debugging mode ;Does not require sfall debugging mode
;ExtraCRC=0x00000000,0x00000000 ;ExtraCRC=0x00000000,0x00000000
;Set to 1 to stop Fallout from deleting non read-only protos at startup ;Set to 1 to stop Fallout from deleting non read-only protos at startup
@@ -785,20 +809,20 @@ SkipSizeCheck=0
DontDeleteProtos=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 ;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 AllowUnsafeScripting=0
;Set to 1 to force sfall to search for global scripts every time the game loads rather than only once on the first game start
AlwaysFindScripts=0
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist ;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
InjectAllGameHooks=0 InjectAllGameHooks=0
;Set to 1 to force sfall to search for global scripts every time the game loads rather than only once on the first game start
AlwaysFindScripts=0
;Set to 1 to force critters to display combat float messages ;Set to 1 to force critters to display combat float messages
;Requires AllowSoundForFloats to be enabled ;Requires AllowSoundForFloats to be enabled
Test_ForceFloats=0 Test_ForceFloats=0
;These options control what output is saved in the debug log (sfall-log.txt) ;These options control what output is saved in the debug log (sfall-log.txt)
;Prints messages duing sfall initialization ;Prints messages duing sfall initialization
Init=0 Init=0
;Prints messages relating to hook scripts ;Prints messages relating to hook scripts
@@ -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)); }
}
Binary file not shown.
@@ -45,6 +45,7 @@ procedure start begin
tap_key(DIK_A); tap_key(DIK_A);
tap_key(DIK_CAPITAL); tap_key(DIK_CAPITAL);
end else if (mode bwand BARTER) then begin end else if (mode bwand BARTER) then begin
play_sfx("IB2P1XX1");
tap_key(DIK_M); tap_key(DIK_M);
end end
end end
Binary file not shown.
Binary file not shown.
+78 -50
View File
@@ -15,9 +15,13 @@
#include "main.h" #include "main.h"
#define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor) #define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor)
#define IS_WEAPON(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_weapon) #define IS_WEAPON(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_weapon)
#define FID_OBJ_CRITTER (0x01000000)
procedure update_armor_apperance;
variable variable
modIni := "npcarmor.ini", modIni := "npcarmor.ini",
defaultFids, defaultFids,
@@ -26,44 +30,55 @@ variable
altWeapon, altWeapon,
unWieldWeapon; unWieldWeapon;
procedure check_armor_change(variable critter, variable item, variable isWorn) begin /*
Returns the FID value set in the config settings for party member armor: Jacket, Leather, etc.
*/
procedure check_armor_change(variable critter, variable armor, variable isWield) begin
variable npc, armorType, fid; variable npc, armorType, fid;
if (npcMap[obj_pid(critter)]) then begin npc := npcMap[obj_pid(critter)];
npc := npcMap[obj_pid(critter)]; if (npc) then begin
if (not isWorn) then begin if (isWield == false) then begin
// display_msg("No armor fid: " + npc["Default"]); // display_msg("No armor fid: " + npc["Default"]);
return npc["Default"]; return npc["Default"];
end else if (item) then begin end else if (armor) then begin
armorType := armorPidMap[obj_pid(item)]; armorType := armorPidMap[obj_pid(armor)];
fid := npc[armorType] or defaultFids[armorType]; fid := npc[armorType] or defaultFids[armorType];
if (fid == 0 or fid == -1) then fid := npc["Default"]; if (fid == 0 or fid == -1) then fid := npc["Default"];
// display_msg("Change fid: " + fid + ", npc: " + npc[armorType] + ", default:" + defaultFids[armorType]); // display_msg("Change fid: " + fid + ", npc: " + npc[armorType] + ", default:" + defaultFids[armorType]);
return fid; return fid;
end end
end end
return -1; return -1; // engine default
end end
procedure check_weapon_change(variable critter, variable item, variable isWield) begin /*
Checks if a party member can use the offered weapon
*/
procedure check_weapon_change(variable critter, variable weapon, variable isWield) begin
variable npc, newWeaponAnim, weaponAnimList, i; variable npc, newWeaponAnim, weaponAnimList, i;
if (npcMap[obj_pid(critter)]) then begin npc := npcMap[obj_pid(critter)];
npc := npcMap[obj_pid(critter)]; if (npc) then begin
if isWield then begin if (isWield) then begin
newWeaponAnim := get_proto_data(obj_pid(item), PROTO_WP_ANIM); newWeaponAnim := get_proto_data(obj_pid(weapon), PROTO_WP_ANIM);
weaponAnimList := string_split(npc["WeaponAnims"], ",");
if newWeaponAnim then begin // anim code 0 - none/unarmed if newWeaponAnim then begin // anim code 0 - none/unarmed
foreach (i in weaponAnimList) begin weaponAnimList := npc["WeaponAnims"];
if (newWeaponAnim == atoi(i)) then return -1; if (weaponAnimList != 0) then begin
foreach (i in string_split(weaponAnimList, ",")) begin
if (newWeaponAnim == atoi(i)) then return -1; // can use (engine default)
end
end end
return 0; return 0; // can't use
end end
end else begin end else begin
unWieldWeapon := obj_pid(item); unWieldWeapon := obj_pid(weapon);
end end
end end
return -1; return -1; // engine default
end end
/*
Finds the first weapon which can be used by the party member in the inventory
*/
procedure search_alt_weapon(variable critter) begin procedure search_alt_weapon(variable critter) begin
variable obj, res, i := 0; variable obj, res, i := 0;
obj := inven_ptr(critter, 0); obj := inven_ptr(critter, 0);
@@ -87,48 +102,47 @@ end
// for NPCs when they change armor/weapon themselves // for NPCs when they change armor/weapon themselves
procedure invenwield_handler begin procedure invenwield_handler begin
variable critter, item, fid, slot, isWorn, canWield; variable critter, item, fid, slot, isWield, canWield;
critter := get_sfall_arg; critter := get_sfall_arg;
item := get_sfall_arg; item := get_sfall_arg;
slot := get_sfall_arg; slot := get_sfall_arg;
isWorn := get_sfall_arg; isWield := get_sfall_arg;
if (critter and item and slot == INVEN_TYPE_WORN) then begin if (/*critter and*/ item and slot == INVEN_TYPE_WORN) then begin
fid := check_armor_change(critter, item, isWorn); fid := check_armor_change(critter, item, isWield);
if (fid != -1) then begin if (fid != -1) then begin
if art_exists(fid) then begin if art_exists(fid) then begin
art_change_fid_num(critter, fid); art_change_fid_num(critter, fid);
end else begin end else begin
debug_msg("Error: NPC Armor mod: missing FID."); debug_msg("[Error] NPC armor mod: Invenwield missing FID: " + fid);
end end
end end
return; end else if (/*critter and*/ item and slot == INVEN_TYPE_RIGHT_HAND) then begin
end
if (critter and item and slot == INVEN_TYPE_RIGHT_HAND) then begin
if (altWeapon == item) then return; if (altWeapon == item) then return;
canWield := check_weapon_change(critter, item, isWorn); canWield := check_weapon_change(critter, item, isWield);
set_sfall_return(canWield); set_sfall_return(canWield);
if (canWield != -1) then begin if (canWield != -1) then begin
call search_alt_weapon(critter); call search_alt_weapon(critter); // wield weapon by script
end end
end end
end end
// when changing armor from inventory while controlling other NPCs // when changing armor from inventory while controlling other NPCs
procedure adjustfid_handler begin procedure adjustfid_handler begin
variable fid, armor; variable fid, armor, weapAnim, currFid, newFid;
if (dude_obj != real_dude_obj) then begin if (dude_obj != real_dude_obj) then begin
currFid := get_sfall_arg;
if ((currFid bwand 0x0F000000) != FID_OBJ_CRITTER) then return;
armor := critter_inven_obj(dude_obj, INVEN_TYPE_WORN); armor := critter_inven_obj(dude_obj, INVEN_TYPE_WORN);
fid := check_armor_change(dude_obj, armor, armor != 0); fid := check_armor_change(dude_obj, armor, armor != 0);
if (fid != -1) then begin if (fid != -1) then begin
variable weapAnim := get_sfall_arg bwand 0xF000; weapAnim := currFid bwand 0xF000;
variable newFid := fid bwand 0xFFFF0FFF bwor weapAnim; newFid := fid bwand 0xFFFF0FFF bwor weapAnim;
if art_exists(newFid) then begin if art_exists(newFid) then begin
set_sfall_arg(0, newFid); set_sfall_arg(0, newFid);
set_sfall_return(newFid); set_sfall_return(newFid);
end else begin end else begin
debug_msg("Error: NPC Armor mod: missing FID."); debug_msg("[Error] NPC armor mod: Adjust FID missing: " + newFid);
end end
end end
end end
@@ -140,29 +154,18 @@ procedure inventorymove_handler begin
slot := get_sfall_arg; slot := get_sfall_arg;
item := get_sfall_arg; item := get_sfall_arg;
if (dude_obj != real_dude_obj) then begin if (dude_obj != real_dude_obj) then begin
if (IS_WEAPON(item) and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin if ((slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND) and IS_WEAPON(item)) then begin
canWield := check_weapon_change(dude_obj, item, item != 0); canWield := check_weapon_change(dude_obj, item, item != 0);
set_sfall_return(canWield); set_sfall_return(canWield);
end end
end end
end end
procedure start begin procedure start begin
variable sect, sects, armorTypes, armorType, npc, pid, pids, i; variable sect, sects, armorTypes, armorType, npc, pid, pids, i;
if game_loaded and (sfall_ver_major >= 4) then begin if game_loaded and (sfall_ver_major >= 4) then begin
register_hook_proc(HOOK_INVENWIELD, invenwield_handler);
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
defaultFids := get_ini_section(modIni, "Default");
fix_array(defaultFids);
foreach (armorType: i in defaultFids) begin
defaultFids[armorType] := atoi(i);
end
armorPidMap := create_array_map;
armorTypes := get_ini_section(modIni, "ArmorTypes"); armorTypes := get_ini_section(modIni, "ArmorTypes");
armorPidMap := create_array_map;
foreach (armorType: pids in armorTypes) begin foreach (armorType: pids in armorTypes) begin
pids := string_split(pids, ","); pids := string_split(pids, ",");
foreach (pid in pids) begin foreach (pid in pids) begin
@@ -170,6 +173,12 @@ procedure start begin
end end
end end
defaultFids := get_ini_section(modIni, "Default");
fix_array(defaultFids);
foreach (armorType: i in defaultFids) begin
defaultFids[armorType] := atoi(i);
end
npcMap := create_array_map; npcMap := create_array_map;
i := 1; i := 1;
@@ -188,7 +197,26 @@ procedure start begin
i += 1; i += 1;
sect := get_ini_section(modIni, ""+i); sect := get_ini_section(modIni, ""+i);
end end
end
call update_armor_apperance;
register_hook_proc(HOOK_INVENWIELD, invenwield_handler);
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
debug_msg("NPC armor appearance mod: Done.");
end
end end
procedure update_armor_apperance begin
variable npc, arItem, fid;
foreach (npc in party_member_list_critters) begin
if (npc == dude_obj) then continue;
arItem := critter_inven_obj(npc, INVEN_TYPE_WORN);
if (arItem) then begin
fid := check_armor_change(npc, arItem, true);
if (fid == -1 or art_exists(fid) == false) then continue;
art_change_fid_num(npc, fid);
end
end
end
Binary file not shown.
+11 -4
View File
@@ -38,7 +38,7 @@ procedure combatturn_handler begin
critter := get_sfall_arg, critter := get_sfall_arg,
pid, perkID, level; pid, perkID, level;
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + get_sfall_arg); //display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + "/" + critter + ", arg3: " + get_sfall_arg);
if npcControl then begin if npcControl then begin
if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity
obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC
@@ -54,9 +54,7 @@ procedure combatturn_handler begin
// set perks (only work with 4.1.8+) // set perks (only work with 4.1.8+)
foreach (perkID in perksList) begin foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID); level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then begin if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
end end
intface_redraw; intface_redraw;
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE); lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
@@ -68,6 +66,8 @@ procedure combatturn_handler begin
npcControl := 0; // dude control npcControl := 0; // dude control
end end
if inControl then begin if inControl then begin
// check preference setting _combat_highlight
if (read_byte(0x56D38C)) then set_outline(critter, OUTLINE_GREY);
// center the screen on the controlled critter/dude and remove roof tiles // center the screen on the controlled critter/dude and remove roof tiles
move_to(dude_obj, dude_tile, dude_elevation); move_to(dude_obj, dude_tile, dude_elevation);
if (displayName and critter != real_dude_obj) then begin if (displayName and critter != real_dude_obj) then begin
@@ -77,6 +77,13 @@ procedure combatturn_handler begin
end end
end end
end else if inControl then begin end else if inControl then begin
// remove perks before switching control (only work with 4.1.8+)
if (dude_obj != real_dude_obj) then begin
foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
end
if isShowTag then begin if isShowTag then begin
hide_iface_tag(displayName); hide_iface_tag(displayName);
isShowTag := false; isShowTag := false;
+8 -2
View File
@@ -1,11 +1,15 @@
#ifndef MAIN_H
#define MAIN_H
#include "..\scripting\headers\sfall.h" #include "..\scripting\headers\sfall.h"
#include "..\scripting\headers\define_lite.h" #include "..\scripting\headers\define_lite.h"
#include "..\scripting\headers\define_extra.h" #include "..\scripting\headers\define_extra.h"
#include "..\scripting\headers\dik.h"
/*
#include "..\scripting\headers\lib.arrays.h" #include "..\scripting\headers\lib.arrays.h"
#include "..\scripting\headers\lib.strings.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 ini := "sfall-mods.ini";
variable translationIni; variable translationIni;
@@ -69,3 +73,5 @@ end
procedure InitConfigs begin procedure InitConfigs begin
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini"); translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
end end
#endif
+2
View File
@@ -212,9 +212,11 @@ use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfa
- always returns 0 - always returns 0
> void save_array(mixed key, int arrayID): > 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" - arrayID is associated with given "key"
- array becomes permanent (if it was temporary) and "saved" - array becomes permanent (if it was temporary) and "saved"
- key can be of any type (int, float or string) - 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): > int load_array(mixed key):
- load array from savegame data by the same key provided in "save_array" - load array from savegame data by the same key provided in "save_array"
@@ -0,0 +1,99 @@
The executation speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there's the potential for problems again, since sfall's global script system means that you can have a large amount of scripts being run every single frame.
======================
=== sslc -O option ===
======================
The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn't a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It's primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.
There are several levels of optimization available:
-O1 - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched.
-O2 - Full, most code optimizations are on, but only those that were tested on complex scripts.
-O3 - Experimental, provides most efficiency, but tend to break some complex code due to bugs.
The following optimizations are performed:
> constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result.
a:=2+2; -> a:=4;
> constant variable initialization: All variables are initialised to some value, ('0', if you don't specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression.
variable a; -> variable a:=4;
a:=4; ->
> constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevent references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script.
a:=4 -> a:=4
foo(a); -> foo(4);
> dead code removal: Checks for and removes code which cannot be reached, either because it is hidden behind a return or because the argument to an if statement can be computed at compile time.
if 1 then begin -> display_msg("foo");
display_msg("foo"); ->
end else begin ->
display_msg("bar"); ->
end ->
> unreferenced variable elimination: Checks for variables which are never referenced, and removes them. Also applies to global variables, as long as they are not marked for export.
variable i, j, k; -> variable i;
i:=1; -> i:=1;
return; -> return;
> unreferenced procedure elimination: Checks for any procedures which are never called, and removes them.
procedure foo begin return "foo"; end -> procedure foo begin return "foo"; end
procedure bar begin return "bar"; end -> procedure start begin
procedure start begin -> display_msg(foo);
display_msg(foo); -> end
end ->
> dead store removal: Removes variable assignments if the result of the variable is unused, and if the expression used to compute the value of the variable is provably free of side effects. (See 'pure' keyword)
a:="moo"; -> a:="foo";
a:="foo"; -> display_msg(a);
display_msg(a); ->
a:="bar"; ->
> store combination: Where there are two stores in a row to the same variable, the two expressions are combined.
var1 := var2; -> var1 := var2 + var3;
var1 += var3; ->
> variable combination: Where usage regions of variables do not overlap, combine the variables to provide additional candidates for unreferenced variable elimination. Very useful for scripts containing multiple foreach loops, which generate 2 or 3 hidden variables each.
a:="foo"; -> a:="foo";
display_msg(a); -> display_msg(a);
b:="bar"; -> a:="bar";
display_msg(b); -> display_msg(a);
> namelist compression: Fallout stores the names of all file scope variables and procedures in a namelist which is saved into the .int. Any of these that are unreferenced can be removed, and the names of global variables can be modified to make them shorter.
=============================
=== writing your own code ===
=============================
Don't have global scripts running any more often that you need them to. Not everything needs to be run every single frame.
Never concat constant strings with the '+' operator, as it forces the operation to be done at runtime. The compiler can cope with constant strings being placed next to each other without the need for a +, which results in far more efficient code as the combination is done at lex time.
#define GLOB_PREFIX "ts__" -> #define GLOB_PREFIX "ts__"
procedure start begin -> procedure start begin
set_sfall_global(GLOB_PREFIX + "foo1", 0); -> set_sfall_global(GLOB_PREFIX "foo1", 0);
end -> end
Avoid function calls in while loops. function calls are expensive in comparison to variable lookups, so it's more efficient to move the function call out of the loop and store the result in a variable
while i < len_array(array) do begin -> tmp:= len_array(array);
... -> while i < tmp do begin
end -> ...
-> end
Mark functions with pure or inline where relevent.
'pure' is a hint to the optimizer that a procedure has no side effects. (i.e. there's no way to tell that it's been called aside from its return value.) Pure procedures cannot modify global variables, or call any other procedure that isn't itself pure. Functions marked with pure can only be used in expressions (i.e. you cannot use the 'call <procedure>' syntax to call them.) If there are non-pure terms in an expression, it prevents that expression being considered for dead store removal. Where no such optimizations can be performed, or if optimization is disabled, marking a procedure with pure will have no effect on the compiled code.
'inline' is an instruction to the compiler to replace calls to the marked procedure with a copy of the procedures code instead of having a seperate call. inlined procedures cannot use the 'return' command, cannot be predefined, and cannot be used as part of an expression. inlining if a procedure is only going to be called once is always a win, but if there are multiple calls to a procedure you will end up bloating the size of the generated code.
@@ -0,0 +1,405 @@
This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional scripting functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer.
Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive.
If you use fallout script editor, you can extract compile.exe and dos4gw.exe to its \binary folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn't seem to be able to tell when errors occur when using this compiler though, so I'd recommend either using sfall's script editor instead or compiling by hand if possible.
When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line 'procedure start;' before any #includes that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5)
This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don't use any of the arrays syntax and any sfall scripting functions.
The original unmodified sslc source is over here:
http://www.teamx.ru/eng/files/srcs/index.shtml
============================
=== command line options ===
============================
-q don't wait for input on error
-n no warnings
-b backward compatibility mode
-l no logo
-p preprocess source
-O optimize code (full, see optimization.txt)
-O<N> set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental)
-d print debug messages
-D output an abstract syntax tree of the program
-o set output path (follows the input file name)
-s enable short-circuit evaluation for all AND, OR operators
-m<macro[=val]> define a macro named "macro" for conditional compilation
-I<path> specify an additional directory to search for include files
The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default
===================================
=== Additional supported syntax ===
===================================
Syntax which requires sfall for compiled scripts to be interpreted, is marked by asterix (*).
> Optional arguments in user-defined procedures. You can only use constants for default values. It basically puts those constants in place of omitted arguments.
new:
procedure test(variable x, variable y := 0, variable z := -1) begin
...
end
...
call test("value");
old:
procedure test(variable x, variable y, variable z) begin
...
end
...
call test("value", 0, -1);
> New logical operators "AndAlso", "OrElse" for short-circuit evaluation of logical expressions.
Using these operators allow the right part of logical expressions not to be evaluated (executed, computed) if the result is already known. This can improve the performance of running scripts.
Example:
if (obj andAlso obj_pid(obj) == PID_STIMPAK) then ...
if obj is null, the second condition will not be checked and your script won't fail with "obj is null" error in debug.log
This also has an effect that a value of last computed argument is returned as a result of whole expressions, instead of always 0 (false) or 1 (true):
obj := false;
display_msg(obj orElse "something"); // will print "something"
You can also use the -s option to enable short-circuit evaluation for all the AND, OR operators in the script.
NOTE: Be aware that it may break some old scripts because operators behavior is changed slightly.
> Conditional expressions (Python-inspired), also known as ternary operator:
new:
X := value1 if condition else value2
old:
if (condition) then
X := value1;
else
X := value2;
> To assign values, you can use the alternative assignment operator from C/Java instead of Pascal syntax.
new:
x = 5;
old:
x := 5;
> Multiple variable decleration: Multiple variables can be declared on one line, seperated by commas. This is an alterative to the ugly begin/end block, or the bulky single variable per line style.
new:
variable a, b, c;
old:
variable begin a; b; c; end
> Variable initialization with expressions: You can now initialize local variables with complex expressions instead of constants.
new:
variable tile := tile_num(dude_obj);
old:
variable tile;
tile := tile_num(dude_obj);
NOTE: if your expression starts with a constant (eg. 2+2), enclose it in parentheses, otherwise compiler will be confused and give you errors.
> Hexadecimal numerical constants: Simply prefix a number with 0x to create a hexadecimal. The numbers 0 to 9 and a-f are allowed in the number. The number may not have a decimal point.
new:
a := 0x1000;
old:
a := 4096;
> increment/decrement operators: ++ and -- can be used as shorthand for +=1 and -=1 respectively. They are mearly a syntactic shorthand to improve readability, and so their use is only allowed where +=1 would normally be allowed.
new:
a++;
old:
a += 1;
> "break" & "continue" statements: they work just like in most high-level languages. "break" jumps out of the loop. "continue" jumps right to the beginning of the next iteration (see "for" and "foreach" sections for additional details).
new:
while (i < N) begin
// ...
if (/* some condition */) then break;
// ...
end
old:
while (i < N and not(breakFlag)) begin
// ...
if (/* condition */) then breakFlag := true;
// ...
end
new:
for (i := 0; i < N; i++) begin
// ...
if (/* condition */) then begin
// action
continue;
end
// else actions
end
old:
for (i := 0; i < N; i++) begin
// ...
if (/* condition */) then begin
// action
end else begin
// else actions
end
end
> "for" loops: Another piece of syntactic shorthand, to shorten while loops in many cases. Parentheses around the loop statements are recommended but not required (when not using parentheses, a semicolon is required after the 3rd loop statement).
new:
for (i := 0; i < 5; i++) begin
display_msg("i = "+i);
end
old
i := 0;
while (i < 5) do begin
display_msg("i = "+i);
i++;
end
NOTE: "continue" statement in a "for" loop will recognize increment statement (third statement in parentheses) and will execute it before jumping back to the beginning of loop. This way you will not get an endless loop.
> switch statements: A shorthand way of writing big 'if then else if...' blocks
new:
switch get_attack_type begin
case ATKTYPE_PUNCH: display_msg("punch");
case ATKTYPE_KICK: display_msg("kick");
default: display_msg("something else");
end
old:
variable tmp;
tmp := get_attack_type;
if tmp == ATKTYPE_PUNCH then begin
display_msg("punch");
end else if tmp == ATKTYPE_KICK then begin
display_msg("kick");
end else begin
display_msg("something else");
end
> empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
#define my_macro diplay_msg("foo");
procedure start begin
my_macro;
end
> Procedure stringify operator "@": designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceeded by "@" by a string constant.
Not many people know that since vanilla Fallout you can call procedures by "calling a variable" containing it's name as a string value. There was a couple of problems using this:
- optimizer wasn't aware that you are referencing a procedure, and could remove it, if you don't call it explicitly (can be solved by adding making procedure "critical")
- you couldn't see all references of a procedure from a Script Editor
- it was completely not obvious that you could do such a thing, it was a confusing syntax
old:
callbackVar := "Node000";
callbackVar();
new:
callbackVar := @Node000;
callbackVar();
> *arrays: In vanilla fallout arrays had to be constructed by reserving a block of global/map variables. Since sfall 2.7, specific array targeted functions have been available, but they are fairly messy and long winded to use. The compiler provides additional syntactic shorthand for accessing and setting array variables, as well as for array creation. When declaring an array variable, put a constant integer in []'s to give the number of elements in the array. (before sfall 3.4 you had to specify size in bytes for array elements, now it's not required, see "arrays.txt" for more information)
new:
procedure bingle begin
variable a[2];
a[0] := 5;
a[a[0] - 4] := a[0] + 4;
display_msg("a[0]=" + a[0] + ", a[1]=" + a[1]);
end
old:
procedure bingle begin
variable a;
a := temp_array(2, 4);
set_array(a, 0, 5);
set_array(a, get_array(a, 0) - 4, get_array(a, 0) + 4);
display_msg("a[0]=" + get_array(a, 0) + ", a[1]=" + get_array(a, 1));
end
> *array expressions: sometimes you need to construct an array of elements and you will probably want to do it in just one expression. This is now possible:
new:
list := ["A", "B", "C", "D"];
old:
list := temp_array(4, 2);
list[0] := "A";
list[1] := "B";
list[2] := "C";
list[3] := "D";
Syntax specific for associative arrays is also available. (see "arrays.txt" for full introduction to this type of arrays).
> *map array expressions:
map := {5: "five", 10: "ten", 15: "fifteen", 20: "twelve"};
> * "dot" syntax to access elements of associative arrays. "dot" syntax allows to work with arrays like objects:
trap.radius := 3;
trap.tile := tile_num(dude_obj);
you can chain dot and bracket syntax to access elements of multi-dimensional arrays:
collectionList[5].objectList[5].name += " foo";
NOTE: when using incremental operators like +=, *=, ++, -- compiler will use additional temp variable to get an array at penultimate level in order to avoid making the same chain of "get_array" calls twice.
> * "foreach" loops: A shorthand method of looping over all elements in an array. Syntax is 'foreach (<symbol> in <expression>) '
new:
procedure bingle begin
variable critter;
foreach (critter in list_as_array(LIST_CRITTERS)) begin
display_msg(""+critter);
end
end
old:
procedure bingle begin
variable begin critter; array; len; count; end
array := list_as_array(LIST_CRITTERS);
len := len_array(array);
count := 0;
while count < len do begin
critter := array[count];
display_msg("" + critter);
end
end
If you want an index array element (or key for "maps") at each iteration, use syntax: 'foreach (<symbol>: <symbol> in <expression>) '
foreach (pid: price in itemPriceMap) begin
if (itemPid == pid) then
itemPrice := price;
end
If you want to add additional condition for continuing the loop, use syntax: 'foreach (<symbol> in <expression> while <expression>) '. In this case loop will iterate over elements of an array until last element or until "while" expression is true (whatever comes first).
NOTE: just like "for" loop, "continue" statement will respect increments of a hidden counter variable, so you can safely use it inside "foreach".
====================
=== int2ssl note ===
====================
int2ssl by Anchorite (TeamX) is included in sfall modderspack package. It was updated to support all additional opcodes of sfall, along with some syntax features. You can use it to decompile any sfall or non-sfall script.
=============
=== Fixes ===
=============
playmoviealpharect was using the token for playmoviealpha, breaking both functions in the process.
addbuttonflag had an entry in the token table, and could be parsed, but was missing an entry in the emit list. This resulted in the compiler accepting it as a valid function, but not outputting any code for it into the compiled script.
The function tokenize was missing an entry in the token table, and so would not be recognised by the compiler.
fixed the check for the 'call "foo"' syntax so that non-string constants will no longer be accepted.
==============================
=== Backward compatibility ===
==============================
There are several changes in this version of sslc which may result in problems for previously working scripts. A new command line option '-b' is available, which will turn off all new fixes and features which have the possibility of causing a previously compiling script to change its behaviour. (And only those features; anything which would not compile under the old sslc is not affected.) This includes the following:
- Since 'for', 'foreach', 'break', 'continue', 'in' and 'tokenize' are now hardcoded names, existing scripts that use any of them as a variable or procedure name will no longer compile.
- Missing a semicolon after a variable declaration is now a hard error. (Originally sslc would check for the semicolon, but would not complain if it was missing.)
- The function addbuttonflag used to be recognised by the compiler, but would not emit any code into the int file.
- The function playmoviealpharect compiled as playmoviealpha
=================
=== Changelog ===
=================
> sfall 4.2.3
- fixed compiler giving "assignment operator expected" error when a variable-like macro is not being defined properly
- added new logical operators "AndAlso", "OrElse" for short-circuit evaluation of logical expressions
- added an alternative (C/Java-style) assignment operator "="
- added support for new "div" operator (unsigned integer division)
> sfall 4.2.2
- added support for new opcode "reg_anim_callback"
> sfall 4.2.1
- the basic optimization is now enabled by default when not specifying any optimization options
- added -m<macro[=val]> option to define a macro named "macro" for conditional compilation
- added -I<path> option to specify an additional directory to search for include files
- unreferenced "critical" procedures and procedures with the names "Node998" and "Node999" are now removed by the optimizer
> sfall 4.2
- now it is possible to run preprocess or optimization passes in backward compatibility mode
- added support for new opcode "register_hook_proc_spec"
> sfall 4.0:
- enabled code for "ceil" math function
- fixed missing argument for "how_much" function
- added "desc_p_proc" (from Fallout 1) to protected procedures that should not be removed by the optimizer
- fixed compiler giving "division by zero" error when using zero as the second factor in multiplication
> sfall 3.8
- added support for new universal opcodes sfall_funcX
> sfall 3.6:
- added Python-style ternary operator (conditional expression)
- added -s short-circuit evalution option for AND, OR expressions
- int2ssl will detect and decompile conditional expressions and short-circuit logical operators
- added -F option to include full file paths in "#line" directives after preprocessing
- added -D option to write abstract syntax tree into .txt file
- fixed compiler crash when number of arguments in procedure declaration does not match definition
- fixed incorrect constant folding of "bwnot" operator
- fixed more invalid results in constant folding
- implemented optional arguments for user-defined procedures
- implemented stringify procedure names using @ operator, which is helpful to pass procedures around to call them from variables (it will properly handle references)
- logic for procedures passed as arguments to scripting functions was moved from code generation to parsing stage
- now it is possible to call user-defined procedures inside argument list of scripting functions, without compiler attempting to treat them as procedure references and probably fail (procedures will still be passed, but only to appropriate scripting functions at appropriate argument positions)
- int2ssl will now place empty parantheses after a call to user-defined procedure - this will distinct calls from passing procedures to some scripting functions (like giq_option)
- fixed inline procedure "calls" not working when optimization is enabled
- added column numbers to error/warning output
- added code to simplify adding sfall opcodes into compiler (need to add code in 3 places, instead of 7 places for each opcode)
- fixed bug when initializing variable with expression starting from a symbol
- added division by zero constant check
> sfall 3.5:
- completed namespace compression optimization with respect to imported/exported variables
- changed 'for' and 'foreach' syntax to allow parentheses which are easier to read IMHO
- heavy code refactoring - split "parse.c" into several files, replaced all dirty workaround code in "lex()" (some syntax features) with parser-level equivalents
- added syntax to reference elements in multi-dimensional arrays (unlimited sequence of brackets [] and dots . )
- added fully featured "break" and "continue" statements for loops
- moved some optimizations (namely constant propagation and variable reuse) to "experimental" because they were breaking my scripts
- added ability to initialize variables with expressions
> sfall 3.4:
- added "foreach .. while .." syntax
- added array expressions for lists and maps
- added "foreach (key: value in ...)" syntax for convenience
- fixed crash bug in "for" loop parsing function
- added ability to access array elements with string keys using OOP-like dot (".") syntax
File diff suppressed because it is too large Load Diff
+34 -19
View File
@@ -87,19 +87,34 @@
#define FLAG_SEEN (0x40000000) #define FLAG_SEEN (0x40000000)
#define FLAG_SHOOTTHRU (0x80000000) #define FLAG_SHOOTTHRU (0x80000000)
/* Critter flags */
/* Critter Flags */
#define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with) #define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with)
#define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot steal from) #define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot be stolen from)
#define CFLG_NODROP 64 // 0x00000040 - Drop (doesn't drop items) #define CFLG_NODROP 64 // 0x00000040 - Drop (doesn't drop items)
#define CFLG_NOLIMBS 128 // 0x00000080 - Limbs (cannot lose limbs) #define CFLG_NOLIMBS 128 // 0x00000080 - Limbs (cannot lose limbs)
#define CFLG_NOAGES 256 // 0x00000100 - Ages (dead body does not disappear) #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_NOHEAL 512 // 0x00000200 - Heal (damage is not healed with time)
#define CFLG_INVULN 1024 // 0x00000400 - Invulnerable (cannot be hurt) #define CFLG_INVULN 1024 // 0x00000400 - Invulnerable (cannot be hurt)
#define CFLG_FLATTN 2048 // 0x00000800 - Flatten (leaves no dead body) #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_SPECIAL 4096 // 0x00001000 - Special (has a special type of death)
#define CFLG_RANGED 8192 // 0x00002000 - Range (melee attack is possible at a distance) #define CFLG_RANGED 8192 // 0x00002000 - Range (has extra hand-to-hand range)
#define CFLG_NOKNOCKDOWN 16384 // 0x00004000 - Knock (cannot be knocked down) #define CFLG_NOKNOCKBACK 16384 // 0x00004000 - Knock (cannot be knocked back)
#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // obsolete
/* Window flags */
#define WIN_FLAG_MOVEONTOP (0x4)
#define WIN_FLAG_HIDDEN (0x8)
#define WIN_FLAG_EXCLUSIVE (0x10)
#define WIN_FLAG_TRANSPARENT (0x20)
/* Message window flags */
#define MSGBOX_AUTOSIZE (0x0)
#define MSGBOX_NORMAL (0x1)
#define MSGBOX_SMALL (0x2)
#define MSGBOX_ALIGN_LEFT (0x4) // text aligned to left
#define MSGBOX_ALIGN_TOP (0x8) // text aligned to top
#define MSGBOX_YESNO (0x10) // use YES/NO buttons instead of DONE
#define MSGBOX_CLEAN (0x20) // no buttons
//remove inven obj defines //remove inven obj defines
#define RMOBJ_CONSUME_DRUG 4666772 #define RMOBJ_CONSUME_DRUG 4666772
@@ -120,7 +135,7 @@
#define RMOBJ_RM_MULT_OBJS 4563866 #define RMOBJ_RM_MULT_OBJS 4563866
#define RMOBJ_REPLACE_WEAPON 4658526 #define RMOBJ_REPLACE_WEAPON 4658526
#define RMOBJ_THROW 4266040 #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 // common prototype offsets for get/set_proto_data
#define PROTO_PID (1) #define PROTO_PID (1)
@@ -328,7 +343,6 @@
#define ai_area_be_absolutely_sure (4) #define ai_area_be_absolutely_sure (4)
// AI attack who mode values // AI attack who mode values
#define ai_attack_no_pref (-1)
#define ai_attack_whomever_attacking_me (0) #define ai_attack_whomever_attacking_me (0)
#define ai_attack_strongest (1) #define ai_attack_strongest (1)
#define ai_attack_weakest (2) #define ai_attack_weakest (2)
@@ -345,12 +359,12 @@
#define ai_run_away_never (7) #define ai_run_away_never (7)
// AI disposition values // AI disposition values
#define ai_disposition_none (0) #define ai_disposition_none (-1)
#define ai_disposition_custom (1) #define ai_disposition_custom (0)
#define ai_disposition_coward (2) #define ai_disposition_coward (1)
#define ai_disposition_defensive (3) #define ai_disposition_defensive (2)
#define ai_disposition_aggressive (4) #define ai_disposition_aggressive (3)
#define ai_disposition_berserk (5) #define ai_disposition_berserk (4)
// AI distance values // AI distance values
#define ai_distance_stay_close (0) #define ai_distance_stay_close (0)
@@ -385,15 +399,16 @@
#define OBJ_DATA_FID (0x20) #define OBJ_DATA_FID (0x20)
#define OBJ_DATA_ELEVATION (0x28) #define OBJ_DATA_ELEVATION (0x28)
#define OBJ_DATA_PID (0x64) #define OBJ_DATA_PID (0x64)
#define OBJ_DATA_CID (0x68) // combat id, used for savegame #define OBJ_DATA_CID (0x68) // combat ID, used for savegame
#define OBJ_DATA_SID (0x78) #define OBJ_DATA_SID (0x78) // script ID
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
// items // items
#define OBJ_DATA_CUR_CHARGES (0x3C) #define OBJ_DATA_CUR_CHARGES (0x3C) // for key items it's the key code
// critters // critters
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee #define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
#define OBJ_DATA_CUR_ACTION_POINT (0x40) #define OBJ_DATA_CUR_ACTION_POINT (0x40)
#define OBJ_DATA_DAMAGE_LAST_TURN (0x48) #define OBJ_DATA_DAMAGE_LAST_TURN (0x48)
#define OBJ_DATA_WHO_HIT_ME (0x54) #define OBJ_DATA_WHO_HIT_ME (0x54) // current target of the critter
// compute attack result data offsets // compute attack result data offsets
#define C_ATTACK_SOURCE (0x00) #define C_ATTACK_SOURCE (0x00)
+11
View File
@@ -5,6 +5,17 @@
Numbers... Numbers...
*/ */
#define above(a, b) (unsigned_comp(a, b) > 0)
#define above_equal(a, b) (unsigned_comp(a, b) >= 0)
#define below(a, b) (unsigned_comp(a, b) < 0)
#define below_equal(a, b) (unsigned_comp(a, b) <= 0)
// for sfall 4.2.3/3.8.23
pure procedure unsigned_comp(variable a, variable b) begin
if ((a bwxor b) == 0) then return 0; // a == b
return 1 if ((b == 0) orElse a div b) else -1;
end
#define MAX(x, y) ((x > y) * x + (x <= y) * y) #define MAX(x, y) ((x > y) * x + (x <= y) * y)
#define MIN(x, y) ((x < y) * x + (x >= y) * y) #define MIN(x, y) ((x < y) * x + (x >= y) * y)
#define in_range(x, from, to) (x >= from and x <= to) #define in_range(x, from, to) (x >= from and x <= to)

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