mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99de222605 | ||
|
|
29ad2bf3b8 | ||
|
|
4fc282fa61 | ||
|
|
5b4e165368 | ||
|
|
43a261bd27 | ||
|
|
b69e4e0eeb | ||
|
|
254473cf1c | ||
|
|
c4efe78661 | ||
|
|
656b122f3e | ||
|
|
30802e8e21 | ||
|
|
56150d572a | ||
|
|
a75886a020 | ||
|
|
64dc30d922 | ||
|
|
a6a2285ffe | ||
|
|
381032a246 | ||
|
|
b6ee7bebf2 | ||
|
|
dd73cbea9c | ||
|
|
d3960cbebb | ||
|
|
a93eee9849 | ||
|
|
e954b34676 | ||
|
|
5c5df4ef64 | ||
|
|
ad137896c9 | ||
|
|
9bdd633fcd | ||
|
|
48e2a63cdf | ||
|
|
33e6cb0cb8 | ||
|
|
52e796815a | ||
|
|
6c7bbb5a58 | ||
|
|
05f2fb4001 | ||
|
|
024a13c6a8 | ||
|
|
9ecd598544 | ||
|
|
8521c1772b | ||
|
|
f7d94e16c9 | ||
|
|
3b8d2a4527 | ||
|
|
db7419a2f7 | ||
|
|
e93ca6fcab | ||
|
|
6181140954 | ||
|
|
007fa7314b | ||
|
|
87f5a5f081 | ||
|
|
5d5da0a471 | ||
|
|
bd15cf2b9e | ||
|
|
ea2a4bfdfa | ||
|
|
8ad4f86e1d | ||
|
|
c4b55734d1 | ||
|
|
ec5874a3c4 | ||
|
|
8b3a2bcead | ||
|
|
13cf81e151 | ||
|
|
efdd6afa34 | ||
|
|
c878d17a2b | ||
|
|
050af07b3b | ||
|
|
1e5fd7fd13 | ||
|
|
c1475ba453 | ||
|
|
85862d1599 | ||
|
|
be2af4a3a2 | ||
|
|
d0fa304035 | ||
|
|
e49922d438 | ||
|
|
f29720effa | ||
|
|
543198cc89 | ||
|
|
c869080d91 | ||
|
|
f5f1f5ec70 | ||
|
|
0b3be17839 | ||
|
|
08f19e63e1 | ||
|
|
abbdc36eb8 | ||
|
|
8c71953eed | ||
|
|
dee28843ae | ||
|
|
cd91355896 | ||
|
|
85e5da660b | ||
|
|
7015db2414 | ||
|
|
a415fc2e7f | ||
|
|
0516aabcc1 | ||
|
|
1d8004623a | ||
|
|
5d1c63ab08 | ||
|
|
8527e17fa1 | ||
|
|
3782d548d8 | ||
|
|
f3e6c244be | ||
|
|
c449c72556 |
@@ -44,7 +44,7 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: sfall-build
|
||||
path: sfall-build
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
|
||||
+936
File diff suppressed because it is too large
Load Diff
@@ -13,12 +13,38 @@ A set of engine modifications for the classic game Fallout 2 in the form of a DL
|
||||
- Many additional features for users, such as item highlight button, party member control, etc.
|
||||
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
|
||||
|
||||
|
||||
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.
|
||||
|
||||
---
|
||||
#### Fallout Engine IDA Database
|
||||
[Download for IDA Pro 6.8](https://www.dropbox.com/s/tm0nyx0lnk4yui0/Fallout_1_and_2_IDA68.rar?dl=1 "Download from Dropbox")
|
||||
| [Download for IDA Pro 7.0](https://www.dropbox.com/s/61srq09pn8grfpu/Fallout_1_and_2_IDA70.rar?dl=1 "Download from Dropbox") (comments are in Russian)
|
||||
## Installation
|
||||
|
||||
- Download `sfall_*.7z` from the [release archive](https://sourceforge.net/projects/sfall/files/).
|
||||
|
||||
- Extract `ddraw.dll`, `ddraw.ini`, `sfall-mods.ini`, `sfall.dat`, and `data` folder to Fallout's base directory (i.e. the one that contains `fallout2.exe`).
|
||||
|
||||
- __Important Note:__\
|
||||
If you are using a mod that already included sfall (e.g. killap's [Unofficial Patch](https://github.com/BGforgeNet/Fallout2_Unofficial_Patch) or [Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project)), then that mod has probably included a custom modified `ddraw.ini`. In that case, overwriting it with sfall's vanilla `ddraw.ini` will be likely break your game. Instead, only overwrite `ddraw.dll`, and keep the mod's existing copy of `ddraw.ini`. (Or, if you know what you're doing, you can merge them together by hand.)
|
||||
|
||||
- The folder `translations` contains translations of some of the strings that sfall displays in the game. To use a translation, copy this folder to Fallout's base directory too, and then in `ddraw.ini` change the __TranslationsINI__ setting to `.\translations\<your language>.ini`.
|
||||
|
||||
## Uninstallation
|
||||
|
||||
Delete `ddraw.dll`, `ddraw.ini`, `sfall-mods.ini`, and `sfall.dat` from your Fallout directory. Also, delete `gl_highlighting.int` and `gl_partycontrol.int` from Fallout's `data\scripts\` directory.
|
||||
|
||||
## Usage
|
||||
|
||||
This mod is configured via the `ddraw.ini` and `sfall-mods.ini` files, which can be opened with any text editor. Details of every configerable option are included in those files. Where a comment refers to a DX scancode, the complete list of codes can be found at the link below:\
|
||||
https://kippykip.com/b3ddocs/commands/scancodes.htm
|
||||
|
||||
In a default installation using an unmodified copy of `ddraw.ini`, the middle mouse button will be set to switch between weapons and the mouse wheel will be set to scroll through any menus that respond to the up/down arrow keys. Holding Ctrl and hitting numpad keys 0 to 6 (with Num Lock off) will adjust the game speed. Holding left Ctrl will let you move a whole stack of items at once. Pressing left Shift will highlight items on the ground. The script extender and any engine fixes are also enabled. Most of the options that change gameplay in some way not originally intended by the developers are disabled.
|
||||
|
||||
For [__Wine__](https://www.winehq.org/) users:\
|
||||
You need to set DLL overrides for `ddraw.dll` to __"native, builtin"__ in `winecfg` or use `WINEDLLOVERRIDES="ddraw=n,b"` to run Fallout from the command line. If you want to play alternative sound files, you'll also need to install GStreamer Good 32-bit plugins.
|
||||
|
||||
## Additional info
|
||||
|
||||
* [Changelog](CHANGELOG.md)
|
||||
* [Scripting Documentation](https://sfall-team.github.io/sfall/)
|
||||
* Fallout Engine IDA Database: [for IDA Pro 6.8](https://www.dropbox.com/s/tm0nyx0lnk4yui0/Fallout_1_and_2_IDA68.rar?dl=1 "Download from Dropbox") | [for IDA Pro 7.0](https://www.dropbox.com/s/61srq09pn8grfpu/Fallout_1_and_2_IDA70.rar?dl=1 "Download from Dropbox") (comments are in Russian)
|
||||
* [Fallout 2 Reference Edition](https://github.com/alexbatalov/fallout2-re)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;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
|
||||
;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
|
||||
@@ -64,25 +64,30 @@ Enable=0
|
||||
;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
|
||||
;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
|
||||
;Skill1/Skill2: The first/second skill (or -1 for none) to check, but if you set a specific bit 0x4000000 (67108864),
|
||||
; it checks the corresponding GVAR
|
||||
; For example, if Skill1=0x4000004, 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
|
||||
;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
|
||||
;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
|
||||
;The extra perks 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
|
||||
|
||||
@@ -11,6 +11,8 @@ PartyLvlMsg=Lvl:
|
||||
PartyACMsg=AC:
|
||||
PartyAddictMsg=Addict
|
||||
NPCPickupFail=%s cannot pick up the item.
|
||||
AmmoInfoGlovz=Div: DR/%d, DT/%d
|
||||
AmmoInfoYAAM=DT Mod: %d
|
||||
|
||||
PartyOrderAttackHuman=I'll take care of it.|Okay, I got it.|Sounds like a plan.
|
||||
PartyOrderAttackCreature=::Growl::
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
;in the proto for other items, so AI will use them for healing in combat as well
|
||||
STIMPAK=40
|
||||
SUPER_STIMPAK=144
|
||||
HEALING_POWDER=237
|
||||
HEALING_POWDER=273
|
||||
|
||||
@@ -72,7 +72,7 @@ Power=16777349
|
||||
[5]
|
||||
PID=16777720
|
||||
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
Default=16777353
|
||||
Default=16777346
|
||||
Jacket=16777346
|
||||
Leather=16777347
|
||||
Metal=16777348
|
||||
|
||||
@@ -33,7 +33,7 @@ MotionScanner=0
|
||||
[CombatControl]
|
||||
;Allows you to directly control other critters in combat
|
||||
;Set to 0 to disable
|
||||
;Set to 1 to control all critters in combat
|
||||
;Set to 1 to control all critters in combat (allowed only in sfall debugging mode)
|
||||
;Set to 2 to control all party members
|
||||
;Set to 3 to let you order party members to attack specified targets after your first attack instead of controlling them directly
|
||||
Mode=0
|
||||
@@ -43,6 +43,9 @@ Mode=0
|
||||
;Set a comma delimited list of perk IDs for perks to be inherited from the player during the combat control
|
||||
PerksList=0,73
|
||||
|
||||
;Set to 1 to allow the player to gain a positive reputation when killing NPCs while controlling other critters
|
||||
GainReputation=0
|
||||
|
||||
;Choose a notification box to display the name of the controlled critter above the interface bar
|
||||
;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini)
|
||||
;For sfall 4.1.6+ the number for the notification box is set automatically, so just use any value
|
||||
|
||||
+25
-30
@@ -1,10 +1,9 @@
|
||||
;sfall configuration settings
|
||||
;v4.3.5
|
||||
;v4.3.8
|
||||
|
||||
[Main]
|
||||
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
|
||||
;The required settings will be read from the f2_res.ini configuration file of the original hi-res patch
|
||||
;This option is always read from the main ddraw.ini file
|
||||
HiResMode=1
|
||||
|
||||
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
|
||||
@@ -17,18 +16,16 @@ UseCommandLine=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[ExtraPatches]
|
||||
;This section allows you to set multiple paths to folders containing mods or patches that will be loaded by the game
|
||||
;If DataLoadOrderPatch is enabled, the data load order is:
|
||||
;master_patches > critter_patches > [extra patches] > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
|
||||
;This section allows you to set multiple paths to folders containing mods or patches
|
||||
;Paths to folders and Fallout .dat files are supported
|
||||
;The PatchFile## options are available from 0 to 99. Larger numbers take precedence over smaller numbers (same as patchXXX.dat)
|
||||
;The PatchFileXX options are available from 0 to 99. Larger numbers take precedence over smaller numbers (same as patchXXX.dat)
|
||||
;Starting from 4.2.6, the game will automatically search and load custom .dat files (or folders named as .dat files) from <GameRoot>\mods\
|
||||
;The load order of files in the folder will be in reverse alphabetical order of the filenames
|
||||
;Autoloaded files will have a higher priority than the files specified in the PatchFileXX options
|
||||
;The complete data load order is:
|
||||
;master_patches > critter_patches > mods > PatchFile99..PatchFile0 > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
|
||||
;PatchFile0=mods\RP_data
|
||||
|
||||
;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 PatchFile## options
|
||||
;This option has no effect in 4.2.6 or later. The path is fixed to <GameRoot>\mods\
|
||||
;AutoSearchPath=mods
|
||||
;PatchFile1=
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Speed]
|
||||
@@ -58,7 +55,7 @@ SpeedMultiInitial=100
|
||||
;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
|
||||
;This option will always be read from the main ddraw.ini file when using the hi-res patch by Mash
|
||||
;If using the hi-res patch by Mash, this option will always be read from the main ddraw.ini file
|
||||
Mode=0
|
||||
|
||||
;If using a DX9 mode, this changes the resolution
|
||||
@@ -133,14 +130,14 @@ 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 0 to leave the default unchanged (i.e. 8). The maximum is 32
|
||||
NumSoundBuffers=8
|
||||
|
||||
;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
|
||||
;Alternative music files will play 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
|
||||
|
||||
@@ -282,7 +279,7 @@ UseFileSystemOverride=0
|
||||
|
||||
;Set to 1 to use the modified data load order for the engine to find game data
|
||||
;Original: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat
|
||||
;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
|
||||
;Modified: master_patches > critter_patches > extra_patches > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
|
||||
;This option is always enabled in 4.3/3.8.30 or later. The information is left for reference only
|
||||
DataLoadOrderPatch=1
|
||||
|
||||
@@ -351,7 +348,7 @@ ExtraKillTypes=0
|
||||
;0 - Fallout default
|
||||
;1 - Glovz's Damage Fix
|
||||
;2 - Glovz's Damage Fix with Damage Multiplier tweak
|
||||
;5 - Haenlomal's Yet Another Ammo Mod.
|
||||
;5 - Haenlomal's Yet Another Ammo Mod
|
||||
DamageFormula=0
|
||||
|
||||
;Prevents you from using 0 to escape from dialogue at any time.
|
||||
@@ -431,7 +428,7 @@ 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 (WinXP/2000: if processes have equal priority)
|
||||
;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 30
|
||||
;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 50
|
||||
ProcessorIdle=-1
|
||||
|
||||
;Set to 1 if using the hero appearance mod
|
||||
@@ -454,7 +451,8 @@ NPCsTryToSpendExtraAP=0
|
||||
AllowLargeTiles=0
|
||||
|
||||
;Set to 1 to boost the maximum number of tile FRMs from 4096 to 16383
|
||||
MoreTiles=0
|
||||
;This option is always enabled in 4.3.7/3.8.37 or later. The information is left for reference only
|
||||
MoreTiles=1
|
||||
|
||||
;Change the Skilldex cursor FRM numbers
|
||||
;Default is 293 for all skills
|
||||
@@ -514,7 +512,7 @@ SpeedInterfaceCounterAnims=0
|
||||
ScienceOnCritters=0
|
||||
|
||||
;Modify this value to change the player's speed of rotation on the inventory and character screens
|
||||
;Default is 166
|
||||
;Default is 166 (lower - faster; valid range: 0..1000)
|
||||
SpeedInventoryPCRotation=166
|
||||
|
||||
;Modify the number of the extra interface boxes available to modders. (Default is 5, and the maximum is 95)
|
||||
@@ -531,13 +529,16 @@ BonusHtHDamageFix=1
|
||||
DisplayBonusDamage=0
|
||||
|
||||
;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127)
|
||||
AnimationsAtOnceLimit=120
|
||||
AnimationsAtOnceLimit=64
|
||||
|
||||
;Set to 1 to remove the limits that stop the player rolling critical successes/misses in the first few days of game time
|
||||
RemoveCriticalTimelimits=0
|
||||
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version number and copyright text
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version string and copyright text
|
||||
;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option
|
||||
;1 - change the colour for the version string only
|
||||
;2 - underline text for the version string
|
||||
;4 - use monospace font for the version string
|
||||
;MainMenuFontColour=0x00003C
|
||||
;Change the colour of the font used on the main menu for the button text
|
||||
;MainMenuBigFontColour=0x3C
|
||||
@@ -628,9 +629,6 @@ DialogPanelAnimDelay=33
|
||||
;Controls the speed of pipboy alarm clock animations (lower - faster; valid range: 0..127)
|
||||
PipboyTimeAnimDelay=50
|
||||
|
||||
;Set to 1 to stack empty identical weapons, no matter what type of ammo was loaded before
|
||||
StackEmptyWeapons=0
|
||||
|
||||
;Changes the way weapon reloading works when you drag ammo onto a weapon in the inventory
|
||||
;Set to -1 to disable (vanilla behavior with the 'Move Items' window)
|
||||
;Set to 0 to use all the ammo boxes to reload
|
||||
@@ -698,9 +696,6 @@ SkipLoadingGameSettings=0
|
||||
;The formula for the duration in ticks is: 10 * (value - 3 * EN)
|
||||
KnockoutTime=35
|
||||
|
||||
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
|
||||
CreditsAtBottom=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
; Critical modding options - the following options should be changed with caution
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
@@ -751,7 +746,7 @@ AIBestWeaponFix=1
|
||||
AIDrugUsePerfFix=0
|
||||
|
||||
;Set to 1 to fix the bug of using First Aid/Doctor skills when using them on the player
|
||||
;This will cause the party member to apply his/her skills when you use First Aid/Doctor skills on the player, but only if
|
||||
;This will cause the party member to perform First Aid/Doctor skills when you use them on the player, but only if
|
||||
;the player is standing next to the party member
|
||||
;Note that because the related engine function is not fully implemented, enabling this option without a global script
|
||||
;that overrides First Aid/Doctor functions has very limited usefulness
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
;Example Ammo INI for vanilla damage formula
|
||||
|
||||
; PID_EXPLOSIVE_ROCKET
|
||||
[1]
|
||||
pid=14
|
||||
ac_adjust=0
|
||||
dr_adjust=-25
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_10MM_JHP
|
||||
[2]
|
||||
pid=29
|
||||
ac_adjust=0
|
||||
dr_adjust=25
|
||||
dam_mult=2
|
||||
dam_div=1
|
||||
|
||||
; PID_10MM_AP
|
||||
[3]
|
||||
pid=30
|
||||
ac_adjust=0
|
||||
dr_adjust=-25
|
||||
dam_mult=1
|
||||
dam_div=2
|
||||
|
||||
; PID_44_MAGNUM_JHP
|
||||
[4]
|
||||
pid=31
|
||||
ac_adjust=0
|
||||
dr_adjust=20
|
||||
dam_mult=2
|
||||
dam_div=1
|
||||
|
||||
; PID_FLAMETHROWER_FUEL
|
||||
[5]
|
||||
pid=32
|
||||
ac_adjust=-20
|
||||
dr_adjust=25
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_14MM_AP
|
||||
[6]
|
||||
pid=33
|
||||
ac_adjust=0
|
||||
dr_adjust=-50
|
||||
dam_mult=1
|
||||
dam_div=2
|
||||
|
||||
; PID_223_FMJ
|
||||
[7]
|
||||
pid=34
|
||||
ac_adjust=-20
|
||||
dr_adjust=-20
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_5MM_JHP
|
||||
[8]
|
||||
pid=35
|
||||
ac_adjust=0
|
||||
dr_adjust=35
|
||||
dam_mult=2
|
||||
dam_div=1
|
||||
|
||||
; PID_5MM_AP
|
||||
[9]
|
||||
pid=36
|
||||
ac_adjust=0
|
||||
dr_adjust=-35
|
||||
dam_mult=1
|
||||
dam_div=2
|
||||
|
||||
; PID_ROCKET_AP
|
||||
[10]
|
||||
pid=37
|
||||
ac_adjust=-15
|
||||
dr_adjust=-50
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_SMALL_ENERGY_CELL
|
||||
[11]
|
||||
pid=38
|
||||
ac_adjust=0
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_MICRO_FUSION_CELL
|
||||
[12]
|
||||
pid=39
|
||||
ac_adjust=0
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_SHOTGUN_SHELLS
|
||||
[13]
|
||||
pid=95
|
||||
ac_adjust=-10
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_44_FMJ_MAGNUM
|
||||
[14]
|
||||
pid=111
|
||||
ac_adjust=0
|
||||
dr_adjust=-20
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_9MM_BALL
|
||||
[15]
|
||||
pid=121
|
||||
ac_adjust=0
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_BBS
|
||||
[16]
|
||||
pid=163
|
||||
ac_adjust=0
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_ROBO_ROCKET_AMMO
|
||||
[17]
|
||||
pid=274
|
||||
ac_adjust=0
|
||||
dr_adjust=-25
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_45_CALIBER_AMMO
|
||||
[18]
|
||||
pid=357
|
||||
ac_adjust=0
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_2MM_EC_AMMO
|
||||
[19]
|
||||
pid=358
|
||||
ac_adjust=-30
|
||||
dr_adjust=-20
|
||||
dam_mult=3
|
||||
dam_div=2
|
||||
|
||||
; PID_4_7MM_CASELESS
|
||||
[20]
|
||||
pid=359
|
||||
ac_adjust=-5
|
||||
dr_adjust=-10
|
||||
dam_mult=3
|
||||
dam_div=2
|
||||
|
||||
; PID_9MM_AMMO
|
||||
[21]
|
||||
pid=360
|
||||
ac_adjust=0
|
||||
dr_adjust=10
|
||||
dam_mult=1
|
||||
dam_div=2
|
||||
|
||||
; PID_HN_NEEDLER_CARTRIDGE
|
||||
[22]
|
||||
pid=361
|
||||
ac_adjust=-10
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_HN_AP_NEEDLER_CARTRIDGE
|
||||
[23]
|
||||
pid=362
|
||||
ac_adjust=-10
|
||||
dr_adjust=0
|
||||
dam_mult=2
|
||||
dam_div=1
|
||||
|
||||
; PID_7_62MM_AMMO
|
||||
[24]
|
||||
pid=363
|
||||
ac_adjust=-5
|
||||
dr_adjust=-10
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
|
||||
; PID_FLAMETHROWER_FUEL_MK_II
|
||||
[25]
|
||||
pid=382
|
||||
ac_adjust=-20
|
||||
dr_adjust=0
|
||||
dam_mult=1
|
||||
dam_div=1
|
||||
@@ -352,7 +352,7 @@ special=60
|
||||
|
||||
|
||||
;Each map has 2 variables
|
||||
; r{index}=region # corrisponds to a region section above
|
||||
; r{index}=region # corresponds to a region section above
|
||||
; a{index]=type # set to 0 for no weather or 1 for normal weather
|
||||
[Maps]
|
||||
|
||||
@@ -547,7 +547,7 @@ r70=16 ;cavern encounter 1
|
||||
a70=0
|
||||
r71=16 ;cavern encounter 2
|
||||
a71=0
|
||||
r72=16 ;cavern encoutner 3
|
||||
r72=16 ;cavern encounter 3
|
||||
a72=0
|
||||
r73=16 ;cavern encounter 4
|
||||
a73=0
|
||||
|
||||
Binary file not shown.
@@ -7,18 +7,14 @@
|
||||
NOTE: this script requires compiler from sfall modderspack with -s option
|
||||
(short circuit evaluation)
|
||||
|
||||
version 1.2
|
||||
version 1.3
|
||||
|
||||
*/
|
||||
|
||||
#include "..\headers\define.h"
|
||||
//#include "..\headers\command.h"
|
||||
#include "..\headers\global.h"
|
||||
#include "..\headers\critrpid.h"
|
||||
#include "main.h"
|
||||
|
||||
#define OBJ_DATA_LIGHT_DISTANCE (0x6C)
|
||||
#define OBJ_DATA_LIGHT_INTENSITY (0x70)
|
||||
#define PID_PLAYER (16777216)
|
||||
|
||||
procedure start;
|
||||
procedure AllowControl(variable pid);
|
||||
procedure SetLight(variable critter, variable int, variable dist);
|
||||
@@ -26,10 +22,10 @@ procedure CombatTurn_Handler;
|
||||
procedure GameModeChange_Handler;
|
||||
procedure InventoryMove_Handler;
|
||||
procedure InvenWield_Handler;
|
||||
procedure SetGlobalVar_Handler;
|
||||
|
||||
variable
|
||||
controlMode,
|
||||
noCheckArray,
|
||||
pidList, perksList,
|
||||
lightInt, lightDist, npcControl,
|
||||
displayName, displayNameColor, isShowTag,
|
||||
@@ -56,11 +52,20 @@ procedure CombatTurn_Handler begin
|
||||
|
||||
pid := obj_pid(critter);
|
||||
if (pid == PID_PLAYER and inControl == false) then return;
|
||||
if (pid != PID_PLAYER and controlMode != 1 and AllowControl(pid) == false) then return;
|
||||
|
||||
if (pid != PID_PLAYER and controlMode != 1 and AllowControl(pid) == false) then begin
|
||||
if (npcControl) then begin
|
||||
npcControl := 0;
|
||||
call SetLight(dude_obj, dudeLightInt, dudeLightDist); // restore dude light
|
||||
//move_to(dude_obj, dude_tile, dude_elevation);
|
||||
intface_redraw;
|
||||
end
|
||||
//display_msg("Skip control.");
|
||||
return;
|
||||
end
|
||||
|
||||
if (status == 1) then begin
|
||||
set_dude_obj(critter);
|
||||
intface_redraw;
|
||||
//display_msg("Take control of: " + obj_name(critter));
|
||||
|
||||
if (critter != real_dude_obj) then begin
|
||||
@@ -79,12 +84,14 @@ procedure CombatTurn_Handler begin
|
||||
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
|
||||
if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
intface_redraw;
|
||||
|
||||
obj_set_light_level(critter, 100, 4);
|
||||
inControl := true;
|
||||
end else if (npcControl) then begin
|
||||
call SetLight(dude_obj, dudeLightInt, dudeLightDist); // restore dude light
|
||||
npcControl := 0; // dude control
|
||||
npcControl := 0; // for dude control
|
||||
intface_redraw;
|
||||
end
|
||||
|
||||
if (inControl) then begin
|
||||
@@ -116,13 +123,13 @@ procedure CombatTurn_Handler begin
|
||||
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
|
||||
set_dude_obj(0); // w/o redraw interface bar
|
||||
if (status == 0) then set_dude_obj(0); // w/o redraw interface bar (otherwise it flickers when switching from the player to NPCs)
|
||||
//display_msg("Return control to real dude!");
|
||||
end
|
||||
|
||||
if (status < 0) then begin
|
||||
set_dude_obj(real_dude_obj);
|
||||
call SetLight(dude_obj, dudeLightInt, dudeLightDist); //obj_set_light_level(dude_obj, 100, 4);
|
||||
call SetLight(dude_obj, dudeLightInt, dudeLightDist);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -157,6 +164,16 @@ procedure InvenWield_Handler begin
|
||||
end
|
||||
end
|
||||
|
||||
procedure SetGlobalVar_Handler begin
|
||||
if (npcControl and get_sfall_arg == GVAR_PLAYER_REPUTATION and obj_pid(dude_obj) != PID_PLAYER) then begin
|
||||
variable value := global_var(GVAR_PLAYER_REPUTATION);
|
||||
if (get_sfall_arg > value) then begin
|
||||
set_sfall_arg(1, value);
|
||||
set_sfall_return(value);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if (game_loaded and sfall_ver_major >= 4) then begin
|
||||
//variable configSection := "CombatControl";
|
||||
@@ -168,7 +185,10 @@ procedure start begin
|
||||
if (controlMode >= 3) then begin
|
||||
if (controlMode == 3) then metarule3(999, 0, 0, 0); // enable feature: order party members to attack a specified target
|
||||
controlMode := 0;
|
||||
end else if (controlMode == 1 and GetIniConfig("Debugging", "Enable", 0, "ddraw.ini") == 0) then begin
|
||||
controlMode := 2;
|
||||
end
|
||||
|
||||
if (controlMode > 0) then begin
|
||||
displayName := GetConfig("CombatControl", "DisplayName", 0);
|
||||
|
||||
@@ -199,6 +219,10 @@ procedure start begin
|
||||
register_hook_proc(HOOK_GAMEMODECHANGE, GameModeChange_Handler);
|
||||
register_hook_proc(HOOK_INVENTORYMOVE, InventoryMove_Handler);
|
||||
register_hook_proc(HOOK_INVENWIELD, InvenWield_Handler);
|
||||
|
||||
if (GetConfig("CombatControl", "GainReputation", 0) == 0) then begin
|
||||
register_hook_proc(HOOK_SETGLOBALVAR, SetGlobalVar_Handler);
|
||||
end
|
||||
end else begin
|
||||
exit;
|
||||
end
|
||||
|
||||
@@ -22,4 +22,4 @@ This folder contains documentation about sfall scripting extensions.
|
||||
arrays.md - manual for sfall arrays
|
||||
|
||||
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in **.\compiler\sslc_readme.md**.
|
||||
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting Language).
|
||||
There are numerous new syntax features and extensions to SSL (Star-Trek Scripting Language).
|
||||
|
||||
@@ -22,4 +22,4 @@ This folder contains documentation about sfall scripting extensions.
|
||||
arrays.html - manual for sfall arrays
|
||||
|
||||
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in .\compiler\sslc_readme.html.
|
||||
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting Language).
|
||||
There are numerous new syntax features and extensions to SSL (Star-Trek Scripting Language).
|
||||
|
||||
@@ -200,7 +200,7 @@ _*mixed means any type_
|
||||
- if array was "saved", it will be removed from a savegame
|
||||
|
||||
#### `mixed scan_array(int arrayID, mixed value)`
|
||||
- searches for a first occurence of given value inside given array
|
||||
- searches for a first occurrence of given value inside given array
|
||||
- if value is found, returns its index (for lists) or key (for maps)
|
||||
- if value is not found, returns -1 (be careful, as -1 can be a valid key for a map)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Optimization
|
||||
------------
|
||||
|
||||
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.
|
||||
The execution 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
|
||||
@@ -26,7 +26,7 @@ The sfall build of sslc supports a `-O` command line option to perform an optimi
|
||||
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.
|
||||
- constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevant 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);
|
||||
@@ -103,8 +103,8 @@ The sfall build of sslc supports a `-O` command line option to perform an optimi
|
||||
-> end
|
||||
```
|
||||
|
||||
- Mark functions with `pure` or `inline` where relevent.
|
||||
- Mark functions with `pure` or `inline` where relevant.
|
||||
|
||||
* `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.
|
||||
* `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 separate 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.
|
||||
|
||||
@@ -79,7 +79,7 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
|
||||
- Conditional expressions (Python-inspired), also known as ternary operator:
|
||||
- new:
|
||||
```
|
||||
X := value1 if condition else value2
|
||||
X := value1 if (condition) else value2
|
||||
```
|
||||
- old:
|
||||
```
|
||||
@@ -99,7 +99,7 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
|
||||
x := 5;
|
||||
```
|
||||
|
||||
- Multiple variable declaration: 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.
|
||||
- Multiple variable declaration: Multiple variables can be declared on one line, separated by commas. This is an alternative to the ugly begin/end block, or the bulky single variable per line style.
|
||||
- new:
|
||||
```
|
||||
variable a, b, c;
|
||||
@@ -131,7 +131,7 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
|
||||
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.
|
||||
- Increment/decrement operators: `++` and `--` can be used as shorthand for `+= 1` and `-= 1` respectively. They are merely a syntactic shorthand to improve readability, and so their use is only allowed where `+= 1` would normally be allowed.
|
||||
- new:
|
||||
```
|
||||
a++;
|
||||
@@ -222,7 +222,7 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
|
||||
|
||||
- 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");
|
||||
#define my_macro display_msg("foo");
|
||||
|
||||
procedure start begin
|
||||
my_macro;
|
||||
@@ -230,22 +230,23 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
|
||||
```
|
||||
__NOTE:__ **Does not work currently.**
|
||||
|
||||
- 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.
|
||||
- Procedure stringify operator `@`: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by `@` by a string constant.
|
||||
- old:
|
||||
```
|
||||
callbackVar := "Node000";
|
||||
callbackVar();
|
||||
call callbackVar;
|
||||
```
|
||||
- new:
|
||||
```
|
||||
callbackVar := @Node000;
|
||||
callbackVar();
|
||||
call callbackVar;
|
||||
```
|
||||
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
|
||||
|
||||
|
||||
- (*) **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 `[]`` 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.md** for more information)
|
||||
- new:
|
||||
```
|
||||
@@ -396,7 +397,7 @@ There are several changes in this version of sslc which may result in problems f
|
||||
|
||||
**sfall 3.6:**
|
||||
- added Python-style ternary operator (conditional expression)
|
||||
- added `-s` short-circuit evalution option for `AND`, `OR` expressions
|
||||
- added `-s` short-circuit evaluation 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
|
||||
@@ -407,7 +408,7 @@ There are several changes in this version of sslc which may result in problems f
|
||||
- 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 script functions was moved from code generation to parsing stage
|
||||
- now it is possible to call user-defined procedures inside argument list of script functions, without compiler attempting to treat them as procedure references and probably fail (procedures will still be passed, but only to appropriate script 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 script functions (like `giq_option`)
|
||||
- **int2ssl** will now place empty parentheses after a call to user-defined procedure - this will distinct calls from passing procedures to some script 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)
|
||||
|
||||
@@ -130,12 +130,12 @@
|
||||
detail: get_stat_min(int stat, bool who = False)
|
||||
doc: |
|
||||
- Returns the minimum set value of the specified stat (see `set_stat_min` functions)
|
||||
- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
|
||||
- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters
|
||||
- name: get_stat_max
|
||||
detail: get_stat_max(int stat, bool who = False)
|
||||
doc: |
|
||||
- Returns the maximum set value of the specified stat (see `set_stat_max` functions)
|
||||
- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
|
||||
- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters
|
||||
|
||||
- name: Alter min/max
|
||||
doc: 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 affects the player, the `set_npc_` functions only affects other critters, and the `set_` functions affects both.
|
||||
@@ -497,6 +497,11 @@
|
||||
- name: set_terrain_name
|
||||
detail: void sfall_func3("set_terrain_name", int x, int y, string name)
|
||||
doc: Overrides the terrain type name for the sub-tile on the world map by the specified coordinates.
|
||||
macro: sfall.h
|
||||
- name: get_terrain_name
|
||||
detail: string sfall_func2("get_terrain_name", int x, int y)
|
||||
doc: Returns the terrain type name for the sub-tile on the world map by the specified coordinates, or by the player's current position if called without arguments.
|
||||
macro: sfall.h
|
||||
- name: set_town_title
|
||||
detail: void sfall_func2("set_town_title", int areaID, string title)
|
||||
doc: |
|
||||
@@ -752,7 +757,7 @@
|
||||
- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
|
||||
- `maxDamage` is optional
|
||||
- `activePid` is for an item with an active timer, can be the same as the `pid` argument
|
||||
- the item proto must be "Misc Item" type and have "Use" action flag
|
||||
- the item proto must be the **Misc Item** type and have the **Use** action flag
|
||||
- minDamage/maxDamage are the minimum and maximum explosion damage
|
||||
- using the function on an item that is already set as an explosive will override its previous settings
|
||||
- NOTE: this function does not work for pids of Dynamite and Plastic Explosives
|
||||
@@ -875,7 +880,7 @@
|
||||
opcode: 0x8177
|
||||
- name: set_pipboy_available
|
||||
detail: void set_pipboy_available(int available)
|
||||
doc: 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.
|
||||
doc: Sets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not mark the `VSUIT_MOVIE` movie as "played").
|
||||
opcode: 0x818b
|
||||
- name: get_kill_counter
|
||||
detail: int get_kill_counter(int critterType)
|
||||
@@ -1072,11 +1077,11 @@
|
||||
parent: Variables
|
||||
items:
|
||||
- name: string_split
|
||||
detail: array string_split(string, split)
|
||||
detail: array string_split(string text, split)
|
||||
doc: "Takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. You can use this to search for a substring in a string like this: `strlen(get_array(string_split(haystack, needle), 0))`"
|
||||
opcode: 0x8235
|
||||
- name: substr
|
||||
detail: string substr(string, start, length)
|
||||
detail: string substr(string text, start, length)
|
||||
doc: |
|
||||
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").
|
||||
@@ -1173,34 +1178,34 @@
|
||||
opcode: 0x81e5
|
||||
- name: set_sfall_arg
|
||||
detail: void set_sfall_arg(int argNum, int value)
|
||||
doc: 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 `register_hook_proc`).
|
||||
doc: 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 `register_hook_proc`).
|
||||
opcode: 0x823d
|
||||
- name: register_hook
|
||||
detail: void register_hook(int hookID)
|
||||
doc: 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 current global script. You can use all above functions like normal.
|
||||
doc: 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` procedure will be executed in current global script. You can use all above functions like normal.
|
||||
opcode: 0x8207
|
||||
- name: register_hook_proc
|
||||
detail: void register_hook_proc(int hookID, proc procedure)
|
||||
doc: |
|
||||
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!).
|
||||
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 with no conflicts) and flexibility. You can place all related hook scripts for a specific mod in one global script!
|
||||
|
||||
Use zero (0) as second argument to unregister hook script from current global script.
|
||||
|
||||
__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.
|
||||
__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. 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.
|
||||
|
||||
Example: let's say we have a Mod A which reduces all "to hit" chances by 50%. The code might look like this:
|
||||
__Example:__ Sometimes you need to multiply certain value in a chain of hook scripts. Let's say we have a **Mod A** which reduces all "to hit" chances by 50%. The code might look like this:
|
||||
|
||||
```js
|
||||
original_chance = get_sfall_arg;
|
||||
set_sfall_return(original_chance / 2);
|
||||
```
|
||||
|
||||
Mod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script:
|
||||
**Mod B** also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to **Mod A** hook script:
|
||||
```js
|
||||
set_sfall_arg(0, (original_chance / 2));
|
||||
```
|
||||
|
||||
This basically changes hook argument for the next script. Mod B code:
|
||||
This basically changes hook argument for the next script. **Mod B** code:
|
||||
```js
|
||||
original_chance = get_sfall_arg;
|
||||
set_sfall_return(original_chance * 1.5);
|
||||
@@ -1213,7 +1218,12 @@
|
||||
opcode: 0x8262
|
||||
- name: register_hook_proc_spec
|
||||
detail: void register_hook_proc_spec(int hookID, procedure proc)
|
||||
doc: 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.
|
||||
doc: Works the same as `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_<name>.int` script). In addition, all scripts hooked to a single hook point with this function are executed in the exact order of how they were registered. In the case of using `register_hook` and `register_hook_proc` functions, scripts are executed in reverse order of how they were registered.
|
||||
|
||||
**The execution chain of script procedures for a hook is as follows:**
|
||||
1. Procedures registered with `register_hook` and `register_hook_proc` functions (executed in reverse order of registration).
|
||||
2. The `hs_<name>.int` script.
|
||||
3. Procedures registered with the `register_hook_proc_spec` function (executed in the exact order of registration).
|
||||
|
||||
- name: Array functions
|
||||
parent: Arrays # not in this files, normal page
|
||||
@@ -1670,7 +1680,7 @@
|
||||
- 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
|
||||
- value: `True` - set the flag, `False` - unset the flag
|
||||
macro: sfall.h
|
||||
|
||||
- name: win_fill_color
|
||||
@@ -1817,14 +1827,14 @@
|
||||
- name: Objects and scripts
|
||||
items:
|
||||
- name: set_self
|
||||
detail: void set_self(ObjectPtr)
|
||||
detail: void set_self(ObjectPtr setObj)
|
||||
doc: |
|
||||
Overrides the script's `self_obj` for the next function call.
|
||||
- It is primarily used to allow the calling of functions which take an implicit `self_obj` parameter (e.g. `drop_obj`) from global scripts, but it can also be used from normal scripts.
|
||||
- Will revert back to its original value after the next function call.
|
||||
- Calling `self_obj(0)` will also revert `self_obj` to original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.
|
||||
- `self_obj` will be reverted to its original value after the next function call.
|
||||
- Calling `set_self(0)` will also revert `self_obj` to its original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.
|
||||
- `source_obj`, `target_obj`, and similar functions will not work if preceded by `set_self`.
|
||||
- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice.
|
||||
- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice. You can also access the local variables in the script of an object after calling `set_self` twice.
|
||||
opcode: 0x8206
|
||||
- name: set_dude_obj
|
||||
detail: void set_dude_obj(ObjectPtr critter)
|
||||
@@ -1836,15 +1846,15 @@
|
||||
macro: sfall.h
|
||||
|
||||
- name: remove_script
|
||||
detail: void remove_script(ObjectPtr)
|
||||
detail: void remove_script(ObjectPtr obj)
|
||||
opcode: 0x81f3
|
||||
doc: Accepts a pointer to an object and will remove the script from that object.
|
||||
- name: set_script
|
||||
detail: void set_script(ObjectPtr, int scriptid)
|
||||
detail: void set_script(ObjectPtr obj, int scriptID)
|
||||
opcode: 0x81f4
|
||||
doc: Accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as `create_object_sid `from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling `set_script` on `self_obj` will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling `set_script`, `map_enter_p_proc` will be SKIPPED. The `start` proc will always be run.
|
||||
- name: get_script
|
||||
detail: int get_script(ObjectPtr)
|
||||
detail: int get_script(ObjectPtr obj)
|
||||
opcode: 0x81f5
|
||||
doc: |
|
||||
- accepts a pointer to an object and returns its scriptID (line number in `scripts.lst`), or 0 if the object is unscripted.
|
||||
@@ -1915,5 +1925,5 @@
|
||||
|
||||
- name: obj_is_openable
|
||||
detail: bool obj_is_openable(object obj)
|
||||
doc: Returns True if the object is openable (i.e. has an opening/closing animation)
|
||||
doc: Returns True if the object is openable (i.e. has an opening/closing animation), False otherwise
|
||||
macro: sfall.h
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user