Compare commits

..
185 Commits
Author SHA1 Message Date
NovaRain 69ccc1cfab Merge branch 'develop' 2020-08-22 13:15:50 +08:00
NovaRain ac4e4c7868 Minor edits to Interface.cpp and ddraw.ini 2020-08-22 10:48:46 +08:00
NovaRain d46bb42efd Reorganized hooks related code 2020-08-21 12:55:18 +08:00
NovaRain aa132d9951 Moved DeathScreenFontPatch code to Interface.cpp
Added a note about DeathScreenFontPatch in ddraw.ini.

Some code edits in BugFixes.cpp and DamageMod.cpp.
2020-08-21 12:36:41 +08:00
NovaRain dfb7779e87 Reorganized the code related to the core functions of hooks
Added DeathScreenFontPatch option to use the normal font for death
screen subtitles (was using bitmap font).

Attempted to fix the melee damage display for some extreme cases when
BonusHtHDamageFix=1 and DisplayBonusDamage=0.
2020-08-20 13:32:40 +08:00
NovaRain 19df2f9eec Updated global.fx and withinperception example script
Fixed some code.
2020-08-19 15:19:11 +08:00
NovaRain e6d30d7def Added a fix to limit the maximum distance for knockback animation
* 20 hexes at max. This does not affect the knockback value in
Combat Damage hook, only the animation part.
2020-08-18 13:07:25 +08:00
NovaRain c657a9ef86 Added a fix to prevent the player from leaving the map during death anim
* when the death animation causes the player to cross an exit grid.

Fixed the height of the black background for the subtitles on death
screens when using the hi-res patch.

Added MakeJumps method to SafeWrite.cpp and devlog_f to Logging.cpp.
2020-08-17 15:07:41 +08:00
NovaRain cbccc7de4e Fixed the use of #pragma pack() directives for structures
Corrected HookFile struct in the previous commit.
2020-08-16 11:09:31 +08:00
NovaRain 8fa54d8255 Changed hs_* hook script to be searched only once on game start
* in the same fashion as global scripts, affected by AlwaysFindScripts.
2020-08-15 22:19:45 +08:00
NovaRain 46a5616b34 Fixed and improved the behavior of nested timer events in global scripts
Added a fix to prevent the execution of critter_p_proc and game events
when playing movies.

Added a debug message about a corrupted proto file.

Some minor code/document edits.
2020-08-14 21:23:08 +08:00
NovaRain ff4757d529 Fixed the playback of additional movies defined in the MovieXX options (#330)
Added the keyboard buffer cleanup function to metarule3.
2020-08-13 15:20:30 +08:00
NovaRain b0a35eec49 Added the city name in the description of a save slot by default
Corrected some code.
2020-08-13 14:38:09 +08:00
NovaRain d553e9cbdd Added a fix to remove floating text after moving to another elevation
* also update black edges of the map (HRP bug, #282)
2020-08-09 12:17:32 +08:00
NovaRain d2b1cdec46 Changed the behavior of ObjCanSeeObj_ShootThru_Fix
* now the critter can only see through objects in front of it.
2020-08-08 11:50:12 +08:00
NovaRain 37b4a18770 Added a patch to allow setting custom colors for object outlines
Added a tweak to ObjCanSeeObj_ShootThru_Fix to allow critters to see
through other critters.

Corrected some code.
2020-08-05 16:10:28 +08:00
NovaRain fd1067373a Changed the behavior for replacing art aliases for critters
Added ANIM_charred_body/ANIM_charred_body_sf animations to art aliases
(#323)

Minor code edit to OverrideMusicDir (nop the rest to avoid leaving
garbage bytes)
2020-08-03 14:28:01 +08:00
NovaRain 82b75f4ea2 Corrected combat_attack_gcsd code in the previous commit
Added DAM_PRESERVE_FLAGS to attack_complex for keeping result flags.
Fixed OverrideMusicDir=2 not working (#295)
2020-08-02 19:43:51 +08:00
NovaRain 435180d157 Rewrote several fixes for attack_complex in C++ and merged them
Added a default fix for attack_complex to untie target_results from
attacker_results.
2020-08-01 10:22:30 +08:00
NovaRain 694d97e123 Added more fixes for the arguments of attack_complex function:
* fixed result flags for the attacker and the target when calling
attack_complex function (#323)

* tweaked how attacker_results/target_results work when
AttackComplexFix is enabled.

Minor code edits.
2020-07-31 20:35:58 +08:00
NovaRain a27f020edc Added support for delayed speech playback to AllowDShowSound
(for synchronizing with subtitles when playing endgame slideshow)
2020-07-30 10:29:06 +08:00
NovaRain da5484668c Added a new value 2 to AllowDShowMovies
* for forcing avi videos to fit the screen width.

Disabled warning C4995 (e.g. wcscpy in Movies.cpp)
2020-07-29 14:16:45 +08:00
NovaRain 600360638e Added volume control support for avi movies
Fixed implementation bugs when playing avi movies.
Added a couple of engine variable defines.
2020-07-28 15:21:47 +08:00
NovaRain 19be167c19 Further implementation of speech playback for alternative sound files 2020-07-26 08:46:16 +08:00
NovaRain deaaf6a137 Added a function extension for vanilla metarule3 function
Added SET_HORRIGAN_ENCOUNTER function to metarule3.
Updated German translation.
2020-07-24 21:20:48 +08:00
NovaRain 29da941582 WIP: Fixed sfx/speech playback for alternative sound files 2020-07-22 12:24:20 +08:00
NovaRain b178e15b31 Implemented CodeType enums in some SafeWrite8
Replaced some SafeWriteX with SafeWriteBatch.
Minor edits to documents.
2020-07-21 12:28:15 +08:00
NovaRain 2491cb22af Removed some redundant code 2020-07-19 08:38:48 +08:00
NovaRain 85afa1e4d8 Fixed the default values for the MovieXX options
Added some comments to elevators.ini & other codes.
Updated version number.
2020-07-18 22:13:54 +08:00
NovaRain 64da4dce6c Uploaded language translation files to repo
Updated German (#326) and Russian translations.
2020-07-08 09:55:30 +08:00
NovaRain e10b7ca718 Merge branch 'develop' 2020-07-03 21:37:11 +08:00
NovaRain 586d41cce8 Minor edit to ddraw.ini 2020-07-03 21:36:51 +08:00
NovaRain 30d249f02e Fixed NPC stuck in an animation loop in combat (#321)
* this happens when trying to move close to a multihex critter.
2020-07-01 09:47:02 +08:00
NovaRain 467d895ba6 Removed AutoSearchPath from ddraw.ini
* the folder path for auto-loading custom files is now constant.
2020-06-30 22:02:21 +08:00
NovaRain bfaed2eb68 Fixed ASM error in the previous commit 2020-06-30 15:49:32 +08:00
NovaRain a43a28fe8b Fixed broken PlayIdleAnimOnReload option (#320)
(in commit af049ea)

Improved the fix for incorrect positioning after exiting small/medium
locations.
2020-06-30 12:26:56 +08:00
NovaRain 5dd8c441b9 Fixed the code for "display_stats" script function
Minor edit to Perks.cpp.
2020-06-29 23:02:45 +08:00
NovaRain 440cfbd72c Added a fix to prevent showing an empty perk selection window 2020-06-29 12:47:57 +08:00
NovaRain 1db8988368 Added "get_stat_max/min" script functions (#307)
Added updating player's stats on the char screen to "display_stats"
script function (#314)
2020-06-29 11:53:12 +08:00
NovaRain 6ecc1fcd1f Corrected the code for multihex retargeting tile
Small optimization to sfall function code.
2020-06-28 23:11:51 +08:00
NovaRain 6c8bbea764 Re-fix for the previous commit 2020-06-28 09:51:29 +08:00
NovaRain d947150dc1 Corrected the fix from the previous commit 2020-06-27 10:12:34 +08:00
NovaRain f5ecaa8bd2 Fixed the hang/freeze in combat (from commit d888161)
Added a fix for retargeting tile for multihex critters.
2020-06-27 09:46:43 +08:00
NovaRain e389bb0dc5 Fixed bugs in the hero appearance mod:
* gender was not reset properly when creating a new character (#309)
* the player was missing some fire/electrical death animations (#310)
2020-06-14 09:25:57 +08:00
NovaRain 94296b40d8 Moved static addresses into respective funcs in Stats.cpp 2020-06-13 00:24:13 +08:00
NovaRain fab5aa2f2f Fixed Auto Doors example script mod
Cosmetic changes to the text descriptions in Perks.ini.
2020-06-13 00:14:44 +08:00
NovaRain 703073e255 Increased the max width of the player name on the char screen (#305)
Updated version number.
2020-06-04 06:38:48 +08:00
NovaRain d888161128 Some bug fixes regarding multihex critters in shoot blocking 2020-05-24 11:30:32 +08:00
NovaRain ea921aabbd Merge branch 'develop' 2020-05-21 09:42:23 +08:00
NovaRain b263b69fa3 Renamed all script opcode handlers with op_ prefix
Renamed all metarule functions with mf_ prefix.
2020-05-20 11:30:25 +08:00
NovaRain 6bb56b0f95 Minor code fixes in AI.cpp:
* Fixed NPCs being unable to select a burst attack mode if the line of
fire was blocked.

* Changed the return point of combat_ai_hook_FleeFix to run
ai_check_drugs_ first.

Changed the debug message about missing art file for critters to be
displayed in game only when in sfall debugging mode.
2020-05-19 09:48:46 +08:00
NovaRain 9a4f0c7505 Merge branch 'develop' 2020-05-11 09:35:28 +08:00
NovaRain c89a18522d Fixed ai_move_away_ engine function
Some minor fixes.
2020-05-10 09:56:11 +08:00
NovaRain c7ccb7f2c2 Edited the msg for SkipLoadingGameSettings a bit
Added a few more defines.
2020-05-08 10:44:37 +08:00
NovaRain b25ca683f3 Cosmetic changes to the code:
Use double underscore for stdcall and "asm" keyword.
2020-05-07 12:27:53 +08:00
NovaRain e28b3a5796 Minor code edits to Combat.cpp
Added some function defines.
2020-05-07 12:13:28 +08:00
NovaRain a9c74501df Added checking AP cost to ai_pick_hit_mode_ engine function 2020-05-07 09:47:57 +08:00
NovaRain b03b93d6fc Added a tweak for finding new targets for PMs
* before they would "forget" their current target when trying to find
new ones (only 3), now the current target is included as one of
potential targets.

Tweaked the code of MultiHexPathingFix.
2020-05-05 12:13:11 +08:00
NovaRain 1f696b9f12 Added internal implementation of engine functions with hooks:
* item_w_mp_cost_ with CALCAPCOST
* is_within_perception_ with WITHINPERCEPTION
2020-05-01 10:27:05 +08:00
NovaRain 3d2d1cdf2a Added combat rating check to "Snipe" distance preference fix 2020-05-01 08:00:49 +08:00
NovaRain 42347ac062 Added a fix to reduce friendly fire in burst attacks (experimental) 2020-04-30 16:01:57 +08:00
NovaRain 007b415740 Changed the priority of files in AutoSearchPath
* now they have higher priority than the PatchFileXX options.

Minor code edits/fixes.
2020-04-30 10:13:44 +08:00
NovaRain 35d2491bcb Added a fix for AI behavior for "Snipe" distance preference
Added a check for for the weapon range and the distance to the target
when AI is choosing weapon attack modes.
2020-04-28 10:55:56 +08:00
NovaRain ece76ee726 Changed the fix for AI target selection in commit f731de7
* NPCs will reload the weapon in the same turn (and attack if have
enough AP left) if weapon is empty while selecting targets.

Misc code edits.
2020-04-27 14:25:40 +08:00
NovaRain d6f4a23527 Fixed AllowDShowSound=2 not working
Limited NumSoundBuffers to the max of 32.
Fixed replacing Body_Torso with Body_Uncalled (from commit 7e31713)
Corrected the code in the previous commit.
2020-04-23 12:33:00 +08:00
NovaRain 045ad2f5d7 Added a tweak to the miss message in combat
* if the main target has Flat flag set, remove the message about hitting
another object.

Minor code edits to DebugEditor.cpp & MiscPatches.cpp.
2020-04-22 11:32:03 +08:00
NovaRain 13703f1a3b Improved the fix for placing PID_CORPSE_BLOOD obj on the lower layer
(didn't work correctly after re-entering the map.)

Fixed CorpseDeleteTime not setting the timer correctly.
2020-04-21 10:54:35 +08:00
NovaRain 58bb77d79f Fixed GvarID option behavior in Drugs.ini
Reverted incorrect code change of SpeedPatch.cpp in previous commit.
Some code edits to Explosions.cpp and Perks.cpp.
2020-04-19 09:58:47 +08:00
NovaRain 229371e4ab Added use_item_on_dude macro to sfall.h
Various code edits:
* Implemented more HookCalls/MakeCalls/SafeWriteBatch in code.
* Moved return/jump address consts into their respective functions.
* Changed for-loop with iterators to use pre-increment.
2020-04-18 21:19:22 +08:00
NovaRain 1884e279c7 Fixed ReloadWeaponKey for using any non-weapon item (#84) 2020-04-18 10:44:17 +08:00
NovaRain e81d79e43e Fixed "loot_obj" script function 2020-04-18 08:57:02 +08:00
NovaRain f731de7a25 Fixed AI target selection for no ammo or target out of range cases 2020-04-18 08:33:08 +08:00
NovaRain 0d6bc33279 Re-fixed automatically ending combat
Updated version number.
2020-04-18 07:28:00 +08:00
NovaRain 3377516f67 Merge branch 'develop' 2020-04-05 22:14:57 +08:00
NovaRain 359c79a854 Fixed NPCs not fully reloading a weapon sometimes
* NPCs use only one box per reload. If the weapon has more ammo
capacity than a box of ammo (e.g. miniguns and BB gun), it'll take
several tries for them to fully reload it.
2020-04-05 08:19:31 +08:00
NovaRain 41652ec459 Moved static addresses into respective funcs in BugFixes & MiscPatches 2020-04-03 23:14:23 +08:00
NovaRain ca4e506f1d Some code correction in BugFixes
Minor edits to documents.
2020-04-03 12:16:09 +08:00
NovaRain 6e05ca65fd Some code/document edits 2020-04-02 11:32:22 +08:00
NovaRain 873d9f81c2 Edited the description of RadEffectsRemovalMsg option 2020-04-01 22:09:46 +08:00
NovaRain 0978769dfc Fixed loading savegame for "NPC turns into a container" bug fix
Added RadEffectsRemovalMsg option for radiation fixes.

Some code/document correction.
2020-03-31 21:51:41 +08:00
NovaRain 29608bb51c Added ActiveGeigerMsgs option and radiation fixes
Changed "Radiated" to be highlighted in red color when the player is
under the influence of negative effects of radiation.
2020-03-30 21:06:11 +08:00
NovaRain ba911375a9 Fixed a crash when using older versions of HRP
Fixed potential crash/bug when alt-tab out of game and get back.
Edited OnDeath hook code to minimize its hook points to the engine.
Minor edits to ddraw.ini.
2020-03-26 14:06:46 +08:00
NovaRain ce5c65d37f Fixed stuttering when playing avi movies
Fixed a crash when playing mve movies without the hi-res patch.

Minor edits to ddraw.ini and function notes.txt.
2020-03-24 10:53:00 +08:00
NovaRain ffd397d9aa Added performance patches, some code moved to MiscPathes module
Minor edits to ddraw.ini.
2020-03-22 09:00:25 +08:00
NovaRain 349cffac0c Added a new "fullscreen windowed" DX9 mode
Added saving the position of the game window to ddraw.ini
2020-03-20 12:24:48 +08:00
NovaRain dfdcd86134 Refactored ASM code of script opcode handlers
Included call_offset_xx functions for AllowUnsafeScripting=2 (#288)
2020-03-19 12:55:01 +08:00
NovaRain accdeae6ad Added a new value to AllowUnsafeScripting
* for disabling the memory address check in unsafe functions (#288)
2020-03-17 13:26:02 +08:00
NovaRain 288a8fedfd Improved and fixed the playback of alternative sound files
Added a new mode to play_sfall_sound script function.

Minor code corrections.
2020-03-17 13:06:34 +08:00
NovaRain eb777e6d19 Fixed the return value of play_sfall_sound function
* before it returned a raw pointer instead of the ID number of the
played sound.
2020-03-12 11:53:45 +08:00
NovaRain dd2469b78f Moved allowDShowSound code from Movies to Sound module 2020-03-12 10:03:43 +08:00
NovaRain 8d375dd81a Refactored ASM code of script handlers in Misc.cpp
Minor code edits.
2020-03-07 14:21:12 +08:00
NovaRain 7f087d1c30 Minor code edits to AI module 2020-02-29 18:58:38 +08:00
NovaRain e7e5da866a Added a new value to the 'mark_state' arg of mark_area_known function
* 3 - uncovers locations without highlighting their sub-tiles.
(Fallout 1 behavior)
2020-02-29 08:36:30 +08:00
NovaRain ac0b0ef7ef Fixed Fill_W not uncovering all tiles to the left (#287) 2020-02-28 07:41:49 +08:00
NovaRain c2626de4fa Fixed a crash or animation glitch of the critter in combat (beta fix)
* when an explosion from explosives and the AI attack animation are
performed simultaneously.
2020-02-25 11:38:03 +08:00
NovaRain e4d395224a Minor code fix for Graphics.cpp
Added notes/correction to hookscripts.txt.
2020-02-22 15:49:13 +08:00
NovaRain 4487bbfeba Fixed the player's money not being displayed after barter (#286)
Restored TownMapHotkeysFix option.

Updated version number.
2020-02-22 15:31:17 +08:00
NovaRain e5eb5cc275 Minor code improvement in Graphics.cpp 2020-02-09 09:23:50 +08:00
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
180 changed files with 11015 additions and 6410 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
# 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
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- 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)
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 -2
View File
@@ -13,18 +13,25 @@ Count=0
[1]
; drug item PID
PID=0
; set a limit on the count of first and second delayed effects when using the drug, i.e. if the queue has delayed effects from the drug,
; and their count is greater or equal to NumEffects, it is not possible to obtain new effects from using the drug
; this count is 4 for Buffout/Mentats/Psycho/Jet
; e.g. this count is 4 for Buffout/Mentats/Psycho/Jet
; set -1 to leave this parameter unchanged
NumEffects=-1
; the duration of the addiction effect in game minutes (i.e. 1440 = 24 game hours)
; set to 0 to use the default time (7 days for all drugs except Jet)
; set to 0 to use the default time of 7 days (as all drugs except Jet)
AddictTime=0
; the number of the global variable from vault13.gam responsible for displaying addiction in the character screen
; if you set GvarID with numbers: 21-26, 295, 296, or variable numbers that have already been declared in previous sections,
; the TextID and FrmID options in this section will be ignored
; set to 0 if the addiction is not required
GvarID=0
; the index number from editor.msg to display the title of the addiction (the description uses the index number of TextID + 100)
TextID=-1
; the line number (0-indexed) of the corresponding FRM in skilldex.lst
FrmID=-1
+28 -35
View File
@@ -1,10 +1,9 @@
;This file handles modifications to perks and traits
;When adding extra perks to a mod, it's advisable to use
; the fake perk scripting functions rather than make modifications
; in this file, as some perks have hardcoded effects which may
; catch you out
;Since traits need to be picked before any scripts run, they
; have an additional NoHardcode option in this file which can
;When adding extra perks to a mod, it's advisable to use the fake perk scripting functions rather than make modifications
; in this file, as some perks have hardcoded effects which may catch you out
;Since traits need to be picked before any scripts run, they have an additional NoHardcode option in this file which can
; be used to remove their hardcoded effects, and add new stat/skill effects
[PerksTweak]
@@ -31,41 +30,35 @@ WeaponHandlingBonus=3
;Set to 1 to enable the modifications for perks
Enable=0
;Name=The name of the perk (max 63 characters)
;Desc=The description of the perk (max 255 characters)
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
;Ranks=The number of perk levels
;Level=The minimum required level
;Type=If 0, the perk checks only Skill1 for skill requirements; if 1, it checks
; Skill1 or Skill2; if 2, it checks both Skill1 and Skill2
;Stat=The modified stat or -1 if you don't want to change any stats
;StatMag=The increased/decreased value to the modified stat
;Skill1=The first skill (or -1 for none) to check, but if you set a specific bit
; (67108864 or 0x4000000), it checks GVAR. For example, if Skill1=67108864, then
; the perk will check GVAR_PLAYER_REPUTATION (67108864 + 0) on Skill1Mag value
;Skill1Mag=Positive value is used as the minimum requirements of the first
; skill/GVAR, and a negative value is interpreted as the maximum requirement.
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill
; >= 100 and meets all other requirements, the perk will be available in the
; selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be
; available if player has big guns skill >= 120
;Skill2=The second skill/GVAR (or -1 for none) to check
;Skill2Mag=Same as Skill1Mag, but for Skill2
;STR-LCK=Positive values are used as minimum requirements of SPECIAL stats, and
; negative values are interpreted as maximum requirements. For some special
; perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat),
; the values are not used as requirements but to add to corresponding SPECIAL
; stats
;Name: The name of the perk (max 63 characters)
;Desc: The description of the perk (max 255 characters)
;Image: The line number (0-indexed) of the corresponding FRM in skilldex.lst
;Ranks: The number of perk levels
;Level: The minimum required level
;Type: If 0, the perk checks only Skill1 for skill requirements; if 1, it checks Skill1 or Skill2; if 2, it checks both Skill1 and Skill2
;Stat: The modified stat or -1 if you don't want to change any stats
;StatMag: The increased/decreased value to the modified stat
;Skill1/Skill2: The first/second skill (or -1 for none) to check, but if you set a specific bit 0x4000000 (67108864), it checks GVAR.
; For example, if Skill1=0x4000004, then the perk will check GVAR_BAD_MONSTER (0x4000000 + 4) on Skill1Mag value
;Skill1Mag/Skill2Mag: Positive value is used as the minimum requirements of the first/second skill/GVAR, and a negative value is interpreted as the maximum requirement.
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill >= 100 and meets all other requirements, the perk will be available in the
; selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be available if player has big guns skill >= 120
;STR-LCK: Positive values are used as minimum requirements of SPECIAL stats, and negative values are interpreted as maximum requirements.
; For some special perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat), the values are not used as requirements
; but to add to corresponding SPECIAL stats
;If the value is set to -99999, the variable will be ignored (similar to comment out that line)
;You can add simple extra perks with ID numbers from 119 to 255
; that do not require using scripting functions to change player stats, and can also be used for Armor perks
;These parameters are only for extra perks
;Stat1-Stat2 = same as Stat
;Stat1Mag-Stat2Mag = same as StatMag
;Skill3-Skill5 = The skill to be modified (or -1 for none)
;Skill3Mod-Skill5Mod = The increased/decreased value to the modified skill
;Stat1/Stat2: same as Stat
;Stat1Mag/Stat2Mag: same as StatMag
;Skill3-Skill5: The skill to be modified (or -1 for none)
;Skill3Mod-Skill5Mod: The increased/decreased value to the modified skill
;##############################################################################
;This is a modification to vanilla perk 0
+2 -2
View File
@@ -40,7 +40,7 @@ Image=24
ButtonCount=3
;Set the appearance of the elevator
MainFrm=148
ButtonsFrm=151
MainFrm=148 ; EL_VAULT.FRM
ButtonsFrm=151 ; EL_MIL3.FRM
;Set up the exit points for all three buttons (see examples above)
+1
View File
@@ -21,6 +21,7 @@ CheckLOS=0
; 16 - bright yellow
; 32 - dark yellow
; 64 - purple
; You can set a custom color from the game palette by multiplying the color index value by 256 (available since sfall 4.2.7)
OutlineColor=16
; Motion Scanner mode:
+148 -98
View File
@@ -1,12 +1,12 @@
;sfall configuration settings
;v4.2.1
;v4.2.7
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
UseCommandLine=0
;Uncomment and point to a file to get alternate translations for some sfall messages
;TranslationsINI=.\Translations.ini
;TranslationsINI=sfall\Translations.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[ExtraPatches]
@@ -18,30 +18,12 @@ UseCommandLine=0
;The greater numbers take precedence over lesser numbers
;PatchFile0=mods\RP_data
;Path to the folder in which the game will automatically search and load custom .dat files
;The data load order of the .dat files in the folder will be in reverse alphabetical order of the filenames
;The .dat files specified in the PatchFileXX options will have higher priority than others
;Uncomment the option to specify a different folder path. The default path is <GameRoot>\mods\
;Path to the folder in which the game will automatically search and load custom files (by *.dat mask, including folders)
;The data load order of the files in the folder will be in reverse alphabetical order of the filenames
;The files placed in this folder will have higher priority than the PatchFileXX options
;This option has no effect in v4.2.6 or later. The default path is <GameRoot>\mods\
;AutoSearchPath=mods
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Sound]
;Sets the number of allowed simultaneous sound effects
;Set to 0 to leave the default unchanged (i.e. 4)
NumSoundBuffers=0
;Set to 1 to allow attaching sound files to combat float messages
AllowSoundForFloats=0
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
AllowDShowSound=0
;Set to 1 to override the music path used by default (i.e. data\sound\music\) if not present in the cfg
;Set to 2 to overwrite all occurances of the music path
OverrideMusicDir=2
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Speed]
;Set to 0 to disable everything in this section
@@ -70,6 +52,7 @@ AffectPlayback=0
;Set to 0 for 8 bit fullscreen
;Set to 4 for DX9 fullscreen
;Set to 5 for DX9 windowed
;Set to 6 for DX9 fullscreen windowed (the resolution in f2_res.ini should be set to the same aspect ratio as your desktop resolution)
;A DX9 mode is required for any graphics related script extender functions to work (i.e. fullscreen shaders)
;Modes 1, 2 and 3 are no longer supported
Mode=0
@@ -80,6 +63,14 @@ Mode=0
GraphicsWidth=0
GraphicsHeight=0
;Window position data. Do not modify
;Set to 0 to reset if the window position is incorrect
WindowData=0
;Uncomment the option to use a hardware shader (requires DX9 graphics mode)
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
;GlobalShaderFile=global.fx
;Set to 1 to do the palette conversion on the GPU
;Set to 2 to do the palette conversion on the CPU
;Set to 0 to pick automatically
@@ -94,7 +85,8 @@ GPUBlt=0
Use32BitHeadGraphics=0
;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies
;Requires DX9 graphics mode 4 or 5
;Set to 2 to force avi videos to fit the screen width
;Requires DX9 graphics mode
AllowDShowMovies=0
;Fade effect time percentage modifier
@@ -103,6 +95,11 @@ FadeMultiplier=100
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[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 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
@@ -110,10 +107,35 @@ FadeMultiplier=100
;The resolution of hi-res patch must be set to at least 890x720
ExpandWorldMap=0
;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 draw a dotted line while traveling on the world map (similar to Fallout 1)
WorldMapTravelMarkers=0
;Uncomment these lines to change the appearance of the markers
;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
[Sound]
;Sets the number of allowed simultaneous sound effects
;Set to 0 to leave the default unchanged (i.e. 4). The maximum is 32
NumSoundBuffers=0
;Set to 1 to allow attaching sound files to combat float messages
AllowSoundForFloats=0
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
AllowDShowSound=0
;Set to 1 to override the default music path with data\sound\music\ if music_path is not present in the cfg
;Set to 2 to overwrite all occurrences of the music path
OverrideMusicDir=1
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Input]
@@ -167,12 +189,12 @@ SpeedKey7=0x00
SpeedKey8=0x00
SpeedKey9=0x00
;A key to hold down to move the window around when using graphics mode 5
;A key to hold down to move the window around when using DX9 graphics mode 5
;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise
;Set to -1 for either ctrl key, -2 for either alt key or -3 for either shift key
WindowScrollKey=0
;A key to press to reload your currently equipped weapon
;A key to press to reload your currently equipped weapon or use the active item
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
ReloadWeaponKey=0
@@ -194,6 +216,7 @@ DebugEditorKey=0
;Changes some of Fallout 2 engine functions to Fallout 1 behavior:
;- disables playing the final movie/credits after the endgame slideshow
;- disables halving the weight for power armor items
;- endgame_movie script function plays movie 10 or 11 based on the player's gender before the credits
Fallout1Behavior=0
;Time limit in years. Must be between -3 and 13
@@ -245,10 +268,15 @@ UseFileSystemOverride=0
;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
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
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.
;The default models can also be changed ingame via script
;MaleStartModel=hmwarr
@@ -257,7 +285,8 @@ FemaleDialogMsgs=0
;FemaleDefaultModel=hfjmps
;To change the various ingame movies, modify the next 17 lines
;Most of these can also be changed ingame via script.
;You can also define additional movies by adding Movie18 - Movie32 lines
;Most of these can also be changed ingame via script
Movie1=iplogo.mve
Movie2=intro.mve
Movie3=elder.mve
@@ -288,9 +317,6 @@ Movie17=credits.mve
;LocalMapXLimit=480
;LocalMapYLimit=400
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
;PerksFile=Perks.ini
;Set to 1 if you want the pipboy to be available at the start of the game
;Set to 2 to make the pipboy available by only skipping the vault suit movie check
PipBoyAvailableAtGameStart=0
@@ -316,7 +342,7 @@ 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
;Set to 1 to disable the random element in NPC levelling.
@@ -337,13 +363,10 @@ SingleCore=1
OverrideArtCacheSize=0
;Prevents you from saving in combat except at the start of your turn to avoid a few bugs
;Note that even with this option enabled, it is still not advisable to save in combat at all.
;Note that even with this option enabled, it is still not advisable to save in combat at all (obsolete information)
;Set to 2 to block all saving in combat
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.
;Player's level is capped once the highest specified level is reached
;XPTable=50,100,200
@@ -372,8 +395,6 @@ AdditionalWeaponAnims=1
;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
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
DisplayKarmaChanges=0
@@ -385,14 +406,14 @@ AlwaysReloadMsgs=0
PlayIdleAnimOnReload=0
;Changes the timer (in days) for deleting corpses on a map after you leave (valid range: 0..13)
;The corpses of critters with 'Ages' flag or on maps with 'dead_bodies_age=No' set in maps.txt will not disappear
;The corpses of critters with 'Ages' flag set 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
CorpseDeleteTime=6
;Set a number of milliseconds to idle each input loop
;Set to -1 to disable
;Set to 0 to idle only if other processes are waiting for processor time
;Set to 1 (or some higher number if needed, the maximum is 127) to prevent 100% CPU use
;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) to prevent 100% CPU use. The maximum is 127
ProcessorIdle=-1
;Set to 1 if using the hero appearance mod
@@ -435,6 +456,9 @@ Doctor=293
Science=293
Repair=293
;Set to 1 to remove window position rounding for script-created windows
RemoveWindowRounding=1
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
;Set to 2 to use a different set of scroll buttons
UseScrollingQuestsList=1
@@ -455,7 +479,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
;Set this to a valid path to save a copy of the console contents
;ConsoleOutputPath="bingle.txt"
;ConsoleOutputPath=console.txt
;Set to 1 to add additional pages of save slots
ExtraSaveSlots=0
@@ -498,9 +522,6 @@ BonusHtHDamageFix=1
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
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)
AnimationsAtOnceLimit=120
@@ -522,23 +543,11 @@ FastShotFix=1
;Set to 1 to boost the maximum number of script names from 1450 to 10000
BoostScriptDialogLimit=0
;Allows you to edit the skill tables
;Point the next line 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
;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
;Add 4 to the mode to limit the weight check to used items only
;You can use line number 542/543 in proto.msg and line number 35 in inventry.msg to set up custom messages for item size
;You can use message number 542/543 in proto.msg and message number 35 in inventry.msg to set up custom messages for item size
CritterInvSizeLimitMode=0
CritterInvSizeLimit=100
@@ -567,8 +576,8 @@ SuperStimExploitFix=0
InventoryApCost=4
QuickPocketsApCostReduction=2
;Set to 1 to allow objects seeing through other objects that have their ShootThru flag set
;Note that enabling this option can cause unexpected NPC behavior in some situations
;Set to 1 to fix obj_can_see_obj script function to allow critters to see through objects with 'ShootThru' flag set and other critters in front of them
;Note that enabling this option can cause unexpected NPC behavior in some cases, e.g. initiating combat or dialogue when the player is behind certain obstacles
ObjCanSeeObj_ShootThru_Fix=0
;Set to 1 to fix the broken obj_can_hear_obj script function
@@ -578,13 +587,16 @@ ObjCanHearObjFix=0
;If the argument value is -1, the mood will be determined by the local variable 0 of the script (vanilla behavior)
StartGDialogFix=0
;Set to 1 to fix and repurpose the unused called_shot/num_attacks arguments of attack_complex script function
;This also changes the behavior of the result flags arguments
;called_shot - additional damage, when the damage received by the target is above the specified minimum damage
;Set to 1 to fix attacker_results/target_results arguments and repurpose the unused called_shot/num_attacks arguments of attack_complex script function
;New behavior of the arguments:
;called_shot - additional damage when hitting the target
;num_attacks - the number of free action points on the first turn only
;attacker_results - unused, must be 0 or not equal to the target_results argument when specifying result flags for the target
AttackComplexFix=0
;Set to 1 to 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
ComputeSprayMod=0
@@ -614,17 +626,13 @@ ExplosionsEmitLight=0
;MovieTimer_artimer3=270
;MovieTimer_artimer4=360
;Set to 1 to enable the new arrays behavior
;Set to 1 to enable the new arrays behavior (default behavior)
;Set to 0 for backward compatibility with pre-3.4 scripts
arraysBehavior=1
;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot
CheckWeaponAmmoCost=0
;To add additional books to the game, uncomment the next line and point to a file containing book information
;See the Books.ini in the modders pack for an example file
;BooksFile=Books.ini
;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
CombatPanelAnimDelay=1000
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
@@ -655,6 +663,13 @@ DontTurnOffSneakIfYouRun=0
;Set to 0 to disable switching. (Default is 3)
UseWalkDistance=3
;Changes the displayed message when you recover from the negative effects of radiation exposure
;The value is the message number in misc.msg (Default is 3003: 'You feel better')
RadEffectsRemovalMsg=3003
;Set to 1 to display messages about radiation for the active geiger counter
ActiveGeigerMsgs=1
;Set to 1 to fix the bug of being unable to sell used geiger counters or stealth boys
CanSellUsedGeiger=1
@@ -682,6 +697,10 @@ NumbersInDialogue=0
;Set to 1 to use Fallout's normal text font instead of DOS-like font on the world map
WorldMapFontPatch=0
;Set to 1 to use Fallout's normal text font for death screen subtitles
;Requires changing the color of subtitles in death.pal palette to white color (index 220) to display the text correctly
DeathScreenFontPatch=0
;Set to 1 to keep the selected attack mode when moving the weapon between active item slots
KeepWeaponSelectMode=1
@@ -701,7 +720,7 @@ PartyMemberExtraInfo=0
;that overrides First Aid/Doctor functions has very limited usefulness
PartyMemberSkillFix=0
;Set to 1 to skip loading all game settings except the game/combat difficulty from a saved game
;Set to 1 to skip loading all game settings except the game/combat difficulty from saved games
;Set to 2 to also skip loading the game/combat difficulty settings
SkipLoadingGameSettings=0
@@ -723,6 +742,35 @@ KnockoutTime=35
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; Configuration ini files
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;To change the path and filename of the critical table file, uncomment the next line
;OverrideCriticalFile=sfall\CriticalOverrides.ini
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
;See the Stats.ini in the modders pack for an example file
;DerivedStats=sfall\Stats.ini
;Allows you to edit the skill tables
;Point the next line to an ini file containing the replacement skill data
;SkillsFile=sfall\Skills.ini
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
;PerksFile=sfall\Perks.ini
;To add additional books to the game, uncomment the next line and point to a file containing book information
;See the Books.ini in the modders pack for an example file
;BooksFile=sfall\Books.ini
;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
[Scripts]
;Comma-separated list of masked paths to load global scripts from
@@ -730,10 +778,11 @@ CreditsAtBottom=0
;Paths outside of scripts folder are supported
GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
;Uncomment the option to specify a common folder path for all ini files used by scripts
;You will have to put all the available ini files of the mods in this directory
;Uncomment the option to specify an additional folder path for ini files used by scripts
;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
;IniConfigFolder=IniConfig
;IniConfigFolder=mods\iniConfigs
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging]
@@ -743,10 +792,27 @@ GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
;Set to 1 to enable sfall debugging mode
Enable=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 2 to also disable the memory address check in unsafe script functions
;Does not require sfall debugging mode
AllowUnsafeScripting=0
;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
;Does not require sfall debugging mode
;ExtraCRC=0x00000000,0x00000000
;Set to 1 to skip the executable file size check
;Does not require sfall debugging mode
SkipSizeCheck=0
;Change to 1 to skip the compatibility mode check
SkipCompatModeCheck=0
;Fallout 2 Debug Patch
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and debug.log
;Does not require sfall debugging mode
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg
;-------
;[debug]
;mode=environment
@@ -755,38 +821,22 @@ Enable=0
;show_script_messages=1
;show_tile_num=1
;[sound]
;debug=1
;debug_sfxc=1
;debug=0
;debug_sfxc=0
;-------
DebugMode=0
;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
HideObjIsNullMsg=0
;Change to 1 to skip the compatibility mode check
SkipCompatModeCheck=0
;Set to 1 to skip the executable file size check
;Does not require sfall debugging mode
SkipSizeCheck=0
;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
;Does not require sfall debugging mode
;ExtraCRC=0x00000000,0x00000000
;Set to 1 to stop Fallout from deleting non read-only protos at startup
;Has pretty nasty side effects when saving/reloading, so don't use for regular gameplay
DontDeleteProtos=0
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
;Does not require sfall debugging mode
AllowUnsafeScripting=0
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
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
;Set to 1 to force sfall to search for global/hook scripts every time the game loads rather than only the first time
AlwaysFindScripts=0
;Set to 1 to force critters to display combat float messages
Binary file not shown.
@@ -1,14 +1,13 @@
/*
Auto Doors mod v1.1 for Fallout 2 by Mr.Stalin
Auto Doors mod v1.2 for Fallout 2 by Mr.Stalin
----------------------------------------------
- allows the player to automatically open/walk through unlocked doors when not in combat
Requires sfall 3.7b or higher
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
NOTE: this script requires compiler from sfall modderspack with -s option (short circuit evaluation)
*/
@@ -30,8 +29,8 @@ procedure combatturn_handler;
#define PORTAL (0)
#define DOOR_FLAGS (0x24)
variable only_once := 0;
variable arrayPid;
variable onlyOnce := 0;
variable pidDoors;
procedure start begin
if game_loaded then begin
@@ -41,11 +40,11 @@ procedure start begin
set_global_script_repeat(40); // for sfall 3.x
call map_enter_p_proc;
end else begin
if (only_once == 1 and combat_is_initialized) then begin
only_once := 2;
if (onlyOnce == 1 and combat_is_initialized) then begin
onlyOnce := 2;
call set_door_flag(0); // reset flag when entering combat mode
end else if (only_once == 2 and not(combat_is_initialized)) then begin
only_once := 1;
end else if (onlyOnce == 2 and not(combat_is_initialized)) then begin
onlyOnce := 1;
if (sfall_ver_major >= 4) then set_global_script_repeat(0);
call set_door_flag(FLAG_WALKTHRU); // set flag after combat mode ends
end
@@ -53,34 +52,35 @@ procedure start begin
end
procedure map_enter_p_proc begin
if (arrayPid) then begin
// when changing maps, delete the current array to create a new one
free_array(arrayPid);
arrayPid := 0;
if (pidDoors) then begin
// when changing the map, delete the current array to create a new one
free_array(pidDoors);
pidDoors := 0;
end
only_once := 1;
onlyOnce := 1;
call set_door_flag(FLAG_WALKTHRU); // set flag when entering the map
end
procedure set_door_flag(variable state) begin
variable objectMap, obj, objPid, i;
if (arrayPid) then begin
if (pidDoors) then begin
call set_door_flag_array(state);
return;
end
objectMap := list_as_array(LIST_SCENERY);
arrayPid := create_array(0, 0);
pidDoors := create_array(0, 0);
foreach (obj in objectMap) begin
objPid := obj_pid(obj);
if (proto_data(objPid, sc_type) != PORTAL) or is_in_array(objPid, arrayPid) then
if (proto_data(objPid, sc_type) != PORTAL or get_proto_data(objPid, DOOR_FLAGS) or is_in_array(objPid, pidDoors)) then begin
continue; // next object
end
resize_array(arrayPid, i + 1);
arrayPid[i] := objPid;
resize_array(pidDoors, i + 1);
pidDoors[i] := objPid; // add pid to array
i++;
set_proto_data(objPid, DOOR_FLAGS, state);
end
@@ -88,14 +88,14 @@ end
procedure set_door_flag_array(variable state) begin
variable objPid;
foreach (objPid in arrayPid) begin
foreach (objPid in pidDoors) begin
set_proto_data(objPid, DOOR_FLAGS, state);
end
end
procedure combatturn_handler begin
if (only_once == 1) then begin
only_once := 2;
if (onlyOnce == 1) then begin
onlyOnce := 2;
call set_door_flag_array(0);
set_global_script_repeat(60);
end
@@ -0,0 +1,250 @@
///////////////////////////////////////////////////////////////////////////////
// Blur filter setting
//
// min: blurFalloff 8, sharpness 10/8
// mid: blurFalloff 6, sharpness 8
// max: blurFalloff 4, sharpness 6
///////////////////////////////////////////////////////////////////////////////
#define blurFalloff 4.0
#define sharpness 6.0
///////////////////////////////////////////////////////////////////////////////
// Sharpen filter setting
//
// min: Sharpen 0.5, EdgeSharpen 1.0
// mid: Sharpen 1.0, EdgeSharpen -0.25
// max: Sharpen 1.75, EdgeSharpen -0.5 (1.5, -0.25)
///////////////////////////////////////////////////////////////////////////////
#define Sharpen 0.5
#define EdgeSharpen 1.0
texture bloomMap;
sampler s0;
sampler BloomSampler : samplerstate
{
Texture = bloomMap;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
// Variables that set the width and height of the current game resolution from sfall
float w;
float h;
static const float2 resolution = float2(w, h);
static const float2 wPass = float2(1, 0);
static const float2 hPass = float2(0, 1);
float Brightness(float3 color)
{
return 0.299 * color.r + 0.587 * color.g + 0.114 * 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 BlurDeltaPassPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
{
float3 sumColor = (tex2D(s0, uv).rgb);
float brightness = Brightness(sumColor);
delta *= (1 / resolution);
float totalWeight = 1;
float2 pointUV = uv + delta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - delta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight), 1);
}
static const float2 wDelta = float2(1, 0) * (1 / resolution);
static const float2 hDelta = float2(0, 1) * (1 / resolution);
float4 BlurPS(float4 color : COLOR0, float2 uv : TEXCOORD0) : COLOR0
{
float totalWeight = 1;
float3 sumColor = (tex2D(s0, uv).rgb);
float brightness = Brightness(sumColor);
float2 pointUV = uv + wDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - wDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv + hDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - hDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight), 1);
}
///////////////////////////////////////////////////////////////////////////////
// Bloom effect setting
//
// min: BloomIntensity .8
// mid: BloomIntensity .85
// max: BloomIntensity .9
///////////////////////////////////////////////////////////////////////////////
#define BaseIntensity 1.2
#define BaseSaturation 1.0
#define BloomIntensity 0.8
#define BloomSaturation 0.35
#define BloomThreshold 0.35
#define BlurPower 0.002
// 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,
};
float4 AdjustSaturation(float4 color, float saturation)
{
float grey = dot(color, float3(0.3, 0.59, 0.11));
return lerp(grey, color, saturation);
}
float4 BloomPS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 original = tex2D(s0, texCoord);
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
float sum = (original.r + original.g + original.b) * 0.333;
if (sum >= 0.95) return original;
// bloom blur
float4 bloomBlur = tex2D(s0, texCoord);
for(int i = 0; i < 12; i++)
{
bloomBlur += tex2D(s0, texCoord + BlurPower * offsets[i]);
}
bloomBlur *= 0.085;
float intensity = BloomIntensity - lerp(0.0, 0.2, sum);
bloomBlur = AdjustSaturation(bloomBlur, BloomSaturation) * intensity;
bloomBlur = saturate((bloomBlur - BloomThreshold) / (1 - BloomThreshold));
return bloomBlur + original;
}
static const float CoefBlur = (Sharpen * 0.5);
static const float CoefOrig = (1 + CoefBlur);
// for the sharpen edge
#define SharpenEdge 0.4
static const float sharpenVal0 = (Sharpen * (1.5 + EdgeSharpen));
static const float sharpenVal1 = ((sharpenVal0 - 1) / 8.0);
// pixel "width"
static const float px = (1.0 / w);
static const float py = (1.0 / h);
// for the blur filter
#define mean 1.0
static const float dx = (mean * px);
static const float dy = (mean * py);
float4 SharpenComplexPS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c0 = tex2D(s0, texCoord); // get original pixel
// edge detection
// Get neighbor points
// [ c1, c2, c3 ]
// [ c4, c0, c5 ]
// [ c6, c7, c8 ]
float4 c1 = tex2D(s0, texCoord + float2(-px, -py));
float4 c2 = tex2D(s0, texCoord + float2( 0, -py));
float4 c3 = tex2D(s0, texCoord + float2( px, -py));
float4 c4 = tex2D(s0, texCoord + float2(-px, 0));
float4 c5 = tex2D(s0, texCoord + float2( px, 0));
float4 c6 = tex2D(s0, texCoord + float2(-px, py));
float4 c7 = tex2D(s0, texCoord + float2( 0, py));
float4 c8 = tex2D(s0, texCoord + float2( px, py));
// using Sobel filter
// horizontal gradient
// [ -1, 0, 1 ]
// [ -2, 0, 2 ]
// [ -1, 0, 1 ]
float delta1 = (c3 + 2 * c5 + c8) - (c1 + 2 * c4 + c6);
// vertical gradient
// [ -1, - 2, -1 ]
// [ 0, 0, 0 ]
// [ 1, 2, 1 ]
float4 c13 = c1 + c3;
float4 c68 = c6 + c8;
float delta2 = (c68 + 2 * c7) - (c13 + 2 * c2);
// computation
if (sqrt(mul(delta1, delta1) + mul(delta2, delta2)) > SharpenEdge) {
// if we have an edge, use sharpen
return c0 * sharpenVal0 - (c13 + c2 + c4 + c5 + c68 + c7) * sharpenVal1;
// Display edges in red...
//return float4( 1.0, 0.0, 0.0, 0.0 );
} else {
// else return corrected image
// compute blurred image (gaussian filter)
c1 = tex2D(s0, texCoord + float2(-dx, -dy));
c2 = tex2D(s0, texCoord + float2( 0, -dy));
c3 = tex2D(s0, texCoord + float2( dx, -dy));
c4 = tex2D(s0, texCoord + float2(-dx, 0));
c5 = tex2D(s0, texCoord + float2( dx, 0));
c6 = tex2D(s0, texCoord + float2(-dx, dy));
c7 = tex2D(s0, texCoord + float2( 0, dy));
c8 = tex2D(s0, texCoord + float2( dx, dy));
// gaussian filter
// [ 1, 2, 1 ]
// [ 2, 4, 2 ]
// [ 1, 2, 1 ]
// to normalize the values, we need to divide by the coeff sum
float4 flou = (c1 + c3 + c6 + c8 + 2 * (c2 + c4 + c5 + c7) + 4 * c0) * 0.0625; // 1 / (1+2+1+2+4+2+1+2+1) = 1 / 16 = 0.0625
// substract blurred image from original image
return (CoefOrig * c0 - CoefBlur * flou);
}
}
technique BlurBloom
{
//pass P0 { PixelShader = compile ps_3_0 BlurDeltaPassPS(wPass); }
//pass P1 { PixelShader = compile ps_3_0 BlurDeltaPassPS(hPass); }
pass P0 { PixelShader = compile ps_3_0 BlurPS(); }
pass P3 { PixelShader = compile ps_2_0 BloomPS(); }
pass P2 { PixelShader = compile ps_2_0 SharpenComplexPS(); }
}
@@ -1,7 +1,5 @@
/*
Example implementation of the algorithm of how the game engine checks if one critter sees another critter.
NOTE: the AllowUnsafeScripting option must be enabled.
*/
#include "..\headers\define.h"
@@ -9,10 +7,8 @@
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
#define can_see_(source, target) call_offset_r2(0x412BEC, source, target)
#define obj_dist_(target, source) call_offset_r2(0x48BBD4, target, source)
procedure start;
procedure can_see(variable obj1, variable obj2);
procedure start begin
if game_loaded then begin
@@ -21,40 +17,50 @@ procedure start begin
variable
source := get_sfall_arg,
target := get_sfall_arg,
original := get_sfall_arg,
hookType := get_sfall_arg, /* new arg */
engine := get_sfall_arg,
type := get_sfall_arg, /* new arg */
result := 0,
distance;
distance, seeDistance, seeText;
if target then begin
distance := get_critter_stat(source, STAT_pe);
seeDistance := get_critter_stat(source, STAT_pe);
if can_see_(source, target) then begin
distance *= 5;
if (get_flags(target) bwand FLAG_TRANSGLASS) then distance /= 2;
if can_see(source, target) then begin
seeDistance *= 5;
if (get_flags(target) bwand FLAG_TRANSGLASS) then seeDistance /= 2;
end else if combat_is_initialized then begin
distance *= 2;
seeDistance *= 2;
end
if (target == dude_obj) then begin
if sneak_success then begin
distance /= 4;
if has_skill(target, SKILL_SNEAK) > 120 then distance -= 1;
seeDistance /= 4;
if has_skill(target, SKILL_SNEAK) > 120 then seeDistance -= 1;
end else if dude_is_sneaking then begin
distance := distance * 2 / 3;
seeDistance := (seeDistance * 2) / 3; // distance div 1.5
end
end
if obj_dist_(target, source) <= distance then result := 1;
distance := tile_distance_objs(source, target);
if (get_flags(source) bwand FLAG_MULTIHEX) then distance--;
if (get_flags(target) bwand FLAG_MULTIHEX) then distance--;
// example
if (result) then begin
display_msg("hs_withinperception: " + obj_name(source) + " sees " + obj_name(target) + " [original: " + original + " script: " + result + "]");
end else begin
display_msg("hs_withinperception: " + obj_name(source) + " does not see " + obj_name(target) + " [original: " + original + " script: " + result + "]");
end
if (distance <= seeDistance) then result := 1;
seeText = " does not see > ";
if (result) then seeText = " sees > ";
// Example
display_msg("hs_withinperception: " + obj_name(source) + seeText + obj_name(target) + " [engine: " + engine + ", script: " + result + "]");
/* override engine result */
//set_sfall_return(result);
end
//set_sfall_return(result);
end
end
procedure can_see(variable obj1, variable obj2) begin
variable dir = obj_get_rot(obj1) - rotation_to_tile(tile_num(obj1), tile_num(obj2));
if (dir < 0) then dir = -dir;
return (dir <= 1) or (dir == 5);
end
+2 -6
View File
@@ -54,9 +54,7 @@ procedure combatturn_handler begin
// set perks (only work with 4.1.8+)
foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then begin
critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
intface_redraw;
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
@@ -83,9 +81,7 @@ procedure combatturn_handler begin
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 begin
critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
end
if isShowTag then begin
+4
View File
@@ -1,3 +1,5 @@
#ifndef MAIN_H
#define MAIN_H
#include "..\scripting\headers\sfall.h"
#include "..\scripting\headers\define_lite.h"
@@ -71,3 +73,5 @@ end
procedure InitConfigs begin
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
end
#endif
+1 -1
View File
@@ -155,7 +155,7 @@ Example:
- creates permanent array (but not "saved")
- if size is >= 0, creates list with given size
- if size == -1, creates map (associative array)
- if size == -1 and flags == 2, creates a "lookup" map in which the values of existing keys are read-only and can't be updated.
- if size == -1 and flags == 2, creates a "lookup" map (associative array) in which the values of existing keys are read-only and can't be updated.
This type of array allows you to store a zero (0) key value
- NOTE: in earlier versions (up to 4.1.3/3.8.13) the second argument is not used, just use 0
- returns arrayID (valid until array is deleted)
@@ -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,408 @@
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.7
- added ability to declare local variables anywhere in the procedure body
> 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
+32 -15
View File
@@ -2,6 +2,9 @@
#ifndef DEFINE_EXTRA_H
#define DEFINE_EXTRA_H
/* Combat Flags */
#define DAM_PRESERVE_FLAGS 0x80000000 // keep the existing result flags when setting new flags in attack_complex (for sfall)
#define BODY_HIT_HEAD (0)
#define BODY_HIT_LEFT_ARM (1)
#define BODY_HIT_RIGHT_ARM (2)
@@ -87,19 +90,34 @@
#define FLAG_SEEN (0x40000000)
#define FLAG_SHOOTTHRU (0x80000000)
/* Critter Flags */
/* Critter flags */
#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_NOLIMBS 128 // 0x00000080 - Limbs (cannot lose limbs)
#define CFLG_NOAGES 256 // 0x00000100 - Ages (dead body does not disappear)
#define CFLG_NOHEAL 512 // 0x00000200 - Heal (damage is not cured with time)
#define CFLG_NOHEAL 512 // 0x00000200 - Heal (damage is not healed with time)
#define CFLG_INVULN 1024 // 0x00000400 - Invulnerable (cannot be hurt)
#define CFLG_FLATTN 2048 // 0x00000800 - Flatten (leaves no dead body)
#define CFLG_SPECIAL 4096 // 0x00001000 - Special (there is a special type of death)
#define CFLG_RANGED 8192 // 0x00002000 - Range (melee attack is possible at a distance)
#define CFLG_NOKNOCKDOWN 16384 // 0x00004000 - Knock (cannot be knocked down)
#define CFLG_SPECIAL 4096 // 0x00001000 - Special (has a special type of death)
#define CFLG_RANGED 8192 // 0x00002000 - Range (has extra hand-to-hand range)
#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
#define RMOBJ_CONSUME_DRUG 4666772
@@ -328,7 +346,6 @@
#define ai_area_be_absolutely_sure (4)
// AI attack who mode values
#define ai_attack_no_pref (-1)
#define ai_attack_whomever_attacking_me (0)
#define ai_attack_strongest (1)
#define ai_attack_weakest (2)
@@ -345,12 +362,12 @@
#define ai_run_away_never (7)
// AI disposition values
#define ai_disposition_none (0)
#define ai_disposition_custom (1)
#define ai_disposition_coward (2)
#define ai_disposition_defensive (3)
#define ai_disposition_aggressive (4)
#define ai_disposition_berserk (5)
#define ai_disposition_none (-1)
#define ai_disposition_custom (0)
#define ai_disposition_coward (1)
#define ai_disposition_defensive (2)
#define ai_disposition_aggressive (3)
#define ai_disposition_berserk (4)
// AI distance values
#define ai_distance_stay_close (0)
@@ -394,7 +411,7 @@
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
#define OBJ_DATA_DAMAGE_LAST_TURN (0x48)
#define OBJ_DATA_WHO_HIT_ME (0x54)
#define OBJ_DATA_WHO_HIT_ME (0x54) // current target of the critter
// compute attack result data offsets
#define C_ATTACK_SOURCE (0x00)
+11
View File
@@ -5,6 +5,17 @@
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 MIN(x, y) ((x < y) * x + (x >= y) * y)
#define in_range(x, from, to) (x >= from and x <= to)
+78 -13
View File
@@ -1,6 +1,8 @@
#ifndef SFALL_H
#define SFALL_H
//Recognised modes for set_shader_mode and get_game_mode
#define WORLDMAP (0x1)
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
#define DIALOG (0x4)
#define ESCMENU (0x8)
#define SAVEGAME (0x10)
@@ -20,6 +22,7 @@
#define HEROWIN (0x40000)
#define DIALOGVIEW (0x80000)
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
#define SPECIAL (0x80000000)
//Valid arguments to register_hook
#define HOOK_TOHIT (0)
@@ -63,20 +66,36 @@
#define HOOK_SETLIGHTING (38)
#define HOOK_SNEAK (39)
#define HOOK_STDPROCEDURE (40)
#define HOOK_STDPROCEDURE_END (41)
#define HOOK_TARGETOBJECT (42)
#define HOOK_ENCOUNTER (43)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
#define LIST_GROUNDITEMS (1)
#define LIST_SCENERY (2)
#define LIST_WALLS (3)
//#define LIST_TILES (4) //Not listable via sfall list functions
//#define LIST_TILES (4) //Not listable via sfall list functions
#define LIST_MISC (5)
#define LIST_SPATIAL (6)
#define LIST_ALL (9)
//Valid window types for get_window_attribute
#define WINTYPE_INVENTORY (0) // any inventory window (player/loot/use/barter)
#define WINTYPE_DIALOG (1)
#define WINTYPE_PIPBOY (2)
#define WINTYPE_WORLDMAP (3)
#define WINTYPE_IFACEBAR (4) // the interface bar
#define WINTYPE_CHARACTER (5)
#define WINTYPE_SKILLDEX (6)
#define WINTYPE_ESCMENU (7) // escape menu
//Valid flags for force_encounter_with_flags
#define ENCOUNTER_FLAG_NO_CAR (1)
#define ENCOUNTER_FLAG_LOCK (2) // block new forced encounter by the next function call until the current specified encounter occurs
#define ENCOUNTER_FLAG_NO_CAR (0x1)
#define ENCOUNTER_FLAG_LOCK (0x2) // block new forced encounter by the next function call until the current specified encounter occurs
#define ENCOUNTER_FLAG_NO_ICON (0x4) // disable displaying the flashing icon
#define ENCOUNTER_FLAG_ICON_SP (0x8) // use special encounter icon
#define ENCOUNTER_FLAG_FADEOUT (0x10) // fade out the screen on encounter (Note: you yourself should restore the fade screen when entering the encounter)
//The attack types returned by get_attack_type
#define ATKTYPE_LWEP1 (0)
@@ -243,14 +262,34 @@
#define party_member_list_all party_member_list(1)
// fake perks/traits add mode flags
#define ADD_PERK_MODE_TRAIT (1) // add to the player's traits
#define ADD_PERK_MODE_PERK (2) // add to the player's perks
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks
#define ADD_PERK_MODE_TRAIT (1) // add to the player's traits list
#define ADD_PERK_MODE_PERK (2) // add to the player's perks list
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks (after added to the player)
// sfall_funcX macros
// instantly apply the item to dude_obj (w/o animation)
#define use_item_on_dude(item) set_self(dude_obj); \
set_self(dude_obj); \
use_obj_on_obj(item, dude_obj); \
set_self(0)
// returns the corrected tile distance between two objects to the distance variable (return value >= 9996 is an error when getting the distance)
#define distance_objs(distance, obj1, obj2) distance := tile_distance_objs(obj1, obj2) - 1; \
if (get_flags(obj1) bwand FLAG_MULTIHEX) then distance--; \
if (get_flags(obj2) bwand FLAG_MULTIHEX) then distance--
/* sfall metarule3 function macros */
// sets the number of days (range 1...127) for the Frank Horrigan encounter, or disable the encounter if days is set to 0
#define set_horrigan_days(day) metarule3(200, day, 0, 0)
// clears the keyboard input buffer, use it in the HOOK_KEYPRESS hook to clear keyboard events before calling functions that are waiting for keyboard input
#define clear_keyboard_buffer metarule3(201, 0, 0, 0)
/* sfall_funcX macros */
#define add_extra_msg_file(name) sfall_func1("add_extra_msg_file", name)
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
#define add_iface_tag sfall_func0("add_iface_tag")
#define add_trait(traitId) sfall_func1("add_trait", traitId)
#define add_trait(traitID) sfall_func1("add_trait", traitID)
#define art_cache_clear sfall_func0("art_cache_clear")
#define attack_is_aimed sfall_func0("attack_is_aimed")
#define car_gas_amount sfall_func0("car_gas_amount")
@@ -270,29 +309,43 @@
#define get_flags(obj) sfall_func1("get_flags", obj)
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
#define get_interface_x(winType) sfall_func2("get_window_attribute", winType, 1)
#define get_interface_y(winType) sfall_func2("get_window_attribute", winType, 2)
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define get_metarule_table sfall_func0("get_metarule_table")
#define get_object_ai_data(obj, aiParam) sfall_func2("get_object_ai_data", obj, aiParam)
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
#define get_outline(obj) sfall_func1("get_outline", obj)
#define get_pc_stat_max(stat) sfall_func1("get_stat_max", stat)
#define get_pc_stat_min(stat) sfall_func1("get_stat_min", stat)
#define get_npc_stat_max(stat) sfall_func2("get_stat_max", stat, 1)
#define get_npc_stat_min(stat) sfall_func2("get_stat_mix", stat, 1)
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
#define get_string_pointer(text) sfall_func1("get_string_pointer", text)
#define get_text_width(text) sfall_func1("get_text_width", text)
#define has_fake_perk_npc(npc, perk) sfall_func2("has_fake_perk_npc", npc, perk)
#define has_fake_trait_npc(npc, trait) sfall_func2("has_fake_trait_npc", npc, trait)
#define hide_window(winName) sfall_func1("hide_window", winName)
#define intface_hide sfall_func0("intface_hide")
#define intface_is_hidden sfall_func0("intface_is_hidden")
#define intface_is_shown(winType) sfall_func1("get_window_attribute", winType)
#define intface_redraw sfall_func0("intface_redraw")
#define intface_show sfall_func0("intface_show")
#define inventory_redraw(invSide) sfall_func1("inventory_redraw", invSide)
#define item_make_explosive(pid, aPid, min, max) sfall_func4("item_make_explosive", pid, aPid, min, max)
#define item_make_explosive(pid, activePid, min, max) sfall_func4("item_make_explosive", pid, activePid, min, max)
#define item_weight(obj) sfall_func1("item_weight", obj)
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
#define loot_obj sfall_func0("loot_obj")
#define metarule_exist(metarule) sfall_func1("metarule_exist", metarule)
#define message_box(text) sfall_func1("message_box", text)
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
#define obj_under_cursor(crSwitch, inclDude) sfall_func2("obj_under_cursor", crSwitch, inclDude)
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
#define objects_in_radius(tile, radius, elev, type) sfall_func4("objects_in_radius", tile, radius, elev, type)
#define outlined_object sfall_func0("outlined_object")
#define real_dude_obj sfall_func0("real_dude_obj")
#define remove_all_timer_events sfall_func0("remove_timer_event")
#define remove_timer_event(fixedParam) sfall_func1("remove_timer_event", fixedParam)
#define set_can_rest_on_map(map, elev, value) sfall_func3("set_can_rest_on_map", map, elev, value)
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
@@ -306,14 +359,26 @@
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
#define set_rest_heal_time(time) sfall_func1("set_rest_heal_time", time)
#define set_rest_mode(mode) sfall_func1("set_rest_mode", mode)
#define set_terrain_name(x, y, name) sfall_func3("set_terrain_name", x, y, name)
#define set_town_title(areaID, title) sfall_func2("set_town_title", areaID, title)
#define set_unique_id(obj) sfall_func1("set_unique_id", obj)
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
#define set_window_flag(winID, flag, value) sfall_func3("set_window_flag", winID, flag, value)
#define show_window(winName) sfall_func1("show_window", winName)
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
#define string_format(format, a1, a2) sfall_func3("string_format", format, a1, a2)
#define string_tolower(text) sfall_func2("string_to_case", text, 0)
#define string_toupper(text) sfall_func2("string_to_case", text, 1)
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
#define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
#define set_fake_perk_npc(npc, perk, level, image, desc) sfall_func5("set_fake_perk_npc", npc, perk, level, image, desc)
#define set_fake_trait_npc(npc, trait, active, image, desc) sfall_func5("set_fake_trait_npc", npc, trait, active, image, desc)
#define set_selectable_perk_npc(npc, perk, active, image, desc) sfall_func5("set_selectable_perk_npc", npc, perk, active, image, desc)
#endif
+75 -34
View File
@@ -30,6 +30,7 @@ The hook script equivalent of game_loaded; it returns 2 when the script is first
> mixed get_sfall_arg()
Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left.
You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.
> array get_sfall_args()
Returns all hook arguments as a new temp array.
@@ -37,16 +38,16 @@ Returns all hook arguments as a new temp array.
> void set_sfall_return(int value)
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
> void set_sfall_arg(int argnum, int value)
Changes argument value. The argument number (argnum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
> void set_sfall_arg(int argNum, int value)
Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
> void register_hook(int hooktype)
> void register_hook(int hookID)
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be executed in a current global script. You can use all above functions like normal.
> void register_hook_proc(int hook, procedure proc)
> void register_hook_proc(int hookID, procedure proc)
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
> void register_hook_proc_spec(int hook, procedure proc)
> void register_hook_proc_spec(int hookID, procedure proc)
Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using register_hook/register_hook_proc functions.
NOTE: you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with "set_sfall_return", the next script may override this value if calls "set_sfall_return" again. Sometimes you need to multiply certain value in a chain of hook scripts.
@@ -68,7 +69,7 @@ This basically changes hook argument for the next script. Mod B code:
So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use "set_sfall_arg" in both hooks).
The defines to use for the hooktype are in sfall.h.
The defines to use for the hookID are in sfall.h.
-------------------------------------------
----------- HOOK SCRIPT TYPES -------------
@@ -125,11 +126,13 @@ int ret1 - The new AP cost
HOOK_DEATHANIM1 (hs_deathanim1.int)
Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees
Does not run for critters in the knockdown/out state.
int arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
critter arg2 - The attacker
critter arg3 - The target
int arg4 - The amount of damage
int arg5 - Unused, always -1. Use this if you are using the same procedure for HOOK_DEATHANIM1 and HOOK_DEATHANIM2 (since sfall 4.1/3.8.24)
int ret1 - The pid of an object to override the attacking weapon with
@@ -138,7 +141,8 @@ int ret1 - The pid of an object to override the attacking weapon with
HOOK_DEATHANIM2 (hs_deathanim2.int)
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than hs_deathanim1, but performs no validation.
When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and target will point to an object with obj_art_fid == 0x20001F5.
When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with obj_art_fid == 0x20001F5.
Does not run for critters in the knockdown/out state.
item arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
critter arg2 - The attacker
@@ -188,9 +192,17 @@ Critter arg1 - The critter that just died
HOOK_FINDTARGET (hs_findtarget.int)
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker. This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's. Pass -1 to skip the return value.
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker.
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries.
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
NOTE: The engine can choose targets by the following criteria:
1) The nearest enemy to the attacker.
2) The enemy that attacked the attacker.
3) The enemy that attacked an NPC from the same team as the attacker.
4) The enemy that is attacked by an NPC from the same team as the attacker.
critter arg1 - The attacker
critter arg2 - A possible target
@@ -285,10 +297,10 @@ int ret1 - the new AP cost
-------------------------------------------
(DEPRECATED)
hs_hexmoveblocking.int
hs_hexaiblocking.int
hs_hexshootblocking.int
hs_hexsightblocking.int
HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)
HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)
HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)
HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
@@ -513,6 +525,7 @@ HOOK_GAMEMODECHANGE (hs_gamemodechange.int)
Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc.
int arg1 - event type: 1 - when the player exits the game, 0 - otherwise
int arg2 - the previous game mode
-------------------------------------------
@@ -557,8 +570,8 @@ HOOK_USESKILLON (hs_useskillon.int)
Runs before using any skill on any object. Lets you override the critter that uses the skill.
NOTE: the user critter can't be overridden when using Steal skill.
Critter arg1 - The user critter (usually dude_obj)
Obj arg2 - The target object/critter
Critter arg1 - the user critter (usually dude_obj)
Obj arg2 - the target object/critter
int arg3 - skill being used
int ret1 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value
@@ -572,11 +585,11 @@ Runs when Fallout is checking all the tiles within the explosion radius for targ
The tile checking will be interrupted when 6 additional targets (critters) are received.
int arg1 - event type: 1 - when checking objects within the explosion radius without causing damage (e.g. the player drops an active explosive), 0 - otherwise
Critter arg2 - The attacker
int arg3 - The tile on which the explosion occurs
Critter arg2 - the attacker
int arg3 - the tile on which the explosion occurs
int arg4 - checked tile within the explosion radius
Obj arg5 - first found object on the checked tile as an additional target
Critter arg6 - The target critter, may be 0 or equal to the attacker
Critter arg6 - the target critter, may be 0 or equal to the attacker
int arg7 - 1 when using throwing weapons (e.g. grenades), 0 otherwise
int ret1 - overrides the found object on the checked tile, pass 0 to skip the object
@@ -591,20 +604,20 @@ Runs when:
2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.
Does not run for misses, non-combat damage like dynamite explosions, or if one of the damage formulas is selected in ddraw.ini.
Critter arg1 - The attacker
Critter arg2 - The target
Obj arg3 - The weapon used in the attack
int arg4 - Attack Type (see ATKTYPE_* constants)
int arg5 - Number of bullets actually hit the target (1 for melee attacks)
int arg6 - Target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg7 - Target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg8 - Bonus ranged damage from the perk
int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
int arg10 - Combat Difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
int arg11 - The calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
mixed arg12 - Computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
Critter arg1 - the attacker
Critter arg2 - the target
Obj arg3 - the weapon used in the attack
int arg4 - attack type (see ATKTYPE_* constants)
int arg5 - number of bullets actually hit the target (1 for melee attacks)
int arg6 - target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg7 - target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg8 - bonus ranged damage from the perk
int arg9 - damage multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
int arg10 - combat difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
int arg11 - the calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
mixed arg12 - computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
int ret1 - The returned amount of damage
int ret1 - the returned amount of damage
-------------------------------------------
@@ -635,13 +648,41 @@ int ret2 - overrides the duration time for the current result
-------------------------------------------
HOOK_STDPROCEDURE (hs_stdprocedure.int)
HOOK_STDPROCEDURE, HOOK_STDPROCEDURE_END (hs_stdprocedure.int)
Runs before Fallout executes a standard procedure (handler) in any script of any object.
Runs before or after Fallout engine executes a standard procedure (handler) in any script of any object.
NOTE: this hook will not be executed for "start", critter_p_proc, timed_event_p_proc, and map_update_p_proc procedures.
int arg1 - the number of the standard script handler (see define.h)
Obj arg2 - the object that owns this handler (self_obj)
Obj arg3 - the object that called this handler (source_obj, can be 0)
int arg4 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise
int ret1 - pass -1 to cancel the execution of the handler
int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE)
-------------------------------------------
HOOK_TARGETOBJECT (hs_targetobject.int)
Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.
You can override the target object or prevent the player from attacking the chosen target.
int arg1 - event type: 0 - when the targeting cursor hovers over the object, 1 - when trying to attack the target object
int arg2 - 1 when the target object is valid to attack, 0 otherwise
Obj arg3 - the target object
mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object
-------------------------------------------
HOOK_ENCOUNTER (hs_encounter.int)
Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map.
You can override the map for loading or the encounter.
int arg1 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map
int arg2 - the map ID that the encounter will load (see MAPS.h or Maps.txt)
int arg3 - 1 when the encounter occurs is a special encounter, 0 otherwise
int ret1 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling
int ret2 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0)
+128 -23
View File
@@ -18,13 +18,13 @@ The read_xxx functions take a memory address as the parameter and can read arbit
The get/set_pc_base/extra_stat functions are equivalent to calling get/set_critter_base/extra_stat with dude_obj as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal get_critter_stat function to get a correctly perk adjusted and range clamped value for a stat.
The set_stat_max/min functions can be used to set the valid ranges on on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only effect the player, the set_npc_ functions only effect other critters, and the set_ functions effect both.
The set_stat_max/min functions can be used to set the valid ranges on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only effect the player, the set_npc_ functions only effect other critters, and the set_ functions effect both.
The input functions are only available if the user has the input hook turned on in ddraw.ini. Use input_funcs_available to check.
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
load_shader takes a path relative to the data\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
load_shader takes a path relative to the <GameRoot>\<master_patches>\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
get_shader_version gives you the highest shader version supported by the player's graphics cards. Possible return values are 11, 12, 13, 14, 20, 21 and 30.
@@ -36,7 +36,7 @@ The mapper manual lists the functions 'world_map_x_pos' and 'world_map_y_pos', w
set_pipboy_available will only accept 0 or 1 as an argument. Using any other value will cause the function to have no effect. Use 0 to disable the pipboy, and 1 to enable it.
get/set_critter_current_ap functions should only be used during the target critters turn while in combat. Calling them outside of combat typically returns the critters max ap, but don't rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.) Using set_critter_current_ap on the player will not automatically redraw the screen, so the ap bar will be incorrect until the player next clicks.
get/set_critter_current_ap functions should only be used during the target critters turn while in combat. Calling them outside of combat typically returns the critters max ap, but don't rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.)
The 'type' value in the weapon knockback functions can be 0 or 1. If 0, the value becomes an absolute distance that targets will be knocked back. If 1, the value is multiplied by the distance they would normally have been knocked back. Weapon knockback modifiers are applied in the order weapon -> attacker -> target, so a x2 weapon wielded by an abs 6 attacker hitting a /2 target will knock the target back 3 squares. The knockback functions will not override the stonewall perk or knockdowns resulting from criticals. knockback values set on weapons or critters are not saved, and must be reset each time the player reloads.
@@ -50,7 +50,7 @@ has_fake_trait and has_fake_perk return the number of levels the player has of t
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the player's traits, if bit 2 is set it is added to the player's perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to its default state.
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to (4 + the value of BoxBarCount in ddraw.ini) for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 4.1, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to (4 + the value of BoxBarCount in ddraw.ini) for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 4.1/3.8.12, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
get/set_bodypart_hit_modifier alter the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload.
@@ -66,7 +66,7 @@ get/set_proto_data are used to manipulate the in memory copies of the .pro files
the list_xxx functions can be used to loop over all items on a map. list_begin takes an argument telling sfall what you want to list. (Defined in sfall.h) It returns a list pointer, which you iterate through with list_next. Finally, when you've finished with the list use list_end on it. Not calling list_end will result in a memory leak. Alternatively, use list_as_array to get the whole list at once as a temp array variable, which can be looped over using len_array and which you don't need to remember to free afterwards.
play_sfall_sound and stop_sfall_sound are used to play mp3/wav/wma files. The path given is relative to the Fallout folder. Specify loop as 1 to loop the file continuously, or 0 otherwise. If you don't wish to loop, play_sfall_sound returns 0. If you do loop, it returns an id which can be passed back to stop_sfall_sound when you want to stop the effect. All sounds effects will be stopped on game reload, looping or not. These functions do not require 'AllowDShowSound' to be set to 1 in ddraw.ini.
play_sfall_sound and stop_sfall_sound are used to play mp3/wav/wma files. The path given is relative to the Fallout folder. Specify mode as 1 to loop the file continuously, 2 to replace the current background game music with playing the specified file in loop mode, or 0 to play the file once. If you don't wish to loop, play_sfall_sound returns 0. If you do loop, it returns an id which can be passed back to stop_sfall_sound when you want to stop the effect. All sounds effects will be stopped on game reload, looping or not. These functions do not require 'AllowDShowSound' to be set to 1 in ddraw.ini.
arrays are created and manipulated with the xxx_array functions. An array must first be created with create_array or temp_array, specifying how many data elements the array can hold. You can store any of ints, floats and strings in an array, and can mix all 3 in a single array. The id returned by create/temp_array can then be used with the other array functions. Arrays are shared between all scripts. (i.e. you can call create_array from one script, and then use the returned id from another script.) They are also saved across savegames. You must remember to free any arrays you create with create_array when you are done with them, or you will leak memory. arrays created with temp_array will be automatically freed at the end of the frame. These functions are safe, in that supplying a bad id or trying to access out of range elements will not crash the script. create_array is the only function that returns a permanent array, all other functions which return arrays (string_split, list_as_array etc,) all return temp arrays. You can use fix_array to make a temp array permanent.
@@ -137,7 +137,7 @@ array - array ID to be used with array-related functions (actually an integer)
- The player will not get an outdoorsman skill check.
> void force_encounter_with_flags(int map, int flags)
- does the same thing as force_encounter, but allows the specification of some extra options.
- does the same thing as force_encounter, but allows the specification of some extra options (see sfall.h for available flags).
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
@@ -153,12 +153,13 @@ array - array ID to be used with array-related functions (actually an integer)
- accepts a pointer to an object and will remove the script from that object.
> void set_script(object, int scriptid)
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6)
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accepts the same values as create_object_sid)
- If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided.
- if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run.
> int get_script(object)
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or -1 if the object is unscripted.
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted.
- returns -1 on argument error.
> void set_self(int obj)
- overrides the scripts self_obj for the next function call.
@@ -218,6 +219,9 @@ Some additional reg_anim_* functions were introduced. They all work in the same
> void reg_anim_turn_towards(object, tile/target, delay)
- makes object change its direction to face given tile num or target object.
> void reg_anim_callback(procedure proc)
- adds the given procedure to an animation sequence-list and executes it in the registered sequence.
> int/array metarule2_explosions(int arg1, int arg2, int arg3)
was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h:
@@ -259,7 +263,10 @@ Some utility/math functions are available:
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
> string substr(string, start, length)
- cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te")
- cuts a substring from a string starting at "start" up to "length" characters. The first character position is 0 (zero).
- If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st").
- If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te").
- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22
> int strlen(string string)
- returns string length
@@ -274,10 +281,15 @@ Some utility/math functions are available:
> int charcode(string string)
- returns ASCII code for the first character in given string
> div operator (unsigned integer division)
- use as a division operator, like 3 + (20 div 5)
- if both dividend and divisor are integers, they will be treated as unsigned integers
- if one of them is a float, div will perform the signed division just like vanilla division operator
> ^ operator (exponentiation)
- use as any other arithmetic operator, like 5^(1/3)
- if exponent is integer, you can use negative base, otherwise you will get "nan" with negative base
- if both arguments are integers, result will be integer
- if exponent is an integer, you can use a negative base, otherwise you will get "NaN" with a negative base
- if both arguments are integers, the result will be an integer
> float log(float x)
- natural logarithm of x
@@ -420,8 +432,9 @@ Some utility/math functions are available:
- gets the current outline color for an object
> void sfall_func2("set_outline", object, int color)
- sets the outline color of an object
- 0 means or any value above 0x00FFFFFF disables the outline
- sets the outline color of an object (see OUTLINE_* constants in sfall.h)
- can also set a custom color from the game palette by shifting the color index value left by 8 bits: 0xCC00 where CC is the palette index (available since sfall 4.2.7/3.8.27)
- passing 0 will disable the outline
- call "tile_refresh_display" after changing outline of objects to properly redraw the scene
> int sfall_func1("get_flags", object)
@@ -449,6 +462,7 @@ Some utility/math functions are available:
> array sfall_func2("get_ini_section", string fileName, string section)
- returns an associative array of keys and values for a given INI file and section
- NOTE: all keys and their values will be of String type
> int sfall_func0("car_gas_amount")
- returns current amount of fuel in player's car (between 0 and 80000)
@@ -467,8 +481,8 @@ Some utility/math functions are available:
- sets the current cursor mode
> void sfall_func0("display_stats")
- displays player stats in the inventory screen display window
- works only in opened inventory
- updates player's stats in the inventory display window or on the character screen
- NOTE: works only when the interface window is opened
> int sfall_func1("lock_is_jammed", object)
- returns 1 if the lock (container or scenery) is currently jammed, 0 otherwise
@@ -514,9 +528,10 @@ Some utility/math functions are available:
- adds one custom box to the current boxes, and returns the number of the added tag (-1 if the tags limit is exceeded)
- The maximum number of boxes is limited to 126 tags
> void sfall_func0("inventory_redraw")
> void sfall_func1("inventory_redraw", int invSide)
- redraws inventory list in the inventory/use inventory item on/loot/barter screens
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens)
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
> void sfall_func3("item_make_explosive", int pid, int activePid, int damage)
> void sfall_func4("item_make_explosive", int pid, int activePid, int min, int max)
@@ -550,15 +565,16 @@ Some utility/math functions are available:
> int sfall_func2("get_can_rest_on_map", int mapNum, int elev)
- returns the set rest value of the map after using the set_can_rest_on_map function
- returns -1 if the rest value of the map was not previously set (i.e. no data for the map in sfalldb.sav)
- the can_rest_here values in maps.txt are ignored
- the can_rest_here values from maps.txt are ignored
> object sfall_func0("dialog_obj")
- returns a pointer to the object (critter) the player is having a conversation or bartering with
> object sfall_func2("obj_under_cursor", bool crSwitch, bool inclDude)
> object sfall_func2("obj_under_cursor", bool onlyCritter, bool includeDude)
- returns the object under the cursor on the main game screen
- crSwitch: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.), False - checks all objects (can't check critters under objects)
- passing False to the inclDude argument will ignore dude_obj
- onlyCritter: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.)
False - checks all objects (can't check critters under objects)
- passing False to the includeDude argument will ignore dude_obj
> object sfall_func0("loot_obj")
- returns a pointer to the target object (container or critter) of the loot screen
@@ -596,8 +612,8 @@ Some utility/math functions are available:
> void sfall_func5("draw_image", string/int pathFile/artId, int frame, int x, int y, bool noTransparent)
> void sfall_func6("draw_image_scaled", string/int pathFile/artId, int frame, int x, int y, int width, int height)
- displays the specified FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
- pathFile/artId: path to the FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
- displays the specified PCX or FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
- pathFile/artId: path to the PCX/FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
optional arguments:
- frame: frame number, the first frame starts from zero
- x/y: offset relative to the top-left corner of the window
@@ -627,12 +643,101 @@ optional argument:
- can take off player's equipped item when the inventory is opened, or the player is in the barter screen
- slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h)
> void sfall_func1("add_trait", int traitId)
> void sfall_func1("add_trait", int traitID)
- adds the specified trait to the player
> int sfall_func0("get_inven_ap_cost")
- returns the current AP cost to access the inventory in combat
> void sfall_func2("add_g_timer_event", int time, int fixedParam)
- adds a timer event that calls the timed_event_p_proc procedure in the current global script
- time: the number of ticks after which the event timer is triggered
- fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function
> void sfall_func0("remove_timer_event")
- clears all set timer events for the current global script
> void sfall_func1("remove_timer_event", int fixedParam)
- removes all timer events with the specified 'fixedParam' value for the current global script
> mixed sfall_func1("get_sfall_arg_at", int argNum)
- gets the value of hook argument with the specified argument number (first argument of hook starts from 0)
> void sfall_func0("hide_window")
> void sfall_func1("hide_window", string winName)
- hides the specified or currently active (selected) script window
- winName: the window name, assigned to the window by the CreateWin/create_win function
> void sfall_func0("show_window")
> void sfall_func1("show_window", string winName)
- displays the specified hidden script window or the one previously hidden with the sfall_func0("hide_window") function
- winName: the window name, assigned to the window by the CreateWin/create_win function
> void sfall_func3("set_window_flag", string/int winName/winID, int flag, bool value)
- changes the specified flag for the created script or game interface window
- winName: the window name, assigned to the window by the CreateWin/create_win function
- winID: the ID number of the interface or script window obtained with the get_window_under_mouse function, or 0 for the current game interface
- flag: the flag to change (see WIN_FLAG_* constants in define_extra.h)
- value: true - set the flag, false - unset the flag
> int sfall_func1("get_text_width", string text)
- returns the text width in pixels for the currently set font
> bool sfall_func2("string_compare", string str1, string str2)
> bool sfall_func3("string_compare", string str1, string str2, int codePage)
- compares two strings case-insensitive, and returns True if the two strings are matched
- codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table
available encodings: 1250-1252, 866
> string sfall_func3("string_format", string format, any val1, any val2, ...)
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting up to 4 values
- formatting is only supported for %s and %d, and the format string is limited to 1024 characters
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
- passing -1 to the type argument or not specifying it will return all objects within the radius
- the radius is limited to 50 hexes
> int sfall_func2("tile_by_position", int x, int y)
- returns the tile number at the x, y position relative to the top-left corner of the game screen
- if the position is outside of the range of tiles, it will return -1
> string sfall_func2("string_to_case", string text, int toCase)
- converts all letters in the given string to the specified case
- toCase: 0 - lowercase, 1 - uppercase
- NOTE: this function works only for English letters of A-Z/a-z
> void sfall_func3("set_terrain_name", int x, int y, string name)
- overrides the terrain type name for the sub-tile on the world map by the specified coordinates
> int sfall_func1("get_window_attribute", int winType)
> int sfall_func2("get_window_attribute", int winType, int attrType)
- returns the attribute of the specified interface window by the attrType argument
- winType: the type number of the interface window (see WINTYPE_* constants in sfall.h)
- attrType: 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)
1 - X position, 2 - Y position (relative to the top-left corner of the game screen)
- returns -1 if the specified attribute cannot be obtained
> void sfall_func2("set_town_title", int areaID, string title)
- sets a floating text for a town on the world map when hovering the cursor over the player's marker
- areaID: the ID number of the town from city.txt
> int sfall_func4("message_box", string message, int flags, int color1, int color2)
- creates a dialog box with text and returns the result of pressing the button: 0 - No (Escape), 1 - Yes/Done (Enter)
- returns -1 if for some reason the dialog box cannot be created
- message: the text in the dialog box. Use the \n control character to move text to a new line (example: "Hello\nWorld!")
optional arguments:
- flags: mode flags (see MSGBOX_* constants in define_extra.h). Pass -1 to skip setting the flags (default flags are NORMAL and YESNO)
- color1/2: the color index in Fallout palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
> int sfall_func1("get_stat_min", stat)
> int sfall_func1("get_stat_max", stat)
> int sfall_func2("get_stat_min", stat, bool who)
> int sfall_func2("get_stat_max", stat, bool who)
- returns the maximum or minimum set value of the specified stat (see set_stat_max/min functions)
- who: 0 (false) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
------------------------
------ MORE INFO -------
------------------------

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