mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76b0528e7f | ||
|
|
87c4dd34f1 | ||
|
|
7848e1612b | ||
|
|
537bea45c0 | ||
|
|
a3f22b67d8 | ||
|
|
c079d69291 | ||
|
|
fc78983f77 | ||
|
|
9122fcaf0c | ||
|
|
aeb7ab4e32 | ||
|
|
1f1c39a4bd | ||
|
|
53b407b8a5 | ||
|
|
eb204f0a04 | ||
|
|
b5b2ef3b97 | ||
|
|
c61fe596b1 | ||
|
|
1ac911a7c9 | ||
|
|
19f4901328 | ||
|
|
90b547a472 | ||
|
|
d812059030 | ||
|
|
fd11a5736e | ||
|
|
863a232703 | ||
|
|
869b3cf4bd | ||
|
|
27233d19a2 | ||
|
|
b69640f09a | ||
|
|
d387e009ee | ||
|
|
56f2ea46c2 | ||
|
|
f57564c9ed | ||
|
|
dc4c4c2524 | ||
|
|
957ed92498 | ||
|
|
bf4c47d1c0 | ||
|
|
160a5b6053 | ||
|
|
201fa1da0c | ||
|
|
d1868d2eaf | ||
|
|
dd7613c910 | ||
|
|
14e2ee2064 | ||
|
|
39a89d50a1 | ||
|
|
9dea6911a6 | ||
|
|
fece180f0b | ||
|
|
af049eaa38 | ||
|
|
e0305983de | ||
|
|
323738f584 | ||
|
|
310a0df8f6 | ||
|
|
db4652c105 | ||
|
|
5d9d11b4f5 | ||
|
|
756356dbf2 | ||
|
|
fad2928fbf | ||
|
|
85e70fe056 | ||
|
|
1af1eb2c70 | ||
|
|
3a4a9d7240 | ||
|
|
cd674fede2 | ||
|
|
5200be19c9 | ||
|
|
b984568b32 | ||
|
|
71803ff06c | ||
|
|
7cef7e8e54 | ||
|
|
7990d230f2 | ||
|
|
cb9f759d71 | ||
|
|
7ed8dd286c | ||
|
|
9f3299b47a | ||
|
|
a68498453c | ||
|
|
0bf9a322c1 | ||
|
|
a325dd18ea | ||
|
|
439de4aecc | ||
|
|
702e62e610 | ||
|
|
ddf0ec7085 | ||
|
|
b539cab67d | ||
|
|
b149aaa00c | ||
|
|
a5bcfa8a6b | ||
|
|
80cf1a9ca7 | ||
|
|
4cffc455e2 | ||
|
|
1bb04a6d45 | ||
|
|
2a2849537c | ||
|
|
84076a2586 | ||
|
|
11fee91f2f | ||
|
|
6d12481754 | ||
|
|
04d4a8dc5b | ||
|
|
d1851cbde1 | ||
|
|
accf564e6e | ||
|
|
977e6a5ad7 | ||
|
|
0c42f6447d | ||
|
|
5053ab564d | ||
|
|
f0f134d077 | ||
|
|
199502782b | ||
|
|
e93d878d1d | ||
|
|
18c10d8911 | ||
|
|
996dd293c0 | ||
|
|
9904423641 | ||
|
|
534bc3e5cd | ||
|
|
227a062fa6 | ||
|
|
09d97464c8 | ||
|
|
b8de20d455 | ||
|
|
4ae09522f0 | ||
|
|
76cc0471d6 | ||
|
|
2e39325521 | ||
|
|
f3abea3462 | ||
|
|
d0c4bc3b78 | ||
|
|
2e655945c0 | ||
|
|
521b6c7e08 | ||
|
|
c348925c95 | ||
|
|
0d023c32db | ||
|
|
0570062123 | ||
|
|
a6c09d4d5c | ||
|
|
20119daf3d | ||
|
|
3553d45e5c | ||
|
|
fc9c260a9f | ||
|
|
9f27c160ff | ||
|
|
1f156d39ae | ||
|
|
3d9febecb9 | ||
|
|
9fab4b32ee | ||
|
|
d762f57cbc | ||
|
|
e13a27469f | ||
|
|
ab2283f0e3 | ||
|
|
882a601b0c | ||
|
|
85dfb35f01 | ||
|
|
614caded92 | ||
|
|
1b6d6179a1 | ||
|
|
6ede19ceec | ||
|
|
172495bdc5 | ||
|
|
2187854bf2 | ||
|
|
8d29e04712 | ||
|
|
8468fee7b4 | ||
|
|
000b116895 | ||
|
|
98199b4e7e | ||
|
|
a17471b624 |
@@ -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.
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ WeaponAccurateBonus=20
|
||||
WeaponHandlingBonus=3
|
||||
|
||||
;##############################################################################
|
||||
[Perks]
|
||||
;Set to 1 to enable the modifications for perks
|
||||
Enable=0
|
||||
|
||||
;Name=The name of the perk (max 63 characters)
|
||||
;Desc=The description of the perk (max 255 characters)
|
||||
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
|
||||
@@ -119,6 +123,11 @@ Skill4Mod=0
|
||||
Skill5=-1
|
||||
Skill5Mod=0
|
||||
|
||||
;##############################################################################
|
||||
[Traits]
|
||||
;Set to 1 to enable the modifications for traits
|
||||
Enable=0
|
||||
|
||||
;This is a modification to trait 0
|
||||
[t0]
|
||||
NoHardcode=0
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
;NPC armor appearance configuration for vanilla Fallout 2. Does not require any new graphics
|
||||
;Party members will use player's armor appearance just like old B-Team mod
|
||||
|
||||
;WeaponAnims codes
|
||||
; 1 - Knife (D)
|
||||
; 2 - Club (E)
|
||||
; 3 - Sledgehammer (F)
|
||||
; 4 - Spear (G)
|
||||
; 5 - Pistol (H)
|
||||
; 6 - SMG (I)
|
||||
; 7 - Rifle (J)
|
||||
; 8 - Big Gun (K)
|
||||
; 9 - Minigun (L)
|
||||
; 10 - Rocket Launcher (M)
|
||||
; 11-15 - sfall additional weapon animation codes
|
||||
|
||||
; This section maps 7 armor types to corresponding armor item PIDs
|
||||
[ArmorTypes]
|
||||
Jacket = 74,265
|
||||
Leather = 1,379
|
||||
Metal = 2,240,380
|
||||
Power = 3,232
|
||||
AdvPower = 348,349
|
||||
Combat = 17,239,381
|
||||
Robe = 113,524
|
||||
|
||||
; Default armor FIDs (the same for all NPCs)
|
||||
[Default]
|
||||
Jacket = 16777229
|
||||
Leather = 16777228
|
||||
Metal = 16777230
|
||||
Combat = 16777226
|
||||
Power = 16777217
|
||||
AdvPower = 16777287
|
||||
Robe = 16777218
|
||||
|
||||
; Sulik
|
||||
[1]
|
||||
PID=16777313
|
||||
WeaponAnims=1,3,4,6
|
||||
Default=16777280
|
||||
|
||||
; Vic
|
||||
[2]
|
||||
PID=16777278
|
||||
WeaponAnims=1,5,7
|
||||
Default=16777307
|
||||
|
||||
; Cassidy
|
||||
[3]
|
||||
PID=16777305
|
||||
WeaponAnims=4,5,7
|
||||
Default=16777260
|
||||
Leather=16777260
|
||||
|
||||
; Myron
|
||||
[4]
|
||||
PID=16777376
|
||||
WeaponAnims=1,5
|
||||
Default=16777304
|
||||
|
||||
; Lenny
|
||||
[5]
|
||||
PID=16777323
|
||||
WeaponAnims=1,5,6
|
||||
Default=16777295
|
||||
|
||||
; Davin
|
||||
[6]
|
||||
PID=16777379
|
||||
WeaponAnims=1,2,5
|
||||
Default=16777264
|
||||
|
||||
; Miria
|
||||
[7]
|
||||
PID=16777380
|
||||
WeaponAnims=1,6
|
||||
Default=16777252
|
||||
Jacket=16777222
|
||||
Leather=16777221
|
||||
Metal=16777223
|
||||
Combat=16777219
|
||||
@@ -23,69 +23,67 @@ Robe = 113,524
|
||||
|
||||
; Default armor FIDs (the same for all NPCs)
|
||||
[Default]
|
||||
Power=16777217
|
||||
AdvPower=16777287
|
||||
Robe=16777218
|
||||
|
||||
Power = 16777217
|
||||
AdvPower = 16777287
|
||||
Robe = 16777218
|
||||
|
||||
; Sulik
|
||||
[1]
|
||||
PID=16777313
|
||||
WeaponAnims=1,3,4,6
|
||||
WeaponAnims=1,3,4,6,14
|
||||
Default=16777280
|
||||
Leather=16777325
|
||||
Power=16777324
|
||||
Metal=16777323
|
||||
Jacket=16777321
|
||||
Leather=16777325
|
||||
Metal=16777323
|
||||
Combat=16777322
|
||||
Power=16777324
|
||||
|
||||
; Vic
|
||||
[2]
|
||||
PID=16777278
|
||||
WeaponAnims=1,5,7
|
||||
WeaponAnims=1,5,7,13,14
|
||||
Default=16777307
|
||||
Jacket=16777329
|
||||
Combat=16777330
|
||||
Metal=16777331
|
||||
Power=16777332
|
||||
Leather=16777333
|
||||
Metal=16777331
|
||||
Combat=16777330
|
||||
Power=16777332
|
||||
|
||||
; Cassidy
|
||||
[3]
|
||||
PID=16777305
|
||||
WeaponAnims=4,5,7
|
||||
WeaponAnims=4,5,7,13
|
||||
Default=16777354
|
||||
Leather=16777260
|
||||
Power=16777328
|
||||
Metal=16777327
|
||||
Jacket=16777351
|
||||
Leather=16777260
|
||||
Metal=16777327
|
||||
Combat=16777326
|
||||
Power=16777328
|
||||
|
||||
; Myron
|
||||
[4]
|
||||
PID=16777376
|
||||
WeaponAnims=1,5
|
||||
WeaponAnims=1,5,14
|
||||
Default=16777304
|
||||
Leather=
|
||||
Power=16777349
|
||||
Combat=16777350
|
||||
Power=16777349
|
||||
|
||||
; Cat Jules
|
||||
; Cat Jules (RP)
|
||||
[5]
|
||||
PID=16777734
|
||||
PID=16777720
|
||||
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
Default=16777353
|
||||
Jacket=16777346
|
||||
Leather=16777347
|
||||
Metal=16777348
|
||||
Jacket=16777346
|
||||
Combat=16777226
|
||||
|
||||
; Kitsune
|
||||
; Kitsune (RP)
|
||||
[6]
|
||||
PID=16777724
|
||||
PID=16777718
|
||||
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
Default=16777222
|
||||
Jacket=16777222
|
||||
Leather=16777221
|
||||
Metal=16777223
|
||||
Jacket=16777222
|
||||
Combat=16777219
|
||||
|
||||
+90
-66
@@ -1,12 +1,12 @@
|
||||
;sfall configuration settings
|
||||
;v4.2
|
||||
;v4.2.3
|
||||
|
||||
[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]
|
||||
@@ -80,6 +80,10 @@ Mode=0
|
||||
GraphicsWidth=0
|
||||
GraphicsHeight=0
|
||||
|
||||
;Uncomment the option to use a hardware shader (requires DX9 graphics mode 4 or 5)
|
||||
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
|
||||
;GlobalShaderFile=global.fx
|
||||
|
||||
;Set to 1 to do the palette conversion on the GPU
|
||||
;Set to 2 to do the palette conversion on the CPU
|
||||
;Set to 0 to pick automatically
|
||||
@@ -94,7 +98,7 @@ GPUBlt=0
|
||||
Use32BitHeadGraphics=0
|
||||
|
||||
;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies
|
||||
;Requires graphics mode 4 or 5
|
||||
;Requires DX9 graphics mode 4 or 5
|
||||
AllowDShowMovies=0
|
||||
|
||||
;Fade effect time percentage modifier
|
||||
@@ -103,6 +107,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 +119,17 @@ 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
|
||||
[Input]
|
||||
@@ -186,7 +202,7 @@ FastMoveFromContainer=0
|
||||
|
||||
;A key to press to open a debug game editor
|
||||
;Set to 0 to disable, or a DX scancode otherwise
|
||||
;Requires sfall debugging mode to be enabled and FalloutClient.exe from the modders pack
|
||||
;Requires sfall debugging mode and FalloutClient.exe from the modders pack
|
||||
DebugEditorKey=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
@@ -194,6 +210,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 +262,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
|
||||
@@ -288,9 +310,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
|
||||
@@ -313,9 +332,6 @@ DamageFormula=0
|
||||
;Prevents you from using 0 to escape from dialogue at any time.
|
||||
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
|
||||
DisableHorrigan=0
|
||||
|
||||
@@ -341,9 +357,6 @@ OverrideArtCacheSize=0
|
||||
;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 +385,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
|
||||
@@ -384,9 +395,6 @@ AlwaysReloadMsgs=0
|
||||
;Set to 1 to force the player to play the idle animation when reloading their weapon
|
||||
PlayIdleAnimOnReload=0
|
||||
|
||||
;Set to 1 to prevent corpses from blocking line of fire
|
||||
CorpseLineOfFireFix=1
|
||||
|
||||
;Changes the timer (in days) for deleting corpses on a map after you leave (valid range: 0..13)
|
||||
;The corpses of critters with 'Ages' flag or on maps with 'dead_bodies_age=No' set in maps.txt will not disappear
|
||||
;Default is 6. Set to 0 for a 12-hour timer
|
||||
@@ -394,12 +402,12 @@ 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 0 to idle only if other processes are waiting for processor time (WinXP/2000: if processes have equal priority)
|
||||
;Set to 1 (or some higher number if needed, the maximum is 127) to prevent 100% CPU use
|
||||
ProcessorIdle=-1
|
||||
|
||||
;Set to 1 if using the hero appearance mod
|
||||
;Set to 2 for backward compatibility with old scripts that manually fix obj_art_fid script function for dude_obj
|
||||
;Set to 2 for backward compatibility with scripts that manually fix obj_art_fid/art_change_fid_num script functions for dude_obj
|
||||
;You can add AppChCrt.frm and AppChEdt.frm files to art\intrface\ to set a custom background for the character screen
|
||||
EnableHeroAppearanceMod=0
|
||||
|
||||
@@ -412,8 +420,9 @@ SkipOpeningMovies=0
|
||||
;Set to 0 to disable
|
||||
NPCsTryToSpendExtraAP=0
|
||||
|
||||
;Set to 1 to fix NPCs not checking weapon perks properly when searching for the best weapon
|
||||
;Note that enabling this option can significantly affect the weapon choice of some NPCs in combat
|
||||
;Set to 1 to fix NPCs not checking weapon perks properly when choosing the best weapon in combat
|
||||
;Set to 2 to change the priority multiplier for having weapon perk to 3x (the original is 5x)
|
||||
;Note that enabling this option can significantly affect the weapon of choice for some NPCs
|
||||
AIBestWeaponFix=0
|
||||
|
||||
;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as drug use preference when using drugs in their inventory
|
||||
@@ -437,6 +446,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
|
||||
@@ -448,6 +460,7 @@ UseScrollingQuestsList=1
|
||||
|
||||
;Uncomment these lines to control the premade characters offered when starting a new game
|
||||
;Multiple options should be separated by commas, and there must be the same number of entries in both lines
|
||||
;Each name in PremadePaths is limited to 11 characters
|
||||
;PremadePaths=combat,diplomat,stealth
|
||||
;PremadeFIDs=201,203,202
|
||||
|
||||
@@ -456,7 +469,7 @@ UseScrollingQuestsList=1
|
||||
;CityRepsList=0:47,2:48,1:49,4:50,5:51,3:52,8:53,6:54,7:55,13:56,10:57,11:59,14:61,17:63,19:64,18:65,25:66,9:294,20:308
|
||||
|
||||
;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
|
||||
@@ -499,18 +512,12 @@ 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
|
||||
|
||||
;Set to 1 to remove the limits that stop the player rolling critical successes/misses in the first few days of game time
|
||||
RemoveCriticalTimelimits=0
|
||||
|
||||
;Set to 1 to enable party members with level 6 protos to reach level 6
|
||||
NPCStage6Fix=0
|
||||
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version number and copyright text
|
||||
;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option
|
||||
;MainMenuFontColour=0x00003C
|
||||
@@ -526,18 +533,6 @@ FastShotFix=1
|
||||
;Set to 1 to boost the maximum number of script names from 1450 to 10000
|
||||
BoostScriptDialogLimit=0
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line 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
|
||||
@@ -589,6 +584,10 @@ StartGDialogFix=0
|
||||
;attacker_results - unused, must be 0 or not equal to the target_results argument when specifying result flags for the target
|
||||
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
|
||||
|
||||
@@ -618,17 +617,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)
|
||||
@@ -646,7 +641,7 @@ StackEmptyWeapons=0
|
||||
;If the amount of ammo boxes in the inventory is less than or equal to the reserve, only one box will be used
|
||||
ReloadReserve=-1
|
||||
|
||||
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number except in the barter screen
|
||||
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
|
||||
ItemCounterDefaultMax=0
|
||||
|
||||
;Set to 1 to leave the music playing in dialogue with talking heads
|
||||
@@ -727,6 +722,35 @@ KnockoutTime=35
|
||||
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
|
||||
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
|
||||
@@ -734,10 +758,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]
|
||||
@@ -748,8 +773,8 @@ GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
|
||||
Enable=0
|
||||
|
||||
;Fallout 2 Debug Patch
|
||||
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and a debug.log file
|
||||
;Does not require enabling sfall debugging mode
|
||||
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and debug.log
|
||||
;Does not require sfall debugging mode
|
||||
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
|
||||
;-------
|
||||
;[debug]
|
||||
@@ -759,25 +784,24 @@ 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
|
||||
;Requires DebugMode to be enabled
|
||||
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 enabling sfall debugging mode
|
||||
;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 enabling sfall debugging mode
|
||||
;Does not require sfall debugging mode
|
||||
;ExtraCRC=0x00000000,0x00000000
|
||||
|
||||
;Set to 1 to stop Fallout from deleting non read-only protos at startup
|
||||
@@ -785,20 +809,20 @@ SkipSizeCheck=0
|
||||
DontDeleteProtos=0
|
||||
|
||||
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
|
||||
;Does not require sfall debugging mode
|
||||
AllowUnsafeScripting=0
|
||||
|
||||
;Set to 1 to force sfall to search for global scripts every time the game loads rather than only once on the first game start
|
||||
AlwaysFindScripts=0
|
||||
|
||||
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
|
||||
InjectAllGameHooks=0
|
||||
|
||||
;Set to 1 to force sfall to search for global scripts every time the game loads rather than only once on the first game start
|
||||
AlwaysFindScripts=0
|
||||
|
||||
;Set to 1 to force critters to display combat float messages
|
||||
;Requires AllowSoundForFloats to be enabled
|
||||
Test_ForceFloats=0
|
||||
|
||||
;These options control what output is saved in the debug log (sfall-log.txt)
|
||||
|
||||
;Prints messages duing sfall initialization
|
||||
Init=0
|
||||
;Prints messages relating to hook scripts
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// Status: WIP
|
||||
|
||||
texture bloomMap;
|
||||
sampler s0;
|
||||
|
||||
sampler BloomSampler : samplerstate
|
||||
{
|
||||
Texture = bloomMap;
|
||||
MinFilter = Linear;
|
||||
MagFilter = Linear;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
// pseudo gauss blur
|
||||
static const float2 offsets[12] = {
|
||||
-0.326212, -0.405805,
|
||||
-0.840144, -0.073580,
|
||||
-0.695914, 0.457137,
|
||||
-0.203345, 0.620716,
|
||||
0.962340, -0.194983,
|
||||
0.473434, -0.480026,
|
||||
0.519456, 0.767022,
|
||||
0.185461, -0.893124,
|
||||
0.507431, 0.064425,
|
||||
0.896420, 0.412458,
|
||||
-0.321940, -0.932615,
|
||||
-0.791559, -0.597705,
|
||||
};
|
||||
|
||||
float w;
|
||||
float h;
|
||||
static const float2 resolution = float2(w, h);
|
||||
|
||||
// blur setting
|
||||
static const float blurFalloff = 8;
|
||||
static const float sharpness = 4;
|
||||
|
||||
float4 AdjustSaturation(float4 color, float saturation) {
|
||||
float grey = dot(color, float3(0.3, 0.59, 0.11));
|
||||
|
||||
return lerp(grey, color, saturation);
|
||||
}
|
||||
|
||||
float Brightness(float3 color)
|
||||
{
|
||||
return color.r * color.g - 0.75 * color.b;
|
||||
}
|
||||
|
||||
float3 BlurFunction(float2 uv, float brightness, inout float totalWeight)
|
||||
{
|
||||
float3 pointColor =(tex2Dlod(s0, float4(uv, 0, 0)).rgb);
|
||||
float diff = abs(brightness - Brightness(pointColor));
|
||||
float weight = exp2(-0.25 * blurFalloff - diff * sharpness);
|
||||
totalWeight += weight;
|
||||
|
||||
return pointColor * weight;
|
||||
}
|
||||
|
||||
float4 BlurPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
|
||||
{
|
||||
float3 sumColor = (tex2D(s0, uv).rgb);
|
||||
float totalWeight = 1;
|
||||
float brightness = Brightness(sumColor);
|
||||
delta *= (1 / resolution);
|
||||
float radius = 1;
|
||||
|
||||
float2 pointUV = uv + delta * radius;
|
||||
sumColor += BlurFunction(pointUV, brightness, totalWeight);
|
||||
pointUV = uv - delta * radius;
|
||||
sumColor += BlurFunction(pointUV, brightness, totalWeight);
|
||||
|
||||
return float4((sumColor / totalWeight),1);
|
||||
// return AdjustSaturation(Color, 0.5);
|
||||
}
|
||||
|
||||
float4 BloomT(float2 texCoord : TEXCOORD0) : COLOR0 {
|
||||
float4 c = tex2D(s0, texCoord);
|
||||
float BloomThreshold = 0.2;
|
||||
|
||||
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
|
||||
}
|
||||
|
||||
float4 Bloom(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 {
|
||||
float BaseIntensity = 1.0;
|
||||
float BaseSaturation = 1;
|
||||
float BloomIntensity = 1; // 0.4
|
||||
float BloomSaturation = 0.5;
|
||||
float BlurPower = 0.01;
|
||||
float BloomThreshold = 0.5;
|
||||
|
||||
float4 original = tex2D(s0, texCoord);
|
||||
|
||||
// blur
|
||||
float4 sum = tex2D(s0, texCoord);
|
||||
for(int i = 0; i < 12; i++){
|
||||
sum += tex2D(s0, texCoord + BlurPower * offsets[i]);
|
||||
}
|
||||
sum /= 13;
|
||||
|
||||
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
|
||||
sum = AdjustSaturation(sum, BloomSaturation) * BloomIntensity;
|
||||
|
||||
sum = saturate((sum - BloomThreshold) / (1 - BloomThreshold));
|
||||
|
||||
return sum + original;
|
||||
// return sum;
|
||||
}
|
||||
|
||||
technique Blur
|
||||
{
|
||||
// pass P2 { PixelShader = compile ps_2_0 BloomT(); }
|
||||
// pass P3 { PixelShader = compile ps_2_0 Bloom(); }
|
||||
Pass P0 { PixelShader = compile ps_3_0 BlurPS(float2(1, 0)); }
|
||||
Pass P1 { PixelShader = compile ps_3_0 BlurPS(float2(0, 1)); }
|
||||
}
|
||||
Binary file not shown.
@@ -45,6 +45,7 @@ procedure start begin
|
||||
tap_key(DIK_A);
|
||||
tap_key(DIK_CAPITAL);
|
||||
end else if (mode bwand BARTER) then begin
|
||||
play_sfx("IB2P1XX1");
|
||||
tap_key(DIK_M);
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -15,9 +15,13 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor)
|
||||
#define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor)
|
||||
#define IS_WEAPON(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_weapon)
|
||||
|
||||
#define FID_OBJ_CRITTER (0x01000000)
|
||||
|
||||
procedure update_armor_apperance;
|
||||
|
||||
variable
|
||||
modIni := "npcarmor.ini",
|
||||
defaultFids,
|
||||
@@ -26,44 +30,55 @@ variable
|
||||
altWeapon,
|
||||
unWieldWeapon;
|
||||
|
||||
procedure check_armor_change(variable critter, variable item, variable isWorn) begin
|
||||
/*
|
||||
Returns the FID value set in the config settings for party member armor: Jacket, Leather, etc.
|
||||
*/
|
||||
procedure check_armor_change(variable critter, variable armor, variable isWield) begin
|
||||
variable npc, armorType, fid;
|
||||
if (npcMap[obj_pid(critter)]) then begin
|
||||
npc := npcMap[obj_pid(critter)];
|
||||
if (not isWorn) then begin
|
||||
npc := npcMap[obj_pid(critter)];
|
||||
if (npc) then begin
|
||||
if (isWield == false) then begin
|
||||
// display_msg("No armor fid: " + npc["Default"]);
|
||||
return npc["Default"];
|
||||
end else if (item) then begin
|
||||
armorType := armorPidMap[obj_pid(item)];
|
||||
end else if (armor) then begin
|
||||
armorType := armorPidMap[obj_pid(armor)];
|
||||
fid := npc[armorType] or defaultFids[armorType];
|
||||
if (fid == 0 or fid == -1) then fid := npc["Default"];
|
||||
// display_msg("Change fid: " + fid + ", npc: " + npc[armorType] + ", default:" + defaultFids[armorType]);
|
||||
return fid;
|
||||
end
|
||||
end
|
||||
return -1;
|
||||
return -1; // engine default
|
||||
end
|
||||
|
||||
procedure check_weapon_change(variable critter, variable item, variable isWield) begin
|
||||
/*
|
||||
Checks if a party member can use the offered weapon
|
||||
*/
|
||||
procedure check_weapon_change(variable critter, variable weapon, variable isWield) begin
|
||||
variable npc, newWeaponAnim, weaponAnimList, i;
|
||||
if (npcMap[obj_pid(critter)]) then begin
|
||||
npc := npcMap[obj_pid(critter)];
|
||||
if isWield then begin
|
||||
newWeaponAnim := get_proto_data(obj_pid(item), PROTO_WP_ANIM);
|
||||
weaponAnimList := string_split(npc["WeaponAnims"], ",");
|
||||
npc := npcMap[obj_pid(critter)];
|
||||
if (npc) then begin
|
||||
if (isWield) then begin
|
||||
newWeaponAnim := get_proto_data(obj_pid(weapon), PROTO_WP_ANIM);
|
||||
if newWeaponAnim then begin // anim code 0 - none/unarmed
|
||||
foreach (i in weaponAnimList) begin
|
||||
if (newWeaponAnim == atoi(i)) then return -1;
|
||||
weaponAnimList := npc["WeaponAnims"];
|
||||
if (weaponAnimList != 0) then begin
|
||||
foreach (i in string_split(weaponAnimList, ",")) begin
|
||||
if (newWeaponAnim == atoi(i)) then return -1; // can use (engine default)
|
||||
end
|
||||
end
|
||||
return 0;
|
||||
return 0; // can't use
|
||||
end
|
||||
end else begin
|
||||
unWieldWeapon := obj_pid(item);
|
||||
unWieldWeapon := obj_pid(weapon);
|
||||
end
|
||||
end
|
||||
return -1;
|
||||
return -1; // engine default
|
||||
end
|
||||
|
||||
/*
|
||||
Finds the first weapon which can be used by the party member in the inventory
|
||||
*/
|
||||
procedure search_alt_weapon(variable critter) begin
|
||||
variable obj, res, i := 0;
|
||||
obj := inven_ptr(critter, 0);
|
||||
@@ -87,48 +102,47 @@ end
|
||||
|
||||
// for NPCs when they change armor/weapon themselves
|
||||
procedure invenwield_handler begin
|
||||
variable critter, item, fid, slot, isWorn, canWield;
|
||||
variable critter, item, fid, slot, isWield, canWield;
|
||||
critter := get_sfall_arg;
|
||||
item := get_sfall_arg;
|
||||
slot := get_sfall_arg;
|
||||
isWorn := get_sfall_arg;
|
||||
item := get_sfall_arg;
|
||||
slot := get_sfall_arg;
|
||||
isWield := get_sfall_arg;
|
||||
|
||||
if (critter and item and slot == INVEN_TYPE_WORN) then begin
|
||||
fid := check_armor_change(critter, item, isWorn);
|
||||
if (/*critter and*/ item and slot == INVEN_TYPE_WORN) then begin
|
||||
fid := check_armor_change(critter, item, isWield);
|
||||
if (fid != -1) then begin
|
||||
if art_exists(fid) then begin
|
||||
art_change_fid_num(critter, fid);
|
||||
end else begin
|
||||
debug_msg("Error: NPC Armor mod: missing FID.");
|
||||
debug_msg("[Error] NPC armor mod: Invenwield missing FID: " + fid);
|
||||
end
|
||||
end
|
||||
return;
|
||||
end
|
||||
|
||||
if (critter and item and slot == INVEN_TYPE_RIGHT_HAND) then begin
|
||||
end else if (/*critter and*/ item and slot == INVEN_TYPE_RIGHT_HAND) then begin
|
||||
if (altWeapon == item) then return;
|
||||
canWield := check_weapon_change(critter, item, isWorn);
|
||||
canWield := check_weapon_change(critter, item, isWield);
|
||||
set_sfall_return(canWield);
|
||||
if (canWield != -1) then begin
|
||||
call search_alt_weapon(critter);
|
||||
call search_alt_weapon(critter); // wield weapon by script
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
// when changing armor from inventory while controlling other NPCs
|
||||
procedure adjustfid_handler begin
|
||||
variable fid, armor;
|
||||
variable fid, armor, weapAnim, currFid, newFid;
|
||||
if (dude_obj != real_dude_obj) then begin
|
||||
currFid := get_sfall_arg;
|
||||
if ((currFid bwand 0x0F000000) != FID_OBJ_CRITTER) then return;
|
||||
armor := critter_inven_obj(dude_obj, INVEN_TYPE_WORN);
|
||||
fid := check_armor_change(dude_obj, armor, armor != 0);
|
||||
if (fid != -1) then begin
|
||||
variable weapAnim := get_sfall_arg bwand 0xF000;
|
||||
variable newFid := fid bwand 0xFFFF0FFF bwor weapAnim;
|
||||
weapAnim := currFid bwand 0xF000;
|
||||
newFid := fid bwand 0xFFFF0FFF bwor weapAnim;
|
||||
if art_exists(newFid) then begin
|
||||
set_sfall_arg(0, newFid);
|
||||
set_sfall_return(newFid);
|
||||
end else begin
|
||||
debug_msg("Error: NPC Armor mod: missing FID.");
|
||||
debug_msg("[Error] NPC armor mod: Adjust FID missing: " + newFid);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -140,29 +154,18 @@ procedure inventorymove_handler begin
|
||||
slot := get_sfall_arg;
|
||||
item := get_sfall_arg;
|
||||
if (dude_obj != real_dude_obj) then begin
|
||||
if (IS_WEAPON(item) and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin
|
||||
if ((slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND) and IS_WEAPON(item)) then begin
|
||||
canWield := check_weapon_change(dude_obj, item, item != 0);
|
||||
set_sfall_return(canWield);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
procedure start begin
|
||||
variable sect, sects, armorTypes, armorType, npc, pid, pids, i;
|
||||
if game_loaded and (sfall_ver_major >= 4) then begin
|
||||
register_hook_proc(HOOK_INVENWIELD, invenwield_handler);
|
||||
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
|
||||
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
|
||||
|
||||
defaultFids := get_ini_section(modIni, "Default");
|
||||
fix_array(defaultFids);
|
||||
foreach (armorType: i in defaultFids) begin
|
||||
defaultFids[armorType] := atoi(i);
|
||||
end
|
||||
|
||||
armorPidMap := create_array_map;
|
||||
armorTypes := get_ini_section(modIni, "ArmorTypes");
|
||||
armorPidMap := create_array_map;
|
||||
foreach (armorType: pids in armorTypes) begin
|
||||
pids := string_split(pids, ",");
|
||||
foreach (pid in pids) begin
|
||||
@@ -170,6 +173,12 @@ procedure start begin
|
||||
end
|
||||
end
|
||||
|
||||
defaultFids := get_ini_section(modIni, "Default");
|
||||
fix_array(defaultFids);
|
||||
foreach (armorType: i in defaultFids) begin
|
||||
defaultFids[armorType] := atoi(i);
|
||||
end
|
||||
|
||||
npcMap := create_array_map;
|
||||
|
||||
i := 1;
|
||||
@@ -188,7 +197,26 @@ procedure start begin
|
||||
i += 1;
|
||||
sect := get_ini_section(modIni, ""+i);
|
||||
end
|
||||
end
|
||||
|
||||
call update_armor_apperance;
|
||||
|
||||
register_hook_proc(HOOK_INVENWIELD, invenwield_handler);
|
||||
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
|
||||
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
|
||||
|
||||
debug_msg("NPC armor appearance mod: Done.");
|
||||
end
|
||||
end
|
||||
|
||||
procedure update_armor_apperance begin
|
||||
variable npc, arItem, fid;
|
||||
foreach (npc in party_member_list_critters) begin
|
||||
if (npc == dude_obj) then continue;
|
||||
arItem := critter_inven_obj(npc, INVEN_TYPE_WORN);
|
||||
if (arItem) then begin
|
||||
fid := check_armor_change(npc, arItem, true);
|
||||
if (fid == -1 or art_exists(fid) == false) then continue;
|
||||
art_change_fid_num(npc, fid);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
@@ -38,7 +38,7 @@ procedure combatturn_handler begin
|
||||
critter := get_sfall_arg,
|
||||
pid, perkID, level;
|
||||
|
||||
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + get_sfall_arg);
|
||||
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + "/" + critter + ", arg3: " + get_sfall_arg);
|
||||
if npcControl then begin
|
||||
if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity
|
||||
obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC
|
||||
@@ -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);
|
||||
@@ -68,6 +66,8 @@ procedure combatturn_handler begin
|
||||
npcControl := 0; // dude control
|
||||
end
|
||||
if inControl then begin
|
||||
// check preference setting _combat_highlight
|
||||
if (read_byte(0x56D38C)) then set_outline(critter, OUTLINE_GREY);
|
||||
// center the screen on the controlled critter/dude and remove roof tiles
|
||||
move_to(dude_obj, dude_tile, dude_elevation);
|
||||
if (displayName and critter != real_dude_obj) then begin
|
||||
@@ -77,6 +77,13 @@ procedure combatturn_handler begin
|
||||
end
|
||||
end
|
||||
end else if inControl then begin
|
||||
// remove perks before switching control (only work with 4.1.8+)
|
||||
if (dude_obj != real_dude_obj) then begin
|
||||
foreach (perkID in perksList) begin
|
||||
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
|
||||
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
end
|
||||
if isShowTag then begin
|
||||
hide_iface_tag(displayName);
|
||||
isShowTag := false;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#include "..\scripting\headers\sfall.h"
|
||||
#include "..\scripting\headers\define_lite.h"
|
||||
#include "..\scripting\headers\define_extra.h"
|
||||
|
||||
#include "..\scripting\headers\dik.h"
|
||||
/*
|
||||
#include "..\scripting\headers\lib.arrays.h"
|
||||
#include "..\scripting\headers\lib.strings.h"
|
||||
// #include "..\scripting\headers\lib.inven.h"
|
||||
#include "..\scripting\headers\lib.inven.h"
|
||||
*/
|
||||
|
||||
variable ini := "sfall-mods.ini";
|
||||
variable translationIni;
|
||||
@@ -69,3 +73,5 @@ end
|
||||
procedure InitConfigs begin
|
||||
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
|
||||
end
|
||||
|
||||
#endif
|
||||
|
||||
@@ -212,9 +212,11 @@ use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfa
|
||||
- always returns 0
|
||||
|
||||
> void save_array(mixed key, int arrayID):
|
||||
- makes the array saveable; it will be saved in sfallgv.sav file when saving the game
|
||||
- arrayID is associated with given "key"
|
||||
- array becomes permanent (if it was temporary) and "saved"
|
||||
- key can be of any type (int, float or string)
|
||||
- if you specify 0 as the key for the array ID, it will make the array "unsaved"
|
||||
|
||||
> int load_array(mixed key):
|
||||
- load array from savegame data by the same key provided in "save_array"
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
The executation speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there's the potential for problems again, since sfall's global script system means that you can have a large amount of scripts being run every single frame.
|
||||
|
||||
======================
|
||||
=== sslc -O option ===
|
||||
======================
|
||||
|
||||
The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn't a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It's primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.
|
||||
|
||||
There are several levels of optimization available:
|
||||
-O1 - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched.
|
||||
-O2 - Full, most code optimizations are on, but only those that were tested on complex scripts.
|
||||
-O3 - Experimental, provides most efficiency, but tend to break some complex code due to bugs.
|
||||
|
||||
The following optimizations are performed:
|
||||
|
||||
> constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result.
|
||||
|
||||
a:=2+2; -> a:=4;
|
||||
|
||||
> constant variable initialization: All variables are initialised to some value, ('0', if you don't specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression.
|
||||
|
||||
variable a; -> variable a:=4;
|
||||
a:=4; ->
|
||||
|
||||
> constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevent references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script.
|
||||
|
||||
a:=4 -> a:=4
|
||||
foo(a); -> foo(4);
|
||||
|
||||
> dead code removal: Checks for and removes code which cannot be reached, either because it is hidden behind a return or because the argument to an if statement can be computed at compile time.
|
||||
|
||||
if 1 then begin -> display_msg("foo");
|
||||
display_msg("foo"); ->
|
||||
end else begin ->
|
||||
display_msg("bar"); ->
|
||||
end ->
|
||||
|
||||
> unreferenced variable elimination: Checks for variables which are never referenced, and removes them. Also applies to global variables, as long as they are not marked for export.
|
||||
|
||||
variable i, j, k; -> variable i;
|
||||
i:=1; -> i:=1;
|
||||
return; -> return;
|
||||
|
||||
> unreferenced procedure elimination: Checks for any procedures which are never called, and removes them.
|
||||
|
||||
procedure foo begin return "foo"; end -> procedure foo begin return "foo"; end
|
||||
procedure bar begin return "bar"; end -> procedure start begin
|
||||
procedure start begin -> display_msg(foo);
|
||||
display_msg(foo); -> end
|
||||
end ->
|
||||
|
||||
> dead store removal: Removes variable assignments if the result of the variable is unused, and if the expression used to compute the value of the variable is provably free of side effects. (See 'pure' keyword)
|
||||
|
||||
a:="moo"; -> a:="foo";
|
||||
a:="foo"; -> display_msg(a);
|
||||
display_msg(a); ->
|
||||
a:="bar"; ->
|
||||
|
||||
> store combination: Where there are two stores in a row to the same variable, the two expressions are combined.
|
||||
|
||||
var1 := var2; -> var1 := var2 + var3;
|
||||
var1 += var3; ->
|
||||
|
||||
> variable combination: Where usage regions of variables do not overlap, combine the variables to provide additional candidates for unreferenced variable elimination. Very useful for scripts containing multiple foreach loops, which generate 2 or 3 hidden variables each.
|
||||
|
||||
a:="foo"; -> a:="foo";
|
||||
display_msg(a); -> display_msg(a);
|
||||
b:="bar"; -> a:="bar";
|
||||
display_msg(b); -> display_msg(a);
|
||||
|
||||
> namelist compression: Fallout stores the names of all file scope variables and procedures in a namelist which is saved into the .int. Any of these that are unreferenced can be removed, and the names of global variables can be modified to make them shorter.
|
||||
|
||||
=============================
|
||||
=== writing your own code ===
|
||||
=============================
|
||||
|
||||
Don't have global scripts running any more often that you need them to. Not everything needs to be run every single frame.
|
||||
|
||||
Never concat constant strings with the '+' operator, as it forces the operation to be done at runtime. The compiler can cope with constant strings being placed next to each other without the need for a +, which results in far more efficient code as the combination is done at lex time.
|
||||
|
||||
#define GLOB_PREFIX "ts__" -> #define GLOB_PREFIX "ts__"
|
||||
|
||||
procedure start begin -> procedure start begin
|
||||
set_sfall_global(GLOB_PREFIX + "foo1", 0); -> set_sfall_global(GLOB_PREFIX "foo1", 0);
|
||||
end -> end
|
||||
|
||||
|
||||
Avoid function calls in while loops. function calls are expensive in comparison to variable lookups, so it's more efficient to move the function call out of the loop and store the result in a variable
|
||||
|
||||
while i < len_array(array) do begin -> tmp:= len_array(array);
|
||||
... -> while i < tmp do begin
|
||||
end -> ...
|
||||
-> end
|
||||
|
||||
Mark functions with pure or inline where relevent.
|
||||
|
||||
'pure' is a hint to the optimizer that a procedure has no side effects. (i.e. there's no way to tell that it's been called aside from its return value.) Pure procedures cannot modify global variables, or call any other procedure that isn't itself pure. Functions marked with pure can only be used in expressions (i.e. you cannot use the 'call <procedure>' syntax to call them.) If there are non-pure terms in an expression, it prevents that expression being considered for dead store removal. Where no such optimizations can be performed, or if optimization is disabled, marking a procedure with pure will have no effect on the compiled code.
|
||||
|
||||
'inline' is an instruction to the compiler to replace calls to the marked procedure with a copy of the procedures code instead of having a seperate call. inlined procedures cannot use the 'return' command, cannot be predefined, and cannot be used as part of an expression. inlining if a procedure is only going to be called once is always a win, but if there are multiple calls to a procedure you will end up bloating the size of the generated code.
|
||||
@@ -0,0 +1,405 @@
|
||||
This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional scripting functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer.
|
||||
|
||||
Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive.
|
||||
|
||||
If you use fallout script editor, you can extract compile.exe and dos4gw.exe to its \binary folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn't seem to be able to tell when errors occur when using this compiler though, so I'd recommend either using sfall's script editor instead or compiling by hand if possible.
|
||||
|
||||
When compiling global or hook scripts for sfall 3.4 or below, you _must_ include the line 'procedure start;' before any #includes that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5)
|
||||
|
||||
This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don't use any of the arrays syntax and any sfall scripting functions.
|
||||
|
||||
The original unmodified sslc source is over here:
|
||||
http://www.teamx.ru/eng/files/srcs/index.shtml
|
||||
|
||||
============================
|
||||
=== command line options ===
|
||||
============================
|
||||
|
||||
-q don't wait for input on error
|
||||
-n no warnings
|
||||
-b backward compatibility mode
|
||||
-l no logo
|
||||
-p preprocess source
|
||||
-O optimize code (full, see optimization.txt)
|
||||
-O<N> set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental)
|
||||
-d print debug messages
|
||||
-D output an abstract syntax tree of the program
|
||||
-o set output path (follows the input file name)
|
||||
-s enable short-circuit evaluation for all AND, OR operators
|
||||
-m<macro[=val]> define a macro named "macro" for conditional compilation
|
||||
-I<path> specify an additional directory to search for include files
|
||||
|
||||
The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default
|
||||
|
||||
===================================
|
||||
=== Additional supported syntax ===
|
||||
===================================
|
||||
|
||||
Syntax which requires sfall for compiled scripts to be interpreted, is marked by asterix (*).
|
||||
|
||||
> Optional arguments in user-defined procedures. You can only use constants for default values. It basically puts those constants in place of omitted arguments.
|
||||
|
||||
new:
|
||||
procedure test(variable x, variable y := 0, variable z := -1) begin
|
||||
...
|
||||
end
|
||||
...
|
||||
call test("value");
|
||||
|
||||
old:
|
||||
procedure test(variable x, variable y, variable z) begin
|
||||
...
|
||||
end
|
||||
...
|
||||
call test("value", 0, -1);
|
||||
|
||||
|
||||
> New logical operators "AndAlso", "OrElse" for short-circuit evaluation of logical expressions.
|
||||
Using these operators allow the right part of logical expressions not to be evaluated (executed, computed) if the result is already known. This can improve the performance of running scripts.
|
||||
|
||||
Example:
|
||||
if (obj andAlso obj_pid(obj) == PID_STIMPAK) then ...
|
||||
|
||||
if obj is null, the second condition will not be checked and your script won't fail with "obj is null" error in debug.log
|
||||
|
||||
This also has an effect that a value of last computed argument is returned as a result of whole expressions, instead of always 0 (false) or 1 (true):
|
||||
obj := false;
|
||||
display_msg(obj orElse "something"); // will print "something"
|
||||
|
||||
You can also use the -s option to enable short-circuit evaluation for all the AND, OR operators in the script.
|
||||
NOTE: Be aware that it may break some old scripts because operators behavior is changed slightly.
|
||||
|
||||
|
||||
> Conditional expressions (Python-inspired), also known as ternary operator:
|
||||
|
||||
new:
|
||||
X := value1 if condition else value2
|
||||
|
||||
old:
|
||||
if (condition) then
|
||||
X := value1;
|
||||
else
|
||||
X := value2;
|
||||
|
||||
|
||||
> To assign values, you can use the alternative assignment operator from C/Java instead of Pascal syntax.
|
||||
|
||||
new:
|
||||
x = 5;
|
||||
old:
|
||||
x := 5;
|
||||
|
||||
|
||||
> Multiple variable decleration: Multiple variables can be declared on one line, seperated by commas. This is an alterative to the ugly begin/end block, or the bulky single variable per line style.
|
||||
|
||||
new:
|
||||
variable a, b, c;
|
||||
old:
|
||||
variable begin a; b; c; end
|
||||
|
||||
|
||||
> Variable initialization with expressions: You can now initialize local variables with complex expressions instead of constants.
|
||||
|
||||
new:
|
||||
variable tile := tile_num(dude_obj);
|
||||
|
||||
old:
|
||||
variable tile;
|
||||
tile := tile_num(dude_obj);
|
||||
|
||||
NOTE: if your expression starts with a constant (eg. 2+2), enclose it in parentheses, otherwise compiler will be confused and give you errors.
|
||||
|
||||
|
||||
> Hexadecimal numerical constants: Simply prefix a number with 0x to create a hexadecimal. The numbers 0 to 9 and a-f are allowed in the number. The number may not have a decimal point.
|
||||
|
||||
new:
|
||||
a := 0x1000;
|
||||
old:
|
||||
a := 4096;
|
||||
|
||||
|
||||
> increment/decrement operators: ++ and -- can be used as shorthand for +=1 and -=1 respectively. They are mearly a syntactic shorthand to improve readability, and so their use is only allowed where +=1 would normally be allowed.
|
||||
|
||||
new:
|
||||
a++;
|
||||
old:
|
||||
a += 1;
|
||||
|
||||
|
||||
> "break" & "continue" statements: they work just like in most high-level languages. "break" jumps out of the loop. "continue" jumps right to the beginning of the next iteration (see "for" and "foreach" sections for additional details).
|
||||
|
||||
new:
|
||||
while (i < N) begin
|
||||
// ...
|
||||
if (/* some condition */) then break;
|
||||
// ...
|
||||
end
|
||||
|
||||
old:
|
||||
while (i < N and not(breakFlag)) begin
|
||||
// ...
|
||||
if (/* condition */) then breakFlag := true;
|
||||
// ...
|
||||
end
|
||||
|
||||
new:
|
||||
for (i := 0; i < N; i++) begin
|
||||
// ...
|
||||
if (/* condition */) then begin
|
||||
// action
|
||||
continue;
|
||||
end
|
||||
// else actions
|
||||
end
|
||||
|
||||
old:
|
||||
for (i := 0; i < N; i++) begin
|
||||
// ...
|
||||
if (/* condition */) then begin
|
||||
// action
|
||||
end else begin
|
||||
// else actions
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
> "for" loops: Another piece of syntactic shorthand, to shorten while loops in many cases. Parentheses around the loop statements are recommended but not required (when not using parentheses, a semicolon is required after the 3rd loop statement).
|
||||
new:
|
||||
for (i := 0; i < 5; i++) begin
|
||||
display_msg("i = "+i);
|
||||
end
|
||||
old
|
||||
i := 0;
|
||||
while (i < 5) do begin
|
||||
display_msg("i = "+i);
|
||||
i++;
|
||||
end
|
||||
|
||||
NOTE: "continue" statement in a "for" loop will recognize increment statement (third statement in parentheses) and will execute it before jumping back to the beginning of loop. This way you will not get an endless loop.
|
||||
|
||||
|
||||
> switch statements: A shorthand way of writing big 'if then else if...' blocks
|
||||
new:
|
||||
switch get_attack_type begin
|
||||
case ATKTYPE_PUNCH: display_msg("punch");
|
||||
case ATKTYPE_KICK: display_msg("kick");
|
||||
default: display_msg("something else");
|
||||
end
|
||||
old:
|
||||
variable tmp;
|
||||
tmp := get_attack_type;
|
||||
if tmp == ATKTYPE_PUNCH then begin
|
||||
display_msg("punch");
|
||||
end else if tmp == ATKTYPE_KICK then begin
|
||||
display_msg("kick");
|
||||
end else begin
|
||||
display_msg("something else");
|
||||
end
|
||||
|
||||
|
||||
> empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
|
||||
|
||||
#define my_macro diplay_msg("foo");
|
||||
|
||||
procedure start begin
|
||||
my_macro;
|
||||
end
|
||||
|
||||
|
||||
> Procedure stringify operator "@": designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceeded by "@" by a string constant.
|
||||
Not many people know that since vanilla Fallout you can call procedures by "calling a variable" containing it's name as a string value. There was a couple of problems using this:
|
||||
- optimizer wasn't aware that you are referencing a procedure, and could remove it, if you don't call it explicitly (can be solved by adding making procedure "critical")
|
||||
- you couldn't see all references of a procedure from a Script Editor
|
||||
- it was completely not obvious that you could do such a thing, it was a confusing syntax
|
||||
|
||||
old:
|
||||
callbackVar := "Node000";
|
||||
callbackVar();
|
||||
|
||||
new:
|
||||
callbackVar := @Node000;
|
||||
callbackVar();
|
||||
|
||||
|
||||
|
||||
> *arrays: In vanilla fallout arrays had to be constructed by reserving a block of global/map variables. Since sfall 2.7, specific array targeted functions have been available, but they are fairly messy and long winded to use. The compiler provides additional syntactic shorthand for accessing and setting array variables, as well as for array creation. When declaring an array variable, put a constant integer in []'s to give the number of elements in the array. (before sfall 3.4 you had to specify size in bytes for array elements, now it's not required, see "arrays.txt" for more information)
|
||||
|
||||
new:
|
||||
procedure bingle begin
|
||||
variable a[2];
|
||||
a[0] := 5;
|
||||
a[a[0] - 4] := a[0] + 4;
|
||||
display_msg("a[0]=" + a[0] + ", a[1]=" + a[1]);
|
||||
end
|
||||
old:
|
||||
procedure bingle begin
|
||||
variable a;
|
||||
a := temp_array(2, 4);
|
||||
set_array(a, 0, 5);
|
||||
set_array(a, get_array(a, 0) - 4, get_array(a, 0) + 4);
|
||||
display_msg("a[0]=" + get_array(a, 0) + ", a[1]=" + get_array(a, 1));
|
||||
end
|
||||
|
||||
|
||||
> *array expressions: sometimes you need to construct an array of elements and you will probably want to do it in just one expression. This is now possible:
|
||||
new:
|
||||
list := ["A", "B", "C", "D"];
|
||||
|
||||
old:
|
||||
list := temp_array(4, 2);
|
||||
list[0] := "A";
|
||||
list[1] := "B";
|
||||
list[2] := "C";
|
||||
list[3] := "D";
|
||||
|
||||
|
||||
Syntax specific for associative arrays is also available. (see "arrays.txt" for full introduction to this type of arrays).
|
||||
|
||||
> *map array expressions:
|
||||
|
||||
map := {5: "five", 10: "ten", 15: "fifteen", 20: "twelve"};
|
||||
|
||||
|
||||
> * "dot" syntax to access elements of associative arrays. "dot" syntax allows to work with arrays like objects:
|
||||
trap.radius := 3;
|
||||
trap.tile := tile_num(dude_obj);
|
||||
|
||||
you can chain dot and bracket syntax to access elements of multi-dimensional arrays:
|
||||
collectionList[5].objectList[5].name += " foo";
|
||||
|
||||
NOTE: when using incremental operators like +=, *=, ++, -- compiler will use additional temp variable to get an array at penultimate level in order to avoid making the same chain of "get_array" calls twice.
|
||||
|
||||
|
||||
> * "foreach" loops: A shorthand method of looping over all elements in an array. Syntax is 'foreach (<symbol> in <expression>) '
|
||||
new:
|
||||
procedure bingle begin
|
||||
variable critter;
|
||||
foreach (critter in list_as_array(LIST_CRITTERS)) begin
|
||||
display_msg(""+critter);
|
||||
end
|
||||
end
|
||||
old:
|
||||
procedure bingle begin
|
||||
variable begin critter; array; len; count; end
|
||||
array := list_as_array(LIST_CRITTERS);
|
||||
len := len_array(array);
|
||||
count := 0;
|
||||
while count < len do begin
|
||||
critter := array[count];
|
||||
display_msg("" + critter);
|
||||
end
|
||||
end
|
||||
|
||||
If you want an index array element (or key for "maps") at each iteration, use syntax: 'foreach (<symbol>: <symbol> in <expression>) '
|
||||
foreach (pid: price in itemPriceMap) begin
|
||||
if (itemPid == pid) then
|
||||
itemPrice := price;
|
||||
end
|
||||
|
||||
If you want to add additional condition for continuing the loop, use syntax: 'foreach (<symbol> in <expression> while <expression>) '. In this case loop will iterate over elements of an array until last element or until "while" expression is true (whatever comes first).
|
||||
|
||||
NOTE: just like "for" loop, "continue" statement will respect increments of a hidden counter variable, so you can safely use it inside "foreach".
|
||||
|
||||
|
||||
|
||||
|
||||
====================
|
||||
=== int2ssl note ===
|
||||
====================
|
||||
|
||||
int2ssl by Anchorite (TeamX) is included in sfall modderspack package. It was updated to support all additional opcodes of sfall, along with some syntax features. You can use it to decompile any sfall or non-sfall script.
|
||||
|
||||
=============
|
||||
=== Fixes ===
|
||||
=============
|
||||
|
||||
playmoviealpharect was using the token for playmoviealpha, breaking both functions in the process.
|
||||
|
||||
addbuttonflag had an entry in the token table, and could be parsed, but was missing an entry in the emit list. This resulted in the compiler accepting it as a valid function, but not outputting any code for it into the compiled script.
|
||||
|
||||
The function tokenize was missing an entry in the token table, and so would not be recognised by the compiler.
|
||||
|
||||
fixed the check for the 'call "foo"' syntax so that non-string constants will no longer be accepted.
|
||||
|
||||
==============================
|
||||
=== Backward compatibility ===
|
||||
==============================
|
||||
|
||||
There are several changes in this version of sslc which may result in problems for previously working scripts. A new command line option '-b' is available, which will turn off all new fixes and features which have the possibility of causing a previously compiling script to change its behaviour. (And only those features; anything which would not compile under the old sslc is not affected.) This includes the following:
|
||||
|
||||
- Since 'for', 'foreach', 'break', 'continue', 'in' and 'tokenize' are now hardcoded names, existing scripts that use any of them as a variable or procedure name will no longer compile.
|
||||
|
||||
- Missing a semicolon after a variable declaration is now a hard error. (Originally sslc would check for the semicolon, but would not complain if it was missing.)
|
||||
|
||||
- The function addbuttonflag used to be recognised by the compiler, but would not emit any code into the int file.
|
||||
|
||||
- The function playmoviealpharect compiled as playmoviealpha
|
||||
|
||||
|
||||
=================
|
||||
=== Changelog ===
|
||||
=================
|
||||
|
||||
> sfall 4.2.3
|
||||
- fixed compiler giving "assignment operator expected" error when a variable-like macro is not being defined properly
|
||||
- added new logical operators "AndAlso", "OrElse" for short-circuit evaluation of logical expressions
|
||||
- added an alternative (C/Java-style) assignment operator "="
|
||||
- added support for new "div" operator (unsigned integer division)
|
||||
|
||||
> sfall 4.2.2
|
||||
- added support for new opcode "reg_anim_callback"
|
||||
|
||||
> sfall 4.2.1
|
||||
- the basic optimization is now enabled by default when not specifying any optimization options
|
||||
- added -m<macro[=val]> option to define a macro named "macro" for conditional compilation
|
||||
- added -I<path> option to specify an additional directory to search for include files
|
||||
- unreferenced "critical" procedures and procedures with the names "Node998" and "Node999" are now removed by the optimizer
|
||||
|
||||
> sfall 4.2
|
||||
- now it is possible to run preprocess or optimization passes in backward compatibility mode
|
||||
- added support for new opcode "register_hook_proc_spec"
|
||||
|
||||
> sfall 4.0:
|
||||
- enabled code for "ceil" math function
|
||||
- fixed missing argument for "how_much" function
|
||||
- added "desc_p_proc" (from Fallout 1) to protected procedures that should not be removed by the optimizer
|
||||
- fixed compiler giving "division by zero" error when using zero as the second factor in multiplication
|
||||
|
||||
> sfall 3.8
|
||||
- added support for new universal opcodes sfall_funcX
|
||||
|
||||
> sfall 3.6:
|
||||
- added Python-style ternary operator (conditional expression)
|
||||
- added -s short-circuit evalution option for AND, OR expressions
|
||||
- int2ssl will detect and decompile conditional expressions and short-circuit logical operators
|
||||
- added -F option to include full file paths in "#line" directives after preprocessing
|
||||
- added -D option to write abstract syntax tree into .txt file
|
||||
- fixed compiler crash when number of arguments in procedure declaration does not match definition
|
||||
- fixed incorrect constant folding of "bwnot" operator
|
||||
- fixed more invalid results in constant folding
|
||||
- implemented optional arguments for user-defined procedures
|
||||
- implemented stringify procedure names using @ operator, which is helpful to pass procedures around to call them from variables (it will properly handle references)
|
||||
- logic for procedures passed as arguments to scripting functions was moved from code generation to parsing stage
|
||||
- now it is possible to call user-defined procedures inside argument list of scripting functions, without compiler attempting to treat them as procedure references and probably fail (procedures will still be passed, but only to appropriate scripting functions at appropriate argument positions)
|
||||
- int2ssl will now place empty parantheses after a call to user-defined procedure - this will distinct calls from passing procedures to some scripting functions (like giq_option)
|
||||
- fixed inline procedure "calls" not working when optimization is enabled
|
||||
- added column numbers to error/warning output
|
||||
- added code to simplify adding sfall opcodes into compiler (need to add code in 3 places, instead of 7 places for each opcode)
|
||||
- fixed bug when initializing variable with expression starting from a symbol
|
||||
- added division by zero constant check
|
||||
|
||||
> sfall 3.5:
|
||||
- completed namespace compression optimization with respect to imported/exported variables
|
||||
- changed 'for' and 'foreach' syntax to allow parentheses which are easier to read IMHO
|
||||
- heavy code refactoring - split "parse.c" into several files, replaced all dirty workaround code in "lex()" (some syntax features) with parser-level equivalents
|
||||
- added syntax to reference elements in multi-dimensional arrays (unlimited sequence of brackets [] and dots . )
|
||||
- added fully featured "break" and "continue" statements for loops
|
||||
- moved some optimizations (namely constant propagation and variable reuse) to "experimental" because they were breaking my scripts
|
||||
- added ability to initialize variables with expressions
|
||||
|
||||
> sfall 3.4:
|
||||
- added "foreach .. while .." syntax
|
||||
- added array expressions for lists and maps
|
||||
- added "foreach (key: value in ...)" syntax for convenience
|
||||
- fixed crash bug in "for" loop parsing function
|
||||
- added ability to access array elements with string keys using OOP-like dot (".") syntax
|
||||
File diff suppressed because it is too large
Load Diff
@@ -87,19 +87,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
|
||||
@@ -120,7 +135,7 @@
|
||||
#define RMOBJ_RM_MULT_OBJS 4563866
|
||||
#define RMOBJ_REPLACE_WEAPON 4658526
|
||||
#define RMOBJ_THROW 4266040
|
||||
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from a container inside of an inventory
|
||||
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from nested containers in the inventory
|
||||
|
||||
// common prototype offsets for get/set_proto_data
|
||||
#define PROTO_PID (1)
|
||||
@@ -328,7 +343,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 +359,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)
|
||||
@@ -385,15 +399,16 @@
|
||||
#define OBJ_DATA_FID (0x20)
|
||||
#define OBJ_DATA_ELEVATION (0x28)
|
||||
#define OBJ_DATA_PID (0x64)
|
||||
#define OBJ_DATA_CID (0x68) // combat id, used for savegame
|
||||
#define OBJ_DATA_SID (0x78)
|
||||
#define OBJ_DATA_CID (0x68) // combat ID, used for savegame
|
||||
#define OBJ_DATA_SID (0x78) // script ID
|
||||
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
|
||||
// items
|
||||
#define OBJ_DATA_CUR_CHARGES (0x3C)
|
||||
#define OBJ_DATA_CUR_CHARGES (0x3C) // for key items it's the key code
|
||||
// critters
|
||||
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
||||
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
||||
#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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user