mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea921aabbd | ||
|
|
b263b69fa3 | ||
|
|
6bb56b0f95 | ||
|
|
9a4f0c7505 | ||
|
|
c89a18522d | ||
|
|
c7ccb7f2c2 | ||
|
|
b25ca683f3 | ||
|
|
e28b3a5796 | ||
|
|
a9c74501df | ||
|
|
b03b93d6fc | ||
|
|
1f696b9f12 | ||
|
|
3d2d1cdf2a | ||
|
|
42347ac062 | ||
|
|
007b415740 | ||
|
|
35d2491bcb | ||
|
|
ece76ee726 | ||
|
|
d6f4a23527 | ||
|
|
045ad2f5d7 | ||
|
|
13703f1a3b | ||
|
|
58bb77d79f | ||
|
|
229371e4ab | ||
|
|
1884e279c7 | ||
|
|
e81d79e43e | ||
|
|
f731de7a25 | ||
|
|
0d6bc33279 | ||
|
|
3377516f67 | ||
|
|
359c79a854 | ||
|
|
41652ec459 | ||
|
|
ca4e506f1d | ||
|
|
6e05ca65fd | ||
|
|
873d9f81c2 | ||
|
|
0978769dfc | ||
|
|
29608bb51c | ||
|
|
ba911375a9 | ||
|
|
ce5c65d37f | ||
|
|
ffd397d9aa | ||
|
|
349cffac0c | ||
|
|
dfdcd86134 | ||
|
|
accdeae6ad | ||
|
|
288a8fedfd | ||
|
|
eb777e6d19 | ||
|
|
dd2469b78f | ||
|
|
8d375dd81a | ||
|
|
7f087d1c30 | ||
|
|
e7e5da866a | ||
|
|
ac0b0ef7ef | ||
|
|
c2626de4fa | ||
|
|
e4d395224a | ||
|
|
4487bbfeba | ||
|
|
e5eb5cc275 | ||
|
|
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 |
@@ -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.
|
||||
|
||||
|
||||
@@ -13,18 +13,25 @@ Count=0
|
||||
[1]
|
||||
; drug item PID
|
||||
PID=0
|
||||
|
||||
; set a limit on the count of first and second delayed effects when using the drug, i.e. if the queue has delayed effects from the drug,
|
||||
; and their count is greater or equal to NumEffects, it is not possible to obtain new effects from using the drug
|
||||
; this count is 4 for Buffout/Mentats/Psycho/Jet
|
||||
; e.g. this count is 4 for Buffout/Mentats/Psycho/Jet
|
||||
; set -1 to leave this parameter unchanged
|
||||
NumEffects=-1
|
||||
|
||||
; the duration of the addiction effect in game minutes (i.e. 1440 = 24 game hours)
|
||||
; set to 0 to use the default time (7 days for all drugs except Jet)
|
||||
; set to 0 to use the default time of 7 days (as all drugs except Jet)
|
||||
AddictTime=0
|
||||
|
||||
; the number of the global variable from vault13.gam responsible for displaying addiction in the character screen
|
||||
; if you set GvarID with numbers: 21-26, 295, 296, or variable numbers that have already been declared in previous sections,
|
||||
; the TextID and FrmID options in this section will be ignored
|
||||
; set to 0 if the addiction is not required
|
||||
GvarID=0
|
||||
|
||||
; the index number from editor.msg to display the title of the addiction (the description uses the index number of TextID + 100)
|
||||
TextID=-1
|
||||
|
||||
; the line number (0-indexed) of the corresponding FRM in skilldex.lst
|
||||
FrmID=-1
|
||||
|
||||
+132
-87
@@ -1,12 +1,12 @@
|
||||
;sfall configuration settings
|
||||
;v4.2.1
|
||||
;v4.2.5
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
UseCommandLine=0
|
||||
|
||||
;Uncomment and point to a file to get alternate translations for some sfall messages
|
||||
;TranslationsINI=.\Translations.ini
|
||||
;TranslationsINI=sfall\Translations.ini
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[ExtraPatches]
|
||||
@@ -18,30 +18,12 @@ UseCommandLine=0
|
||||
;The greater numbers take precedence over lesser numbers
|
||||
;PatchFile0=mods\RP_data
|
||||
|
||||
;Path to the folder in which the game will automatically search and load custom .dat files
|
||||
;The data load order of the .dat files in the folder will be in reverse alphabetical order of the filenames
|
||||
;The .dat files specified in the PatchFileXX options will have higher priority than others
|
||||
;Path to the folder in which the game will automatically search and load custom files (by *.dat mask, including folders)
|
||||
;The data load order of the files in the folder will be in reverse alphabetical order of the filenames
|
||||
;The files placed in this folder will have higher priority than the PatchFileXX options
|
||||
;Uncomment the option to specify a different folder path. The default path is <GameRoot>\mods\
|
||||
;AutoSearchPath=mods
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Sound]
|
||||
;Sets the number of allowed simultaneous sound effects
|
||||
;Set to 0 to leave the default unchanged (i.e. 4)
|
||||
NumSoundBuffers=0
|
||||
|
||||
;Set to 1 to allow attaching sound files to combat float messages
|
||||
AllowSoundForFloats=0
|
||||
|
||||
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
|
||||
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
|
||||
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
|
||||
AllowDShowSound=0
|
||||
|
||||
;Set to 1 to override the music path used by default (i.e. data\sound\music\) if not present in the cfg
|
||||
;Set to 2 to overwrite all occurances of the music path
|
||||
OverrideMusicDir=2
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Speed]
|
||||
;Set to 0 to disable everything in this section
|
||||
@@ -70,6 +52,7 @@ AffectPlayback=0
|
||||
;Set to 0 for 8 bit fullscreen
|
||||
;Set to 4 for DX9 fullscreen
|
||||
;Set to 5 for DX9 windowed
|
||||
;Set to 6 for DX9 fullscreen windowed (the resolution in f2_res.ini should be set to the same aspect ratio as your desktop resolution)
|
||||
;A DX9 mode is required for any graphics related script extender functions to work (i.e. fullscreen shaders)
|
||||
;Modes 1, 2 and 3 are no longer supported
|
||||
Mode=0
|
||||
@@ -80,6 +63,14 @@ Mode=0
|
||||
GraphicsWidth=0
|
||||
GraphicsHeight=0
|
||||
|
||||
;Window position data. Do not modify
|
||||
;Set to 0 to reset if the window position is incorrect
|
||||
WindowData=0
|
||||
|
||||
;Uncomment the option to use a hardware shader (requires DX9 graphics mode)
|
||||
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
|
||||
;GlobalShaderFile=global.fx
|
||||
|
||||
;Set to 1 to do the palette conversion on the GPU
|
||||
;Set to 2 to do the palette conversion on the CPU
|
||||
;Set to 0 to pick automatically
|
||||
@@ -94,7 +85,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 DX9 graphics mode 4 or 5
|
||||
;Requires DX9 graphics mode
|
||||
AllowDShowMovies=0
|
||||
|
||||
;Fade effect time percentage modifier
|
||||
@@ -103,6 +94,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 +106,35 @@ FadeMultiplier=100
|
||||
;The resolution of hi-res patch must be set to at least 890x720
|
||||
ExpandWorldMap=0
|
||||
|
||||
;Set to 1 to expand the number of action points displayed on the interface bar
|
||||
;Requires new IFACE_E.frm and HR_IFACE_<res>E.frm files in art\intrface\ (included in sfall.dat) to display correctly
|
||||
;The minimum supported version of High Resolution Patch is 4.1.8
|
||||
ActionPointsBar=0
|
||||
;Set to 1 to draw a dotted line while traveling on the world map (similar to Fallout 1)
|
||||
WorldMapTravelMarkers=0
|
||||
;Uncomment these lines to change the appearance of the markers
|
||||
;The color index in Fallout default palette (valid range: 1..255; default is 134)
|
||||
;TravelMarkerColor=134
|
||||
;The length and spacing of the dots in pixels for each type of terrain in worldmap.txt
|
||||
;Syntax is 'length:spacing', with each pair separated by a comma (valid range: 1..10; default is 2)
|
||||
;TravelMarkerStyles=2:2,2:2,2:2,2:2
|
||||
|
||||
;Set to 1 to display terrain types when hovering the cursor over the player's marker on the world map
|
||||
WorldMapTerrainInfo=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Sound]
|
||||
;Sets the number of allowed simultaneous sound effects
|
||||
;Set to 0 to leave the default unchanged (i.e. 4). The maximum is 32
|
||||
NumSoundBuffers=0
|
||||
|
||||
;Set to 1 to allow attaching sound files to combat float messages
|
||||
AllowSoundForFloats=0
|
||||
|
||||
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
|
||||
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
|
||||
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
|
||||
AllowDShowSound=0
|
||||
|
||||
;Set to 1 to override the music path used by default (i.e. data\sound\music\) if not present in the cfg
|
||||
;Set to 2 to overwrite all occurances of the music path
|
||||
OverrideMusicDir=1
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Input]
|
||||
@@ -167,12 +188,12 @@ SpeedKey7=0x00
|
||||
SpeedKey8=0x00
|
||||
SpeedKey9=0x00
|
||||
|
||||
;A key to hold down to move the window around when using graphics mode 5
|
||||
;A key to hold down to move the window around when using DX9 graphics mode 5
|
||||
;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise
|
||||
;Set to -1 for either ctrl key, -2 for either alt key or -3 for either shift key
|
||||
WindowScrollKey=0
|
||||
|
||||
;A key to press to reload your currently equipped weapon
|
||||
;A key to press to reload your currently equipped weapon or use the active item
|
||||
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
|
||||
ReloadWeaponKey=0
|
||||
|
||||
@@ -194,6 +215,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 +267,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 +315,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
|
||||
@@ -337,13 +361,10 @@ SingleCore=1
|
||||
OverrideArtCacheSize=0
|
||||
|
||||
;Prevents you from saving in combat except at the start of your turn to avoid a few bugs
|
||||
;Note that even with this option enabled, it is still not advisable to save in combat at all.
|
||||
;Note that even with this option enabled, it is still not advisable to save in combat at all (obsolete information)
|
||||
;Set to 2 to block all saving in combat
|
||||
SaveInCombatFix=1
|
||||
|
||||
;Point to an ini file containing elevator data
|
||||
;ElevatorsFile=Elevators.ini
|
||||
|
||||
;Uncomment and set a comma delimited list of numbers to use a custom xp table.
|
||||
;Player's level is capped once the highest specified level is reached
|
||||
;XPTable=50,100,200
|
||||
@@ -372,8 +393,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
|
||||
@@ -391,8 +410,8 @@ CorpseDeleteTime=6
|
||||
|
||||
;Set a number of milliseconds to idle each input loop
|
||||
;Set to -1 to disable
|
||||
;Set to 0 to idle only if other processes are waiting for processor time
|
||||
;Set to 1 (or some higher number if needed, the maximum is 127) to prevent 100% CPU use
|
||||
;Set to 0 to idle only if other processes are waiting for processor time (WinXP/2000: if processes have equal priority)
|
||||
;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 127
|
||||
ProcessorIdle=-1
|
||||
|
||||
;Set to 1 if using the hero appearance mod
|
||||
@@ -435,6 +454,9 @@ Doctor=293
|
||||
Science=293
|
||||
Repair=293
|
||||
|
||||
;Set to 1 to remove window position rounding for script-created windows
|
||||
RemoveWindowRounding=1
|
||||
|
||||
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
|
||||
;Set to 2 to use a different set of scroll buttons
|
||||
UseScrollingQuestsList=1
|
||||
@@ -455,7 +477,7 @@ UseScrollingQuestsList=1
|
||||
;CityRepsList=0:47,2:48,1:49,4:50,5:51,3:52,8:53,6:54,7:55,13:56,10:57,11:59,14:61,17:63,19:64,18:65,25:66,9:294,20:308
|
||||
|
||||
;Set this to a valid path to save a copy of the console contents
|
||||
;ConsoleOutputPath="bingle.txt"
|
||||
;ConsoleOutputPath=console.txt
|
||||
|
||||
;Set to 1 to add additional pages of save slots
|
||||
ExtraSaveSlots=0
|
||||
@@ -498,9 +520,6 @@ BonusHtHDamageFix=1
|
||||
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
|
||||
DisplayBonusDamage=0
|
||||
|
||||
;Set to 1 to display the range of the second attack mode in the inventory when you switch weapon modes in active item slots
|
||||
DisplaySecondWeaponRange=1
|
||||
|
||||
;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127)
|
||||
AnimationsAtOnceLimit=120
|
||||
|
||||
@@ -522,23 +541,11 @@ FastShotFix=1
|
||||
;Set to 1 to boost the maximum number of script names from 1450 to 10000
|
||||
BoostScriptDialogLimit=0
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line to an ini file containing the replacement skill data
|
||||
;SkillsFile=Skills.ini
|
||||
|
||||
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
|
||||
;See the Stats.ini in the modders pack for an example file
|
||||
;DerivedStats=Stats.ini
|
||||
|
||||
;Allows you to change some parameters for drugs and their addictions
|
||||
;See the Drugs.ini in the modders pack for an example file
|
||||
;DrugsFile=Drugs.ini
|
||||
|
||||
;These options modify the checks to see if a critter can carry an additional item, changing which items are counted towards the weight limit and adding an additional size check
|
||||
;Set the mode to 0 to disable the size check, 1 to apply to the PC only, 2 to apply to the PC and party members, or 3 to apply to all critters
|
||||
;Only the PC uses CritterInvSizeLimit. Other critters will use the unused stat (STAT_unused = 10) or have the size limit of 100 if the stat is not set
|
||||
;Add 4 to the mode to limit the weight check to used items only
|
||||
;You can use line number 542/543 in proto.msg and line number 35 in inventry.msg to set up custom messages for item size
|
||||
;You can use message number 542/543 in proto.msg and message number 35 in inventry.msg to set up custom messages for item size
|
||||
CritterInvSizeLimitMode=0
|
||||
CritterInvSizeLimit=100
|
||||
|
||||
@@ -585,6 +592,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
|
||||
|
||||
@@ -614,17 +625,13 @@ ExplosionsEmitLight=0
|
||||
;MovieTimer_artimer3=270
|
||||
;MovieTimer_artimer4=360
|
||||
|
||||
;Set to 1 to enable the new arrays behavior
|
||||
;Set to 1 to enable the new arrays behavior (default behavior)
|
||||
;Set to 0 for backward compatibility with pre-3.4 scripts
|
||||
arraysBehavior=1
|
||||
|
||||
;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot
|
||||
CheckWeaponAmmoCost=0
|
||||
|
||||
;To add additional books to the game, uncomment the next line and point to a file containing book information
|
||||
;See the Books.ini in the modders pack for an example file
|
||||
;BooksFile=Books.ini
|
||||
|
||||
;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
|
||||
CombatPanelAnimDelay=1000
|
||||
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
|
||||
@@ -655,6 +662,13 @@ DontTurnOffSneakIfYouRun=0
|
||||
;Set to 0 to disable switching. (Default is 3)
|
||||
UseWalkDistance=3
|
||||
|
||||
;Changes the displayed message when you recover from the negative effects of radiation exposure
|
||||
;The value is the message number in misc.msg (Default is 3003: 'You feel better')
|
||||
RadEffectsRemovalMsg=3003
|
||||
|
||||
;Set to 1 to display messages about radiation for the active geiger counter
|
||||
ActiveGeigerMsgs=1
|
||||
|
||||
;Set to 1 to fix the bug of being unable to sell used geiger counters or stealth boys
|
||||
CanSellUsedGeiger=1
|
||||
|
||||
@@ -701,7 +715,7 @@ PartyMemberExtraInfo=0
|
||||
;that overrides First Aid/Doctor functions has very limited usefulness
|
||||
PartyMemberSkillFix=0
|
||||
|
||||
;Set to 1 to skip loading all game settings except the game/combat difficulty from a saved game
|
||||
;Set to 1 to skip loading all game settings except the game/combat difficulty from saved games
|
||||
;Set to 2 to also skip loading the game/combat difficulty settings
|
||||
SkipLoadingGameSettings=0
|
||||
|
||||
@@ -723,6 +737,35 @@ KnockoutTime=35
|
||||
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
|
||||
CreditsAtBottom=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
; Configuration ini files
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
;To change the path and filename of the critical table file, uncomment the next line
|
||||
;OverrideCriticalFile=sfall\CriticalOverrides.ini
|
||||
|
||||
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
|
||||
;See the Stats.ini in the modders pack for an example file
|
||||
;DerivedStats=sfall\Stats.ini
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line to an ini file containing the replacement skill data
|
||||
;SkillsFile=sfall\Skills.ini
|
||||
|
||||
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
|
||||
;PerksFile=sfall\Perks.ini
|
||||
|
||||
;To add additional books to the game, uncomment the next line and point to a file containing book information
|
||||
;See the Books.ini in the modders pack for an example file
|
||||
;BooksFile=sfall\Books.ini
|
||||
|
||||
;Allows you to change some parameters for drugs and their addictions
|
||||
;See the Drugs.ini in the modders pack for an example file
|
||||
;DrugsFile=sfall\Drugs.ini
|
||||
|
||||
;Point to an ini file containing elevator data
|
||||
;ElevatorsFile=sfall\Elevators.ini
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Scripts]
|
||||
;Comma-separated list of masked paths to load global scripts from
|
||||
@@ -730,10 +773,11 @@ CreditsAtBottom=0
|
||||
;Paths outside of scripts folder are supported
|
||||
GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
|
||||
|
||||
;Uncomment the option to specify a common folder path for all ini files used by scripts
|
||||
;You will have to put all the available ini files of the mods in this directory
|
||||
;Uncomment the option to specify an additional folder path for ini files used by scripts
|
||||
;The game will search for the ini files relative to this directory
|
||||
;If the file is not found, the search will proceed relative to the root directory of the game
|
||||
;The maximum length of the specified path is 61 characters
|
||||
;IniConfigFolder=IniConfig
|
||||
;IniConfigFolder=mods\iniConfigs
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Debugging]
|
||||
@@ -743,10 +787,27 @@ GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
|
||||
;Set to 1 to enable sfall debugging mode
|
||||
Enable=0
|
||||
|
||||
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
|
||||
;Set to 2 to also disable the memory address check in unsafe script functions
|
||||
;Does not require sfall debugging mode
|
||||
AllowUnsafeScripting=0
|
||||
|
||||
;If you're testing changes to the Fallout exe, you can override the CRC that sfall looks for here
|
||||
;You can use several hex values, separated by commas
|
||||
;Does not require sfall debugging mode
|
||||
;ExtraCRC=0x00000000,0x00000000
|
||||
|
||||
;Set to 1 to skip the executable file size check
|
||||
;Does not require sfall debugging mode
|
||||
SkipSizeCheck=0
|
||||
|
||||
;Change to 1 to skip the compatibility mode check
|
||||
SkipCompatModeCheck=0
|
||||
|
||||
;Fallout 2 Debug Patch
|
||||
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and debug.log
|
||||
;Does not require sfall debugging mode
|
||||
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
|
||||
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg
|
||||
;-------
|
||||
;[debug]
|
||||
;mode=environment
|
||||
@@ -755,34 +816,18 @@ Enable=0
|
||||
;show_script_messages=1
|
||||
;show_tile_num=1
|
||||
;[sound]
|
||||
;debug=1
|
||||
;debug_sfxc=1
|
||||
;debug=0
|
||||
;debug_sfxc=0
|
||||
;-------
|
||||
DebugMode=0
|
||||
|
||||
;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
|
||||
HideObjIsNullMsg=0
|
||||
|
||||
;Change to 1 to skip the compatibility mode check
|
||||
SkipCompatModeCheck=0
|
||||
|
||||
;Set to 1 to skip the executable file size check
|
||||
;Does not require sfall debugging mode
|
||||
SkipSizeCheck=0
|
||||
|
||||
;If you're testing changes to the Fallout exe, you can override the CRC that sfall looks for here
|
||||
;You can use several hex values, separated by commas
|
||||
;Does not require sfall debugging mode
|
||||
;ExtraCRC=0x00000000,0x00000000
|
||||
|
||||
;Set to 1 to stop Fallout from deleting non read-only protos at startup
|
||||
;Has pretty nasty side effects when saving/reloading, so don't use for regular gameplay
|
||||
DontDeleteProtos=0
|
||||
|
||||
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
|
||||
;Does not require sfall debugging mode
|
||||
AllowUnsafeScripting=0
|
||||
|
||||
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
|
||||
InjectAllGameHooks=0
|
||||
|
||||
|
||||
@@ -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)); }
|
||||
}
|
||||
@@ -54,9 +54,7 @@ procedure combatturn_handler begin
|
||||
// set perks (only work with 4.1.8+)
|
||||
foreach (perkID in perksList) begin
|
||||
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
|
||||
if (level) then begin
|
||||
critter_add_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
intface_redraw;
|
||||
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
|
||||
@@ -83,9 +81,7 @@ procedure combatturn_handler begin
|
||||
if (dude_obj != real_dude_obj) then begin
|
||||
foreach (perkID in perksList) begin
|
||||
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
|
||||
if (level) then begin
|
||||
critter_rm_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
|
||||
end
|
||||
end
|
||||
if isShowTag then begin
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#include "..\scripting\headers\sfall.h"
|
||||
#include "..\scripting\headers\define_lite.h"
|
||||
@@ -71,3 +73,5 @@ end
|
||||
procedure InitConfigs begin
|
||||
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
|
||||
end
|
||||
|
||||
#endif
|
||||
|
||||
@@ -155,7 +155,7 @@ Example:
|
||||
- creates permanent array (but not "saved")
|
||||
- if size is >= 0, creates list with given size
|
||||
- if size == -1, creates map (associative array)
|
||||
- if size == -1 and flags == 2, creates a "lookup" map in which the values of existing keys are read-only and can't be updated.
|
||||
- if size == -1 and flags == 2, creates a "lookup" map (associative array) in which the values of existing keys are read-only and can't be updated.
|
||||
This type of array allows you to store a zero (0) key value
|
||||
- NOTE: in earlier versions (up to 4.1.3/3.8.13) the second argument is not used, just use 0
|
||||
- returns arrayID (valid until array is deleted)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
The executation speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there's the potential for problems again, since sfall's global script system means that you can have a large amount of scripts being run every single frame.
|
||||
|
||||
======================
|
||||
=== sslc -O option ===
|
||||
======================
|
||||
|
||||
The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn't a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It's primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.
|
||||
|
||||
There are several levels of optimization available:
|
||||
-O1 - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched.
|
||||
-O2 - Full, most code optimizations are on, but only those that were tested on complex scripts.
|
||||
-O3 - Experimental, provides most efficiency, but tend to break some complex code due to bugs.
|
||||
|
||||
The following optimizations are performed:
|
||||
|
||||
> constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result.
|
||||
|
||||
a:=2+2; -> a:=4;
|
||||
|
||||
> constant variable initialization: All variables are initialised to some value, ('0', if you don't specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression.
|
||||
|
||||
variable a; -> variable a:=4;
|
||||
a:=4; ->
|
||||
|
||||
> constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevent references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script.
|
||||
|
||||
a:=4 -> a:=4
|
||||
foo(a); -> foo(4);
|
||||
|
||||
> dead code removal: Checks for and removes code which cannot be reached, either because it is hidden behind a return or because the argument to an if statement can be computed at compile time.
|
||||
|
||||
if 1 then begin -> display_msg("foo");
|
||||
display_msg("foo"); ->
|
||||
end else begin ->
|
||||
display_msg("bar"); ->
|
||||
end ->
|
||||
|
||||
> unreferenced variable elimination: Checks for variables which are never referenced, and removes them. Also applies to global variables, as long as they are not marked for export.
|
||||
|
||||
variable i, j, k; -> variable i;
|
||||
i:=1; -> i:=1;
|
||||
return; -> return;
|
||||
|
||||
> unreferenced procedure elimination: Checks for any procedures which are never called, and removes them.
|
||||
|
||||
procedure foo begin return "foo"; end -> procedure foo begin return "foo"; end
|
||||
procedure bar begin return "bar"; end -> procedure start begin
|
||||
procedure start begin -> display_msg(foo);
|
||||
display_msg(foo); -> end
|
||||
end ->
|
||||
|
||||
> dead store removal: Removes variable assignments if the result of the variable is unused, and if the expression used to compute the value of the variable is provably free of side effects. (See 'pure' keyword)
|
||||
|
||||
a:="moo"; -> a:="foo";
|
||||
a:="foo"; -> display_msg(a);
|
||||
display_msg(a); ->
|
||||
a:="bar"; ->
|
||||
|
||||
> store combination: Where there are two stores in a row to the same variable, the two expressions are combined.
|
||||
|
||||
var1 := var2; -> var1 := var2 + var3;
|
||||
var1 += var3; ->
|
||||
|
||||
> variable combination: Where usage regions of variables do not overlap, combine the variables to provide additional candidates for unreferenced variable elimination. Very useful for scripts containing multiple foreach loops, which generate 2 or 3 hidden variables each.
|
||||
|
||||
a:="foo"; -> a:="foo";
|
||||
display_msg(a); -> display_msg(a);
|
||||
b:="bar"; -> a:="bar";
|
||||
display_msg(b); -> display_msg(a);
|
||||
|
||||
> namelist compression: Fallout stores the names of all file scope variables and procedures in a namelist which is saved into the .int. Any of these that are unreferenced can be removed, and the names of global variables can be modified to make them shorter.
|
||||
|
||||
=============================
|
||||
=== writing your own code ===
|
||||
=============================
|
||||
|
||||
Don't have global scripts running any more often that you need them to. Not everything needs to be run every single frame.
|
||||
|
||||
Never concat constant strings with the '+' operator, as it forces the operation to be done at runtime. The compiler can cope with constant strings being placed next to each other without the need for a +, which results in far more efficient code as the combination is done at lex time.
|
||||
|
||||
#define GLOB_PREFIX "ts__" -> #define GLOB_PREFIX "ts__"
|
||||
|
||||
procedure start begin -> procedure start begin
|
||||
set_sfall_global(GLOB_PREFIX + "foo1", 0); -> set_sfall_global(GLOB_PREFIX "foo1", 0);
|
||||
end -> end
|
||||
|
||||
|
||||
Avoid function calls in while loops. function calls are expensive in comparison to variable lookups, so it's more efficient to move the function call out of the loop and store the result in a variable
|
||||
|
||||
while i < len_array(array) do begin -> tmp:= len_array(array);
|
||||
... -> while i < tmp do begin
|
||||
end -> ...
|
||||
-> end
|
||||
|
||||
Mark functions with pure or inline where relevent.
|
||||
|
||||
'pure' is a hint to the optimizer that a procedure has no side effects. (i.e. there's no way to tell that it's been called aside from its return value.) Pure procedures cannot modify global variables, or call any other procedure that isn't itself pure. Functions marked with pure can only be used in expressions (i.e. you cannot use the 'call <procedure>' syntax to call them.) If there are non-pure terms in an expression, it prevents that expression being considered for dead store removal. Where no such optimizations can be performed, or if optimization is disabled, marking a procedure with pure will have no effect on the compiled code.
|
||||
|
||||
'inline' is an instruction to the compiler to replace calls to the marked procedure with a copy of the procedures code instead of having a seperate call. inlined procedures cannot use the 'return' command, cannot be predefined, and cannot be used as part of an expression. inlining if a procedure is only going to be called once is always a win, but if there are multiple calls to a procedure you will end up bloating the size of the generated code.
|
||||
@@ -0,0 +1,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
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -394,7 +408,7 @@
|
||||
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
||||
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
||||
#define OBJ_DATA_DAMAGE_LAST_TURN (0x48)
|
||||
#define OBJ_DATA_WHO_HIT_ME (0x54)
|
||||
#define OBJ_DATA_WHO_HIT_ME (0x54) // current target of the critter
|
||||
|
||||
// compute attack result data offsets
|
||||
#define C_ATTACK_SOURCE (0x00)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef SFALL_H
|
||||
#define SFALL_H
|
||||
|
||||
//Recognised modes for set_shader_mode and get_game_mode
|
||||
#define WORLDMAP (0x1)
|
||||
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
|
||||
#define DIALOG (0x4)
|
||||
#define ESCMENU (0x8)
|
||||
#define SAVEGAME (0x10)
|
||||
@@ -20,6 +22,7 @@
|
||||
#define HEROWIN (0x40000)
|
||||
#define DIALOGVIEW (0x80000)
|
||||
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
|
||||
#define SPECIAL (0x80000000)
|
||||
|
||||
//Valid arguments to register_hook
|
||||
#define HOOK_TOHIT (0)
|
||||
@@ -63,20 +66,36 @@
|
||||
#define HOOK_SETLIGHTING (38)
|
||||
#define HOOK_SNEAK (39)
|
||||
#define HOOK_STDPROCEDURE (40)
|
||||
#define HOOK_STDPROCEDURE_END (41)
|
||||
#define HOOK_TARGETOBJECT (42)
|
||||
#define HOOK_ENCOUNTER (43)
|
||||
|
||||
//Valid arguments to list_begin
|
||||
#define LIST_CRITTERS (0)
|
||||
#define LIST_GROUNDITEMS (1)
|
||||
#define LIST_SCENERY (2)
|
||||
#define LIST_WALLS (3)
|
||||
//#define LIST_TILES (4) //Not listable via sfall list functions
|
||||
//#define LIST_TILES (4) //Not listable via sfall list functions
|
||||
#define LIST_MISC (5)
|
||||
#define LIST_SPATIAL (6)
|
||||
#define LIST_ALL (9)
|
||||
|
||||
//Valid window types for get_window_attribute
|
||||
#define WINTYPE_INVENTORY (0) // any inventory window (player/loot/use/barter)
|
||||
#define WINTYPE_DIALOG (1)
|
||||
#define WINTYPE_PIPBOY (2)
|
||||
#define WINTYPE_WORLDMAP (3)
|
||||
#define WINTYPE_IFACEBAR (4) // the interface bar
|
||||
#define WINTYPE_CHARACTER (5)
|
||||
#define WINTYPE_SKILLDEX (6)
|
||||
#define WINTYPE_ESCMENU (7) // escape menu
|
||||
|
||||
//Valid flags for force_encounter_with_flags
|
||||
#define ENCOUNTER_FLAG_NO_CAR (1)
|
||||
#define ENCOUNTER_FLAG_LOCK (2) // block new forced encounter by the next function call until the current specified encounter occurs
|
||||
#define ENCOUNTER_FLAG_NO_CAR (0x1)
|
||||
#define ENCOUNTER_FLAG_LOCK (0x2) // block new forced encounter by the next function call until the current specified encounter occurs
|
||||
#define ENCOUNTER_FLAG_NO_ICON (0x4) // disable displaying the flashing icon
|
||||
#define ENCOUNTER_FLAG_ICON_SP (0x8) // use special encounter icon
|
||||
#define ENCOUNTER_FLAG_FADEOUT (0x10) // fade out the screen on encounter (Note: you yourself should restore the fade screen when entering the encounter)
|
||||
|
||||
//The attack types returned by get_attack_type
|
||||
#define ATKTYPE_LWEP1 (0)
|
||||
@@ -245,12 +264,19 @@
|
||||
// fake perks/traits add mode flags
|
||||
#define ADD_PERK_MODE_TRAIT (1) // add to the player's traits
|
||||
#define ADD_PERK_MODE_PERK (2) // add to the player's perks
|
||||
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks
|
||||
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks (after added to the player)
|
||||
|
||||
// instantly apply the item to dude_obj (w/o animation)
|
||||
#define use_item_on_dude(item) set_self(dude_obj); \
|
||||
set_self(dude_obj); \
|
||||
use_obj_on_obj(item, dude_obj); \
|
||||
set_self(0)
|
||||
|
||||
// sfall_funcX macros
|
||||
#define add_extra_msg_file(name) sfall_func1("add_extra_msg_file", name)
|
||||
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
|
||||
#define add_iface_tag sfall_func0("add_iface_tag")
|
||||
#define add_trait(traitId) sfall_func1("add_trait", traitId)
|
||||
#define add_trait(traitID) sfall_func1("add_trait", traitID)
|
||||
#define art_cache_clear sfall_func0("art_cache_clear")
|
||||
#define attack_is_aimed sfall_func0("attack_is_aimed")
|
||||
#define car_gas_amount sfall_func0("car_gas_amount")
|
||||
@@ -270,29 +296,39 @@
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
|
||||
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
|
||||
#define get_interface_x(winType) sfall_func2("get_window_attribute", winType, 1)
|
||||
#define get_interface_y(winType) sfall_func2("get_window_attribute", winType, 2)
|
||||
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
|
||||
#define get_map_enter_position sfall_func0("get_map_enter_position")
|
||||
#define get_metarule_table sfall_func0("get_metarule_table")
|
||||
#define get_object_ai_data(obj, aiParam) sfall_func2("get_object_ai_data", obj, aiParam)
|
||||
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
|
||||
#define get_outline(obj) sfall_func1("get_outline", obj)
|
||||
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
|
||||
#define get_string_pointer(text) sfall_func1("get_string_pointer", text)
|
||||
#define get_text_width(text) sfall_func1("get_text_width", text)
|
||||
#define has_fake_perk_npc(npc, perk) sfall_func2("has_fake_perk_npc", npc, perk)
|
||||
#define has_fake_trait_npc(npc, trait) sfall_func2("has_fake_trait_npc", npc, trait)
|
||||
#define hide_window(winName) sfall_func1("hide_window", winName)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
#define intface_is_shown(winType) sfall_func1("get_window_attribute", winType)
|
||||
#define intface_redraw sfall_func0("intface_redraw")
|
||||
#define intface_show sfall_func0("intface_show")
|
||||
#define inventory_redraw(invSide) sfall_func1("inventory_redraw", invSide)
|
||||
#define item_make_explosive(pid, aPid, min, max) sfall_func4("item_make_explosive", pid, aPid, min, max)
|
||||
#define item_make_explosive(pid, activePid, min, max) sfall_func4("item_make_explosive", pid, activePid, min, max)
|
||||
#define item_weight(obj) sfall_func1("item_weight", obj)
|
||||
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
|
||||
#define loot_obj sfall_func0("loot_obj")
|
||||
#define metarule_exist(metarule) sfall_func1("metarule_exist", metarule)
|
||||
#define message_box(text) sfall_func1("message_box", text)
|
||||
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
|
||||
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
|
||||
#define obj_under_cursor(crSwitch, inclDude) sfall_func2("obj_under_cursor", crSwitch, inclDude)
|
||||
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
|
||||
#define objects_in_radius(tile, radius, elev, type) sfall_func4("objects_in_radius", tile, radius, elev, type)
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define real_dude_obj sfall_func0("real_dude_obj")
|
||||
#define remove_all_timer_events sfall_func0("remove_timer_event")
|
||||
#define remove_timer_event(fixedParam) sfall_func1("remove_timer_event", fixedParam)
|
||||
#define set_can_rest_on_map(map, elev, value) sfall_func3("set_can_rest_on_map", map, elev, value)
|
||||
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
@@ -306,14 +342,26 @@
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define set_rest_heal_time(time) sfall_func1("set_rest_heal_time", time)
|
||||
#define set_rest_mode(mode) sfall_func1("set_rest_mode", mode)
|
||||
#define set_terrain_name(x, y, name) sfall_func3("set_terrain_name", x, y, name)
|
||||
#define set_town_title(areaID, title) sfall_func2("set_town_title", areaID, title)
|
||||
#define set_unique_id(obj) sfall_func1("set_unique_id", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
|
||||
#define set_window_flag(winID, flag, value) sfall_func3("set_window_flag", winID, flag, value)
|
||||
#define show_window(winName) sfall_func1("show_window", winName)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
|
||||
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
|
||||
#define string_format(format, a1, a2) sfall_func3("string_format", format, a1, a2)
|
||||
#define string_tolower(text) sfall_func2("string_to_case", text, 0)
|
||||
#define string_toupper(text) sfall_func2("string_to_case", text, 1)
|
||||
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
|
||||
|
||||
#define set_fake_perk_npc(npc, perk, level, image, desc) sfall_func5("set_fake_perk_npc", npc, perk, level, image, desc)
|
||||
#define set_fake_trait_npc(npc, trait, active, image, desc) sfall_func5("set_fake_trait_npc", npc, trait, active, image, desc)
|
||||
#define set_selectable_perk_npc(npc, perk, active, image, desc) sfall_func5("set_selectable_perk_npc", npc, perk, active, image, desc)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,7 @@ The hook script equivalent of game_loaded; it returns 2 when the script is first
|
||||
|
||||
> mixed get_sfall_arg()
|
||||
Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left.
|
||||
You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.
|
||||
|
||||
> array get_sfall_args()
|
||||
Returns all hook arguments as a new temp array.
|
||||
@@ -37,16 +38,16 @@ Returns all hook arguments as a new temp array.
|
||||
> void set_sfall_return(int value)
|
||||
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
|
||||
|
||||
> void set_sfall_arg(int argnum, int value)
|
||||
Changes argument value. The argument number (argnum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
|
||||
> void set_sfall_arg(int argNum, int value)
|
||||
Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
|
||||
|
||||
> void register_hook(int hooktype)
|
||||
> void register_hook(int hookID)
|
||||
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be executed in a current global script. You can use all above functions like normal.
|
||||
|
||||
> void register_hook_proc(int hook, procedure proc)
|
||||
> void register_hook_proc(int hookID, procedure proc)
|
||||
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
|
||||
|
||||
> void register_hook_proc_spec(int hook, procedure proc)
|
||||
> void register_hook_proc_spec(int hookID, procedure proc)
|
||||
Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using register_hook/register_hook_proc functions.
|
||||
|
||||
NOTE: you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with "set_sfall_return", the next script may override this value if calls "set_sfall_return" again. Sometimes you need to multiply certain value in a chain of hook scripts.
|
||||
@@ -68,7 +69,7 @@ This basically changes hook argument for the next script. Mod B code:
|
||||
So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use "set_sfall_arg" in both hooks).
|
||||
|
||||
|
||||
The defines to use for the hooktype are in sfall.h.
|
||||
The defines to use for the hookID are in sfall.h.
|
||||
|
||||
-------------------------------------------
|
||||
----------- HOOK SCRIPT TYPES -------------
|
||||
@@ -125,11 +126,13 @@ int ret1 - The new AP cost
|
||||
HOOK_DEATHANIM1 (hs_deathanim1.int)
|
||||
|
||||
Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees
|
||||
Does not run for critters in the knockdown/out state.
|
||||
|
||||
int arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
|
||||
critter arg2 - The attacker
|
||||
critter arg3 - The target
|
||||
int arg4 - The amount of damage
|
||||
int arg5 - Unused, always -1. Use this if you are using the same procedure for HOOK_DEATHANIM1 and HOOK_DEATHANIM2 (since sfall 4.1/3.8.24)
|
||||
|
||||
int ret1 - The pid of an object to override the attacking weapon with
|
||||
|
||||
@@ -138,7 +141,8 @@ int ret1 - The pid of an object to override the attacking weapon with
|
||||
HOOK_DEATHANIM2 (hs_deathanim2.int)
|
||||
|
||||
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than hs_deathanim1, but performs no validation.
|
||||
When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and target will point to an object with obj_art_fid == 0x20001F5.
|
||||
When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with obj_art_fid == 0x20001F5.
|
||||
Does not run for critters in the knockdown/out state.
|
||||
|
||||
item arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
|
||||
critter arg2 - The attacker
|
||||
@@ -188,9 +192,17 @@ Critter arg1 - The critter that just died
|
||||
|
||||
HOOK_FINDTARGET (hs_findtarget.int)
|
||||
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker. This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's. Pass -1 to skip the return value.
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker.
|
||||
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
|
||||
|
||||
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries.
|
||||
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
|
||||
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
|
||||
|
||||
NOTE: The engine can choose targets by the following criteria:
|
||||
1) The nearest enemy to the attacker.
|
||||
2) The enemy that attacked the attacker.
|
||||
3) The enemy that attacked an NPC from the same team as the attacker.
|
||||
4) The enemy that is attacked by an NPC from the same team as the attacker.
|
||||
|
||||
critter arg1 - The attacker
|
||||
critter arg2 - A possible target
|
||||
@@ -285,10 +297,10 @@ int ret1 - the new AP cost
|
||||
-------------------------------------------
|
||||
|
||||
(DEPRECATED)
|
||||
hs_hexmoveblocking.int
|
||||
hs_hexaiblocking.int
|
||||
hs_hexshootblocking.int
|
||||
hs_hexsightblocking.int
|
||||
HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)
|
||||
HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)
|
||||
HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)
|
||||
HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)
|
||||
|
||||
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
|
||||
|
||||
@@ -513,6 +525,7 @@ HOOK_GAMEMODECHANGE (hs_gamemodechange.int)
|
||||
Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc.
|
||||
|
||||
int arg1 - event type: 1 - when the player exits the game, 0 - otherwise
|
||||
int arg2 - the previous game mode
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
@@ -557,8 +570,8 @@ HOOK_USESKILLON (hs_useskillon.int)
|
||||
Runs before using any skill on any object. Lets you override the critter that uses the skill.
|
||||
NOTE: the user critter can't be overridden when using Steal skill.
|
||||
|
||||
Critter arg1 - The user critter (usually dude_obj)
|
||||
Obj arg2 - The target object/critter
|
||||
Critter arg1 - the user critter (usually dude_obj)
|
||||
Obj arg2 - the target object/critter
|
||||
int arg3 - skill being used
|
||||
|
||||
int ret1 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value
|
||||
@@ -572,11 +585,11 @@ Runs when Fallout is checking all the tiles within the explosion radius for targ
|
||||
The tile checking will be interrupted when 6 additional targets (critters) are received.
|
||||
|
||||
int arg1 - event type: 1 - when checking objects within the explosion radius without causing damage (e.g. the player drops an active explosive), 0 - otherwise
|
||||
Critter arg2 - The attacker
|
||||
int arg3 - The tile on which the explosion occurs
|
||||
Critter arg2 - the attacker
|
||||
int arg3 - the tile on which the explosion occurs
|
||||
int arg4 - checked tile within the explosion radius
|
||||
Obj arg5 - first found object on the checked tile as an additional target
|
||||
Critter arg6 - The target critter, may be 0 or equal to the attacker
|
||||
Critter arg6 - the target critter, may be 0 or equal to the attacker
|
||||
int arg7 - 1 when using throwing weapons (e.g. grenades), 0 otherwise
|
||||
|
||||
int ret1 - overrides the found object on the checked tile, pass 0 to skip the object
|
||||
@@ -591,20 +604,20 @@ Runs when:
|
||||
2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.
|
||||
Does not run for misses, non-combat damage like dynamite explosions, or if one of the damage formulas is selected in ddraw.ini.
|
||||
|
||||
Critter arg1 - The attacker
|
||||
Critter arg2 - The target
|
||||
Obj arg3 - The weapon used in the attack
|
||||
int arg4 - Attack Type (see ATKTYPE_* constants)
|
||||
int arg5 - Number of bullets actually hit the target (1 for melee attacks)
|
||||
int arg6 - Target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
|
||||
int arg7 - Target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
|
||||
int arg8 - Bonus ranged damage from the perk
|
||||
int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
|
||||
int arg10 - Combat Difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
|
||||
int arg11 - The calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
|
||||
mixed arg12 - Computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
|
||||
Critter arg1 - the attacker
|
||||
Critter arg2 - the target
|
||||
Obj arg3 - the weapon used in the attack
|
||||
int arg4 - attack type (see ATKTYPE_* constants)
|
||||
int arg5 - number of bullets actually hit the target (1 for melee attacks)
|
||||
int arg6 - target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
|
||||
int arg7 - target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
|
||||
int arg8 - bonus ranged damage from the perk
|
||||
int arg9 - damage multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
|
||||
int arg10 - combat difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
|
||||
int arg11 - the calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
|
||||
mixed arg12 - computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
|
||||
|
||||
int ret1 - The returned amount of damage
|
||||
int ret1 - the returned amount of damage
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
@@ -635,13 +648,41 @@ int ret2 - overrides the duration time for the current result
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_STDPROCEDURE (hs_stdprocedure.int)
|
||||
HOOK_STDPROCEDURE, HOOK_STDPROCEDURE_END (hs_stdprocedure.int)
|
||||
|
||||
Runs before Fallout executes a standard procedure (handler) in any script of any object.
|
||||
Runs before or after Fallout engine executes a standard procedure (handler) in any script of any object.
|
||||
NOTE: this hook will not be executed for "start", critter_p_proc, timed_event_p_proc, and map_update_p_proc procedures.
|
||||
|
||||
int arg1 - the number of the standard script handler (see define.h)
|
||||
Obj arg2 - the object that owns this handler (self_obj)
|
||||
Obj arg3 - the object that called this handler (source_obj, can be 0)
|
||||
int arg4 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise
|
||||
|
||||
int ret1 - pass -1 to cancel the execution of the handler
|
||||
int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE)
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_TARGETOBJECT (hs_targetobject.int)
|
||||
|
||||
Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.
|
||||
You can override the target object or prevent the player from attacking the chosen target.
|
||||
|
||||
int arg1 - event type: 0 - when the targeting cursor hovers over the object, 1 - when trying to attack the target object
|
||||
int arg2 - 1 when the target object is valid to attack, 0 otherwise
|
||||
Obj arg3 - the target object
|
||||
|
||||
mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_ENCOUNTER (hs_encounter.int)
|
||||
|
||||
Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map.
|
||||
You can override the map for loading or the encounter.
|
||||
|
||||
int arg1 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map
|
||||
int arg2 - the map ID that the encounter will load (see MAPS.h or Maps.txt)
|
||||
int arg3 - 1 when the encounter occurs is a special encounter, 0 otherwise
|
||||
|
||||
int ret1 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling
|
||||
int ret2 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0)
|
||||
|
||||
@@ -24,7 +24,7 @@ The input functions are only available if the user has the input hook turned on
|
||||
|
||||
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
|
||||
|
||||
load_shader takes a path relative to the data\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
|
||||
load_shader takes a path relative to the <GameRoot>\<master_patches>\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
|
||||
|
||||
get_shader_version gives you the highest shader version supported by the player's graphics cards. Possible return values are 11, 12, 13, 14, 20, 21 and 30.
|
||||
|
||||
@@ -36,7 +36,7 @@ The mapper manual lists the functions 'world_map_x_pos' and 'world_map_y_pos', w
|
||||
|
||||
set_pipboy_available will only accept 0 or 1 as an argument. Using any other value will cause the function to have no effect. Use 0 to disable the pipboy, and 1 to enable it.
|
||||
|
||||
get/set_critter_current_ap functions should only be used during the target critters turn while in combat. Calling them outside of combat typically returns the critters max ap, but don't rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.) Using set_critter_current_ap on the player will not automatically redraw the screen, so the ap bar will be incorrect until the player next clicks.
|
||||
get/set_critter_current_ap functions should only be used during the target critters turn while in combat. Calling them outside of combat typically returns the critters max ap, but don't rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.)
|
||||
|
||||
The 'type' value in the weapon knockback functions can be 0 or 1. If 0, the value becomes an absolute distance that targets will be knocked back. If 1, the value is multiplied by the distance they would normally have been knocked back. Weapon knockback modifiers are applied in the order weapon -> attacker -> target, so a x2 weapon wielded by an abs 6 attacker hitting a /2 target will knock the target back 3 squares. The knockback functions will not override the stonewall perk or knockdowns resulting from criticals. knockback values set on weapons or critters are not saved, and must be reset each time the player reloads.
|
||||
|
||||
@@ -50,7 +50,7 @@ has_fake_trait and has_fake_perk return the number of levels the player has of t
|
||||
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the player's traits, if bit 2 is set it is added to the player's perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to its default state.
|
||||
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to (4 + the value of BoxBarCount in ddraw.ini) for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 4.1, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to (4 + the value of BoxBarCount in ddraw.ini) for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 4.1/3.8.12, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
|
||||
|
||||
get/set_bodypart_hit_modifier alter the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload.
|
||||
|
||||
@@ -66,7 +66,7 @@ get/set_proto_data are used to manipulate the in memory copies of the .pro files
|
||||
|
||||
the list_xxx functions can be used to loop over all items on a map. list_begin takes an argument telling sfall what you want to list. (Defined in sfall.h) It returns a list pointer, which you iterate through with list_next. Finally, when you've finished with the list use list_end on it. Not calling list_end will result in a memory leak. Alternatively, use list_as_array to get the whole list at once as a temp array variable, which can be looped over using len_array and which you don't need to remember to free afterwards.
|
||||
|
||||
play_sfall_sound and stop_sfall_sound are used to play mp3/wav/wma files. The path given is relative to the Fallout folder. Specify loop as 1 to loop the file continuously, or 0 otherwise. If you don't wish to loop, play_sfall_sound returns 0. If you do loop, it returns an id which can be passed back to stop_sfall_sound when you want to stop the effect. All sounds effects will be stopped on game reload, looping or not. These functions do not require 'AllowDShowSound' to be set to 1 in ddraw.ini.
|
||||
play_sfall_sound and stop_sfall_sound are used to play mp3/wav/wma files. The path given is relative to the Fallout folder. Specify mode as 1 to loop the file continuously, 2 to replace the current background game music with playing the specified file in loop mode, or 0 to play the file once. If you don't wish to loop, play_sfall_sound returns 0. If you do loop, it returns an id which can be passed back to stop_sfall_sound when you want to stop the effect. All sounds effects will be stopped on game reload, looping or not. These functions do not require 'AllowDShowSound' to be set to 1 in ddraw.ini.
|
||||
|
||||
arrays are created and manipulated with the xxx_array functions. An array must first be created with create_array or temp_array, specifying how many data elements the array can hold. You can store any of ints, floats and strings in an array, and can mix all 3 in a single array. The id returned by create/temp_array can then be used with the other array functions. Arrays are shared between all scripts. (i.e. you can call create_array from one script, and then use the returned id from another script.) They are also saved across savegames. You must remember to free any arrays you create with create_array when you are done with them, or you will leak memory. arrays created with temp_array will be automatically freed at the end of the frame. These functions are safe, in that supplying a bad id or trying to access out of range elements will not crash the script. create_array is the only function that returns a permanent array, all other functions which return arrays (string_split, list_as_array etc,) all return temp arrays. You can use fix_array to make a temp array permanent.
|
||||
|
||||
@@ -137,7 +137,7 @@ array - array ID to be used with array-related functions (actually an integer)
|
||||
- The player will not get an outdoorsman skill check.
|
||||
|
||||
> void force_encounter_with_flags(int map, int flags)
|
||||
- does the same thing as force_encounter, but allows the specification of some extra options.
|
||||
- does the same thing as force_encounter, but allows the specification of some extra options (see sfall.h for available flags).
|
||||
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
|
||||
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
|
||||
|
||||
@@ -153,12 +153,13 @@ array - array ID to be used with array-related functions (actually an integer)
|
||||
- accepts a pointer to an object and will remove the script from that object.
|
||||
|
||||
> void set_script(object, int scriptid)
|
||||
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6)
|
||||
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accepts the same values as create_object_sid)
|
||||
- If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided.
|
||||
- if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run.
|
||||
|
||||
> int get_script(object)
|
||||
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or -1 if the object is unscripted.
|
||||
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted.
|
||||
- returns -1 on argument error.
|
||||
|
||||
> void set_self(int obj)
|
||||
- overrides the scripts self_obj for the next function call.
|
||||
@@ -218,6 +219,9 @@ Some additional reg_anim_* functions were introduced. They all work in the same
|
||||
> void reg_anim_turn_towards(object, tile/target, delay)
|
||||
- makes object change its direction to face given tile num or target object.
|
||||
|
||||
> void reg_anim_callback(procedure proc)
|
||||
- adds the given procedure to an animation sequence-list and executes it in the registered sequence.
|
||||
|
||||
> int/array metarule2_explosions(int arg1, int arg2, int arg3)
|
||||
was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h:
|
||||
|
||||
@@ -259,7 +263,10 @@ Some utility/math functions are available:
|
||||
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
|
||||
|
||||
> string substr(string, start, length)
|
||||
- cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te")
|
||||
- cuts a substring from a string starting at "start" up to "length" characters. The first character position is 0 (zero).
|
||||
- If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st").
|
||||
- If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te").
|
||||
- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22
|
||||
|
||||
> int strlen(string string)
|
||||
- returns string length
|
||||
@@ -274,10 +281,15 @@ Some utility/math functions are available:
|
||||
> int charcode(string string)
|
||||
- returns ASCII code for the first character in given string
|
||||
|
||||
> div operator (unsigned integer division)
|
||||
- use as a division operator, like 3 + (20 div 5)
|
||||
- if both dividend and divisor are integers, they will be treated as unsigned integers
|
||||
- if one of them is a float, div will perform the signed division just like vanilla division operator
|
||||
|
||||
> ^ operator (exponentiation)
|
||||
- use as any other arithmetic operator, like 5^(1/3)
|
||||
- if exponent is integer, you can use negative base, otherwise you will get "nan" with negative base
|
||||
- if both arguments are integers, result will be integer
|
||||
- if exponent is an integer, you can use a negative base, otherwise you will get "NaN" with a negative base
|
||||
- if both arguments are integers, the result will be an integer
|
||||
|
||||
> float log(float x)
|
||||
- natural logarithm of x
|
||||
@@ -449,6 +461,7 @@ Some utility/math functions are available:
|
||||
|
||||
> array sfall_func2("get_ini_section", string fileName, string section)
|
||||
- returns an associative array of keys and values for a given INI file and section
|
||||
- NOTE: all keys and their values will be of String type
|
||||
|
||||
> int sfall_func0("car_gas_amount")
|
||||
- returns current amount of fuel in player's car (between 0 and 80000)
|
||||
@@ -514,9 +527,10 @@ Some utility/math functions are available:
|
||||
- adds one custom box to the current boxes, and returns the number of the added tag (-1 if the tags limit is exceeded)
|
||||
- The maximum number of boxes is limited to 126 tags
|
||||
|
||||
> void sfall_func0("inventory_redraw")
|
||||
> void sfall_func1("inventory_redraw", int invSide)
|
||||
- redraws inventory list in the inventory/use inventory item on/loot/barter screens
|
||||
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens)
|
||||
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
|
||||
|
||||
> void sfall_func3("item_make_explosive", int pid, int activePid, int damage)
|
||||
> void sfall_func4("item_make_explosive", int pid, int activePid, int min, int max)
|
||||
@@ -550,15 +564,16 @@ Some utility/math functions are available:
|
||||
> int sfall_func2("get_can_rest_on_map", int mapNum, int elev)
|
||||
- returns the set rest value of the map after using the set_can_rest_on_map function
|
||||
- returns -1 if the rest value of the map was not previously set (i.e. no data for the map in sfalldb.sav)
|
||||
- the can_rest_here values in maps.txt are ignored
|
||||
- the can_rest_here values from maps.txt are ignored
|
||||
|
||||
> object sfall_func0("dialog_obj")
|
||||
- returns a pointer to the object (critter) the player is having a conversation or bartering with
|
||||
|
||||
> object sfall_func2("obj_under_cursor", bool crSwitch, bool inclDude)
|
||||
> object sfall_func2("obj_under_cursor", bool onlyCritter, bool includeDude)
|
||||
- returns the object under the cursor on the main game screen
|
||||
- crSwitch: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.), False - checks all objects (can't check critters under objects)
|
||||
- passing False to the inclDude argument will ignore dude_obj
|
||||
- onlyCritter: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.)
|
||||
False - checks all objects (can't check critters under objects)
|
||||
- passing False to the includeDude argument will ignore dude_obj
|
||||
|
||||
> object sfall_func0("loot_obj")
|
||||
- returns a pointer to the target object (container or critter) of the loot screen
|
||||
@@ -596,8 +611,8 @@ Some utility/math functions are available:
|
||||
|
||||
> void sfall_func5("draw_image", string/int pathFile/artId, int frame, int x, int y, bool noTransparent)
|
||||
> void sfall_func6("draw_image_scaled", string/int pathFile/artId, int frame, int x, int y, int width, int height)
|
||||
- displays the specified FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
|
||||
- pathFile/artId: path to the FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
|
||||
- displays the specified PCX or FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
|
||||
- pathFile/artId: path to the PCX/FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
|
||||
optional arguments:
|
||||
- frame: frame number, the first frame starts from zero
|
||||
- x/y: offset relative to the top-left corner of the window
|
||||
@@ -627,12 +642,94 @@ optional argument:
|
||||
- can take off player's equipped item when the inventory is opened, or the player is in the barter screen
|
||||
- slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h)
|
||||
|
||||
> void sfall_func1("add_trait", int traitId)
|
||||
> void sfall_func1("add_trait", int traitID)
|
||||
- adds the specified trait to the player
|
||||
|
||||
> int sfall_func0("get_inven_ap_cost")
|
||||
- returns the current AP cost to access the inventory in combat
|
||||
|
||||
> void sfall_func2("add_g_timer_event", int time, int fixedParam)
|
||||
- adds a timer event that calls the timed_event_p_proc procedure in the current global script
|
||||
- time: the number of ticks after which the event timer is triggered
|
||||
- fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function
|
||||
|
||||
> void sfall_func0("remove_timer_event")
|
||||
- clears all set timer events for the current global script
|
||||
|
||||
> void sfall_func1("remove_timer_event", int fixedParam)
|
||||
- removes all timer events with the specified 'fixedParam' value for the current global script
|
||||
|
||||
> mixed sfall_func1("get_sfall_arg_at", int argNum)
|
||||
- gets the value of hook argument with the specified argument number (first argument of hook starts from 0)
|
||||
|
||||
> void sfall_func0("hide_window")
|
||||
> void sfall_func1("hide_window", string winName)
|
||||
- hides the specified or currently active (selected) script window
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
|
||||
> void sfall_func0("show_window")
|
||||
> void sfall_func1("show_window", string winName)
|
||||
- displays the specified hidden script window or the one previously hidden with the sfall_func0("hide_window") function
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
|
||||
> void sfall_func3("set_window_flag", string/int winName/winID, int flag, bool value)
|
||||
- changes the specified flag for the created script or game interface window
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
- winID: the ID number of the interface or script window obtained with the get_window_under_mouse function, or 0 for the current game interface
|
||||
- flag: the flag to change (see WIN_FLAG_* constants in define_extra.h)
|
||||
- value: true - set the flag, false - unset the flag
|
||||
|
||||
> int sfall_func1("get_text_width", string text)
|
||||
- returns the text width in pixels for the currently set font
|
||||
|
||||
> bool sfall_func2("string_compare", string str1, string str2)
|
||||
> bool sfall_func3("string_compare", string str1, string str2, int codePage)
|
||||
- compares two strings case-insensitive, and returns True if the two strings are matched
|
||||
- codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table
|
||||
available encodings: 1250-1252, 866
|
||||
|
||||
> string sfall_func3("string_format", string format, any val1, any val2, ...)
|
||||
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting up to 4 values
|
||||
- formatting is only supported for %s and %d, and the format string is limited to 1024 characters
|
||||
|
||||
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
|
||||
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
|
||||
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
|
||||
- passing -1 to the type argument or not specifying it will return all objects within the radius
|
||||
- the radius is limited to 50 hexes
|
||||
|
||||
> int sfall_func2("tile_by_position", int x, int y)
|
||||
- returns the tile number at the x, y position relative to the top-left corner of the game screen
|
||||
- if the position is outside of the range of tiles, it will return -1
|
||||
|
||||
> string sfall_func2("string_to_case", string text, int toCase)
|
||||
- converts all letters in the given string to the specified case
|
||||
- toCase: 0 - lowercase, 1 - uppercase
|
||||
- NOTE: this function works only for English letters of A-Z/a-z
|
||||
|
||||
> void sfall_func3("set_terrain_name", int x, int y, string name)
|
||||
- overrides the terrain type name for the sub-tile on the world map by the specified coordinates
|
||||
|
||||
> int sfall_func1("get_window_attribute", int winType)
|
||||
> int sfall_func2("get_window_attribute", int winType, int attrType)
|
||||
- returns the attribute of the specified interface window by the attrType argument
|
||||
- winType: the type number of the interface window (see WINTYPE_* constants in sfall.h)
|
||||
- attrType: 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)
|
||||
1 - X position, 2 - Y position (relative to the top-left corner of the game screen)
|
||||
- returns -1 if the specified attribute cannot be obtained
|
||||
|
||||
> void sfall_func2("set_town_title", int areaID, string title)
|
||||
- sets a floating text for a town on the world map when hovering the cursor over the player's marker
|
||||
- areaID: the ID number of the town from city.txt
|
||||
|
||||
> int sfall_func4("message_box", string message, int flags, int color1, int color2)
|
||||
- creates a dialog box with text and returns the result of pressing the button: 0 - No (Escape), 1 - Yes/Done (Enter)
|
||||
- returns -1 if for some reason the dialog box cannot be created
|
||||
- message: the text in the dialog box. Use the \n control character to move text to a new line (example: "Hello\nWorld!")
|
||||
optional arguments:
|
||||
- flags: mode flags (see MSGBOX_* constants in define_extra.h). Pass -1 to skip setting the flags (default flags are NORMAL and YESNO)
|
||||
- color1/2: the color index in Fallout palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -296,8 +296,8 @@
|
||||
|
||||
0x8228 - int get_attack_type
|
||||
|
||||
0x822b - int play_sfall_sound(string file, int loop)
|
||||
0x822c - void stop_sfall_sound(int ptr)
|
||||
0x822b - int play_sfall_sound(string file, int mode)
|
||||
0x822c - void stop_sfall_sound(int soundID)
|
||||
|
||||
0x8235 - array string_split(string string, string split)
|
||||
0x8237 - int atoi(string string)
|
||||
@@ -358,6 +358,9 @@
|
||||
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
|
||||
0x827d - void register_hook_proc_spec(int hook, procedure proc)
|
||||
0x827e - void reg_anim_callback(procedure proc)
|
||||
|
||||
0x827f - div operator (unsigned integer division)
|
||||
|
||||
|
||||
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace sfall
|
||||
std::multimap<long, long> writeAddress;
|
||||
|
||||
static std::vector<long> excludeAddr = {
|
||||
0x42a14f, 0x42a178,
|
||||
0x44E949, 0x44E94A, 0x44E937, 0x4F5F40, 0x4CB850, // from movies.cpp
|
||||
};
|
||||
|
||||
struct HackPair {
|
||||
@@ -72,6 +72,7 @@ static std::vector<HackPair> hackAddr = {
|
||||
{0x484B18, 1}, {0x484B19, 4}, // hookcall
|
||||
// module: Movies
|
||||
{0x44E937, 1}, {0x44E938, 4}, {0x44E949, 1}, {0x44E94A, 4}, // hookcalls
|
||||
{0x4F5F40, 1}, {0x4CB850, 1},
|
||||
// module: Objects
|
||||
{0x4A364A, 5}, {0x4831D9, 1}, {0x4831DA, 1},
|
||||
{0x4841D6, 1}, {0x4841D7, 4}, // hookcall
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2008-2020 The sfall team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
MACROS for operators assembly code
|
||||
|
||||
Notes:
|
||||
- DO NOT add any comments within macros
|
||||
- every macro should contain __asm {} block
|
||||
- every assembly line should start with __asm and should NOT have semicolon in the end!
|
||||
- use this macros outside of other __asm {} blocks (obviously)
|
||||
*/
|
||||
|
||||
/*
|
||||
Gets argument from stack to eax and puts its type to edx register
|
||||
eax register must contain the script_ptr
|
||||
jlabel - name of the jump label in case the value type is not INT
|
||||
return: eax - arg value
|
||||
*/
|
||||
#define _GET_ARG_INT(jlabel) __asm { \
|
||||
__asm mov edx, eax \
|
||||
__asm call fo::funcoffs::interpretPopShort_ \
|
||||
__asm xchg eax, edx \
|
||||
__asm call fo::funcoffs::interpretPopLong_ \
|
||||
__asm cmp dx, VAR_TYPE_INT \
|
||||
__asm jnz jlabel \
|
||||
}
|
||||
|
||||
#define _GET_ARG(outVal, outType) __asm { \
|
||||
__asm call fo::funcoffs::interpretPopShort_ \
|
||||
__asm mov outType, eax \
|
||||
__asm mov eax, ebx \
|
||||
__asm call fo::funcoffs::interpretPopLong_ \
|
||||
__asm mov outVal, eax \
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the value to the script
|
||||
eax and ebx register must contain the script_ptr
|
||||
edx register must contain the returned value
|
||||
*/
|
||||
#define _RET_VAL_INT __asm { \
|
||||
__asm call fo::funcoffs::interpretPushLong_ \
|
||||
__asm mov edx, VAR_TYPE_INT \
|
||||
__asm mov eax, ebx \
|
||||
__asm call fo::funcoffs::interpretPushShort_ \
|
||||
}
|
||||
|
||||
#define _J_RET_VAL_TYPE(type) __asm { \
|
||||
__asm call fo::funcoffs::interpretPushLong_ \
|
||||
__asm mov edx, type \
|
||||
__asm mov eax, ebx \
|
||||
__asm jmp fo::funcoffs::interpretPushShort_ \
|
||||
}
|
||||
@@ -16,8 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#include "Functions.h"
|
||||
#include "FunctionOffsets.h"
|
||||
@@ -33,11 +32,11 @@ namespace fo
|
||||
|
||||
static MessageNode messageBuf;
|
||||
|
||||
const char* _stdcall GetMessageStr(const MessageList* fileAddr, long messageId) {
|
||||
const char* GetMessageStr(const MessageList* fileAddr, long messageId) {
|
||||
return fo::func::getmsg(fileAddr, &messageBuf, messageId);
|
||||
}
|
||||
|
||||
const char* _stdcall MessageSearch(const MessageList* fileAddr, long messageId) {
|
||||
const char* MessageSearch(const MessageList* fileAddr, long messageId) {
|
||||
messageBuf.number = messageId;
|
||||
if (fo::func::message_search(fileAddr, &messageBuf) == 1) {
|
||||
return messageBuf.message;
|
||||
@@ -118,11 +117,11 @@ long GetCurrentAttackMode() {
|
||||
long activeHand = fo::var::itemCurrentItem; // 0 - left, 1 - right
|
||||
switch (fo::var::itemButtonItems[activeHand].mode) {
|
||||
case 1:
|
||||
case 2: // 2 - called shot
|
||||
case 2: // called shot
|
||||
hitMode = fo::var::itemButtonItems[activeHand].primaryAttack;
|
||||
break;
|
||||
case 3:
|
||||
case 4: // 4 - called shot
|
||||
case 4: // called shot
|
||||
hitMode = fo::var::itemButtonItems[activeHand].secondaryAttack;
|
||||
break;
|
||||
case 5: // reload mode
|
||||
@@ -145,6 +144,16 @@ long CheckAddictByPid(fo::GameObject* critter, long pid) {
|
||||
/* keyword 'return' is not needed, the compiler will do everything correctly */
|
||||
}
|
||||
|
||||
// Checks whether the player is under the influence of negative effects of radiation
|
||||
long __fastcall IsRadInfluence() {
|
||||
fo::QueueRadiation* queue = (fo::QueueRadiation*)fo::func::queue_find_first(fo::var::obj_dude, fo::radiation_event);
|
||||
while (queue) {
|
||||
if (queue->init && queue->level >= 2) return 1;
|
||||
queue = (fo::QueueRadiation*)fo::func::queue_find_next(fo::var::obj_dude, fo::radiation_event);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ToggleNpcFlag(fo::GameObject* npc, long flag, bool set) {
|
||||
Proto* protoPtr;
|
||||
if (fo::func::proto_ptr(npc->protoId, &protoPtr) != -1) {
|
||||
@@ -157,7 +166,7 @@ void ToggleNpcFlag(fo::GameObject* npc, long flag, bool set) {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the number of party members in the existing table (begins from 1)
|
||||
// Returns the position of party member in the existing table (begins from 1)
|
||||
long IsPartyMemberByPid(long pid) {
|
||||
size_t patryCount = fo::var::partyMemberMaxCount;
|
||||
if (patryCount) {
|
||||
@@ -169,6 +178,7 @@ long IsPartyMemberByPid(long pid) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Returns True if the NPC belongs to the player's potential (set in party.txt) party members (analog of broken isPotentialPartyMember_)
|
||||
bool IsPartyMember(fo::GameObject* critter) {
|
||||
if (critter->id < PLAYER_ID) return false;
|
||||
return (IsPartyMemberByPid(critter->protoId) > 0);
|
||||
@@ -181,90 +191,263 @@ long GetScriptLocalVars(long sid) {
|
||||
return (script) ? script->numLocalVars : 0;
|
||||
}
|
||||
|
||||
// Returns window ID by x/y coordinate (hidden windows are ignored)
|
||||
long __fastcall GetTopWindowID(long xPos, long yPos) {
|
||||
fo::Window* win = nullptr;
|
||||
long countWin = *(DWORD*)FO_VAR_num_windows - 1;
|
||||
for (int n = countWin; n >= 0; n--) {
|
||||
win = fo::var::window[n];
|
||||
if (xPos >= win->wRect.left && xPos <= win->wRect.right && yPos >= win->wRect.top && yPos <= win->wRect.bottom) {
|
||||
if (!(win->flags & fo::WinFlags::Hidden)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return win->wID;
|
||||
}
|
||||
|
||||
enum WinNameType {
|
||||
Inventory = 0, // any inventory window (player/loot/use/barter)
|
||||
Dialog = 1,
|
||||
PipBoy = 2,
|
||||
WorldMap = 3,
|
||||
IfaceBar = 4, // the interface bar
|
||||
Character = 5,
|
||||
Skilldex = 6,
|
||||
EscMenu = 7, // escape menu
|
||||
//Automap = 8 // for this window there is no global variable
|
||||
};
|
||||
|
||||
fo::Window* GetWindow(long winType) {
|
||||
long winID = 0;
|
||||
switch (winType) {
|
||||
case WinNameType::Inventory:
|
||||
winID = fo::var::i_wid;
|
||||
break;
|
||||
case WinNameType::Dialog:
|
||||
winID = fo::var::dialogueBackWindow;
|
||||
break;
|
||||
case WinNameType::PipBoy:
|
||||
winID = fo::var::pip_win;
|
||||
break;
|
||||
case WinNameType::WorldMap:
|
||||
winID = fo::var::wmBkWin;
|
||||
break;
|
||||
case WinNameType::IfaceBar:
|
||||
winID = fo::var::interfaceWindow;
|
||||
break;
|
||||
case WinNameType::Character:
|
||||
winID = fo::var::edit_win;
|
||||
break;
|
||||
case WinNameType::Skilldex:
|
||||
winID = fo::var::skldxwin;
|
||||
break;
|
||||
case WinNameType::EscMenu:
|
||||
winID = fo::var::optnwin;
|
||||
break;
|
||||
default:
|
||||
return (fo::Window*)-1;
|
||||
}
|
||||
return (winID > 0) ? fo::func::GNW_find(winID) : nullptr;
|
||||
}
|
||||
|
||||
// Returns an array of objects within the specified radius from the source tile
|
||||
void GetObjectsTileRadius(std::vector<fo::GameObject*> &objs, long sourceTile, long radius, long elev, long type) {
|
||||
for (long tile = 0; tile < 40000; tile++) {
|
||||
fo::GameObject* obj = fo::func::obj_find_first_at_tile(elev, tile);
|
||||
while (obj) {
|
||||
if (type == -1 || type == obj->Type()) {
|
||||
bool multiHex = (obj->flags & fo::ObjectFlag::MultiHex) ? true : false;
|
||||
if (fo::func::tile_dist(sourceTile, obj->tile) <= (radius + multiHex)) {
|
||||
objs.push_back(obj);
|
||||
}
|
||||
}
|
||||
obj = fo::func::obj_find_next_at_tile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the type of the terrain sub tile at the the player's position on the world map
|
||||
long wmGetCurrentTerrainType() {
|
||||
long* terrainId = *(long**)FO_VAR_world_subtile;
|
||||
if (terrainId == nullptr) {
|
||||
__asm {
|
||||
lea ebx, terrainId;
|
||||
mov edx, dword ptr ds:[FO_VAR_world_ypos];
|
||||
mov eax, dword ptr ds:[FO_VAR_world_xpos];
|
||||
call fo::funcoffs::wmFindCurSubTileFromPos_;
|
||||
}
|
||||
}
|
||||
return *terrainId;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//print text to surface
|
||||
void PrintText(char *DisplayText, BYTE ColourIndex, DWORD Xpos, DWORD Ypos, DWORD TxtWidth, DWORD ToWidth, BYTE *ToSurface) {
|
||||
DWORD posOffset = Ypos * ToWidth + Xpos;
|
||||
// copy the area from the interface buffer to the data array
|
||||
void SurfaceCopyToMem(long fromX, long fromY, long width, long height, long fromWidth, BYTE* fromSurface, BYTE* toMem) {
|
||||
fromSurface += fromY * fromWidth + fromX;
|
||||
long i = 0;
|
||||
for (long h = 0; h < height; h++) {
|
||||
for (long w = 0; w < width; w++) {
|
||||
toMem[i++] = fromSurface[w];
|
||||
}
|
||||
fromSurface += fromWidth;
|
||||
}
|
||||
}
|
||||
|
||||
// safe copy data from memory to the area of the interface buffer
|
||||
void DrawToSurface(long toX, long toY, long width, long height, long toWidth, long toHeight, BYTE* toSurface, BYTE* fromMem) {
|
||||
BYTE* _toSurface = toSurface + (toY * toWidth + toX);
|
||||
BYTE* endToSurf = (toWidth * toHeight) + toSurface;
|
||||
long i = 0;
|
||||
for (long h = 0; h < height; h++) {
|
||||
for (long w = 0; w < width; w++) {
|
||||
if (_toSurface + w > endToSurf) return;
|
||||
if (_toSurface >= toSurface) _toSurface[w] = fromMem[i++];
|
||||
}
|
||||
_toSurface += toWidth;
|
||||
}
|
||||
}
|
||||
|
||||
// safe copy data from surface to surface with mask
|
||||
void DrawToSurface(long width, long height, long fromX, long fromY, long fromWidth, BYTE* fromSurf,
|
||||
long toX, long toY, long toWidth, long toHeight, BYTE* toSurf, int maskRef)
|
||||
{
|
||||
BYTE* _fromSurf = fromSurf + (fromY * fromWidth + fromX);
|
||||
BYTE* _toSurf = toSurf + (toY * toWidth + toX);
|
||||
BYTE* endToSurf = (toWidth * toHeight) + toSurf;
|
||||
|
||||
for (long h = 0; h < height; h++) {
|
||||
for (long w = 0; w < width; w++) {
|
||||
if (_toSurf + w > endToSurf) return;
|
||||
if (_toSurf >= toSurf && _fromSurf[w] != maskRef) _toSurf[w] = _fromSurf[w];
|
||||
}
|
||||
_fromSurf += fromWidth;
|
||||
_toSurf += toWidth;
|
||||
}
|
||||
}
|
||||
|
||||
// safe copy data from surface to surface
|
||||
void DrawToSurface(long width, long height, long fromX, long fromY, long fromWidth, BYTE* fromSurf,
|
||||
long toX, long toY, long toWidth, long toHeight, BYTE* toSurf)
|
||||
{
|
||||
BYTE* _fromSurf = fromSurf + (fromY * fromWidth + fromX);
|
||||
BYTE* _toSurf = toSurf + (toY * toWidth + toX);
|
||||
BYTE* endToSurf = (toWidth * toHeight) + toSurf;
|
||||
|
||||
for (long h = 0; h < height; h++) {
|
||||
for (long w = 0; w < width; w++) {
|
||||
if (_toSurf + w > endToSurf) return;
|
||||
if (_toSurf >= toSurf) _toSurf[w] = _fromSurf[w];
|
||||
}
|
||||
_fromSurf += fromWidth;
|
||||
_toSurf += toWidth;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// print text to surface
|
||||
void PrintText(char* displayText, BYTE colorIndex, DWORD xPos, DWORD yPos, DWORD txtWidth, DWORD toWidth, BYTE* toSurface) {
|
||||
DWORD posOffset = yPos * toWidth + xPos;
|
||||
__asm {
|
||||
xor eax, eax;
|
||||
mov al, ColourIndex;
|
||||
mov al, colorIndex;
|
||||
mov edx, displayText;
|
||||
push eax;
|
||||
mov edx, DisplayText;
|
||||
mov ebx, TxtWidth;
|
||||
mov ecx, ToWidth;
|
||||
mov eax, ToSurface;
|
||||
mov ebx, txtWidth;
|
||||
mov eax, toSurface;
|
||||
mov ecx, toWidth;
|
||||
add eax, posOffset;
|
||||
call dword ptr ds:[FO_VAR_text_to_buf];
|
||||
}
|
||||
}
|
||||
|
||||
void PrintTextFM(char* displayText, BYTE colorIndex, DWORD xPos, DWORD yPos, DWORD txtWidth, DWORD toWidth, BYTE* toSurface) {
|
||||
DWORD posOffset = yPos * toWidth + xPos;
|
||||
__asm {
|
||||
xor eax, eax;
|
||||
mov al, colorIndex;
|
||||
mov edx, displayText;
|
||||
push eax;
|
||||
mov ebx, txtWidth;
|
||||
mov eax, toSurface;
|
||||
mov ecx, toWidth;
|
||||
add eax, posOffset;
|
||||
call fo::funcoffs::FMtext_to_buf_;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//gets the height of the currently selected font
|
||||
DWORD GetTextHeight() {
|
||||
DWORD TxtHeight;
|
||||
// DWORD TxtHeight;
|
||||
__asm {
|
||||
call dword ptr ds:[FO_VAR_text_height]; //get text height
|
||||
mov TxtHeight, eax;
|
||||
// mov TxtHeight, eax;
|
||||
}
|
||||
return TxtHeight;
|
||||
// return TxtHeight;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//gets the length of a string using the currently selected font
|
||||
DWORD GetTextWidth(char *TextMsg) {
|
||||
DWORD TxtWidth;
|
||||
DWORD GetTextWidth(const char* TextMsg) {
|
||||
__asm {
|
||||
mov eax, TextMsg;
|
||||
call dword ptr ds:[FO_VAR_text_width]; //get text width
|
||||
mov TxtWidth, eax;
|
||||
}
|
||||
return TxtWidth;
|
||||
}
|
||||
|
||||
DWORD GetTextWidthFM(const char* TextMsg) {
|
||||
return fo::func::FMtext_width(TextMsg); //get text width
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//get width of Char for current font
|
||||
DWORD GetCharWidth(char CharVal) {
|
||||
DWORD charWidth;
|
||||
DWORD GetCharWidth(char charVal) {
|
||||
__asm {
|
||||
mov al, CharVal;
|
||||
mov al, charVal;
|
||||
call dword ptr ds:[FO_VAR_text_char_width];
|
||||
mov charWidth, eax;
|
||||
}
|
||||
return charWidth;
|
||||
}
|
||||
|
||||
DWORD GetCharWidthFM(char charVal) {
|
||||
__asm {
|
||||
mov al, charVal;
|
||||
call fo::funcoffs::FMtext_char_width_;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//get maximum string length for current font - if all characters were maximum width
|
||||
DWORD GetMaxTextWidth(char *TextMsg) {
|
||||
DWORD msgWidth;
|
||||
DWORD GetMaxTextWidth(const char* TextMsg) {
|
||||
// DWORD msgWidth;
|
||||
__asm {
|
||||
mov eax, TextMsg;
|
||||
call dword ptr ds:[FO_VAR_text_mono_width];
|
||||
mov msgWidth, eax;
|
||||
// mov msgWidth, eax;
|
||||
}
|
||||
return msgWidth;
|
||||
// return msgWidth;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//get number of pixels between characters for current font
|
||||
DWORD GetCharGapWidth() {
|
||||
DWORD gapWidth;
|
||||
// DWORD gapWidth;
|
||||
__asm {
|
||||
call dword ptr ds:[FO_VAR_text_spacing];
|
||||
mov gapWidth, eax;
|
||||
// mov gapWidth, eax;
|
||||
}
|
||||
return gapWidth;
|
||||
// return gapWidth;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//get maximum character width for current font
|
||||
DWORD GetMaxCharWidth() {
|
||||
DWORD charWidth = 0;
|
||||
// DWORD charWidth = 0;
|
||||
__asm {
|
||||
call dword ptr ds:[FO_VAR_text_max];
|
||||
mov charWidth, eax;
|
||||
// mov charWidth, eax;
|
||||
}
|
||||
return charWidth;
|
||||
// return charWidth;
|
||||
}
|
||||
|
||||
void RedrawObject(GameObject* obj) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Functions.h"
|
||||
|
||||
@@ -36,10 +37,10 @@ inline void DisplayPrint(const std::string& str) {
|
||||
}
|
||||
|
||||
// returns message string from given file or "Error" when not found
|
||||
const char* _stdcall GetMessageStr(const MessageList* fileAddr, long messageId);
|
||||
const char* GetMessageStr(const MessageList* fileAddr, long messageId);
|
||||
|
||||
// similar to GetMessageStr, but returns nullptr when no message is found
|
||||
const char* _stdcall MessageSearch(const MessageList* fileAddr, long messageId);
|
||||
const char* MessageSearch(const MessageList* fileAddr, long messageId);
|
||||
|
||||
// returns pointer to prototype by PID, or nullptr on failure
|
||||
Proto* GetProto(long pid);
|
||||
@@ -66,28 +67,57 @@ bool HeroIsFemale();
|
||||
|
||||
long CheckAddictByPid(fo::GameObject* critter, long pid);
|
||||
|
||||
// Checks whether the player is under the influence of negative effects of radiation
|
||||
long __fastcall IsRadInfluence();
|
||||
|
||||
void ToggleNpcFlag(fo::GameObject* npc, long flag, bool set);
|
||||
|
||||
// Returns the number of party members in the existing table (begins from 1)
|
||||
// Returns the position of party member in the existing table (begins from 1)
|
||||
long IsPartyMemberByPid(long pid);
|
||||
|
||||
// Returns True if the NPC belongs to the player's potential (set in party.txt) party members (analog of broken isPotentialPartyMember_)
|
||||
bool IsPartyMember(fo::GameObject* critter);
|
||||
|
||||
// Returns the number of local variables of the object script
|
||||
long GetScriptLocalVars(long sid);
|
||||
|
||||
long __fastcall GetTopWindowID(long xPos, long yPos);
|
||||
|
||||
fo::Window* GetWindow(long winType);
|
||||
|
||||
void GetObjectsTileRadius(std::vector<fo::GameObject*> &objs, long sourceTile, long radius, long elev, long type = -1);
|
||||
|
||||
long wmGetCurrentTerrainType();
|
||||
|
||||
void SurfaceCopyToMem(long fromX, long fromY, long width, long height, long fromWidth, BYTE* fromSurface, BYTE* toMem);
|
||||
|
||||
void DrawToSurface(long toX, long toY, long width, long height, long toWidth, long toHeight, BYTE* toSurface, BYTE* fromMem);
|
||||
|
||||
void DrawToSurface(long width, long height, long fromX, long fromY, long fromWidth, BYTE* fromSurf, long toX, long toY, long toWidth, long toHeight, BYTE* toSurf, int maskRef);
|
||||
|
||||
void DrawToSurface(long width, long height, long fromX, long fromY, long fromWidth, BYTE* fromSurf, long toX, long toY, long toWidth, long toHeight, BYTE* toSurf);
|
||||
|
||||
// Print text to surface
|
||||
void PrintText(char *displayText, BYTE colorIndex, DWORD x, DWORD y, DWORD textWidth, DWORD destWidth, BYTE *surface);
|
||||
void PrintText(char* displayText, BYTE colorIndex, DWORD xPos, DWORD yPos, DWORD txtWidth, DWORD toWidth, BYTE* toSurface);
|
||||
void PrintTextFM(char* displayText, BYTE colorIndex, DWORD xPos, DWORD yPos, DWORD txtWidth, DWORD toWidth, BYTE* toSurface);
|
||||
|
||||
// gets the height of the currently selected font
|
||||
DWORD GetTextHeight();
|
||||
|
||||
// gets the length of a string using the currently selected font
|
||||
DWORD GetTextWidth(char *textMsg);
|
||||
DWORD GetTextWidth(const char* textMsg);
|
||||
DWORD GetTextWidthFM(const char* textMsg);
|
||||
|
||||
// get width of Char for current font
|
||||
DWORD GetCharWidth(char charVal);
|
||||
DWORD GetCharWidthFM(char charVal);
|
||||
|
||||
// get maximum string length for current font - if all characters were maximum width
|
||||
DWORD GetMaxTextWidth(char *textMsg);
|
||||
DWORD GetMaxTextWidth(const char* textMsg);
|
||||
|
||||
// get number of pixels between characters for current font
|
||||
DWORD GetCharGapWidth();
|
||||
|
||||
// get maximum character width for current font
|
||||
DWORD GetMaxCharWidth();
|
||||
|
||||
|
||||
+86
-19
@@ -90,6 +90,33 @@ enum Animation : long
|
||||
ANIM_called_shot_pic = 64,
|
||||
};
|
||||
|
||||
enum AnimCommand : long
|
||||
{
|
||||
RB_UNRESERVED = 0x1,
|
||||
RB_RESERVED = 0x2,
|
||||
RB_DONTSTAND = 0x4,
|
||||
RB_UNKNOWN = 0x100,
|
||||
RB_END_ANIM = 0x200
|
||||
};
|
||||
|
||||
enum CritterFlags : long
|
||||
{
|
||||
Sneak = 0x01, // Can sneak ?
|
||||
Barter = 0x02, // Can trade with
|
||||
Level = 0x04, // Level received ?
|
||||
Addict = 0x08, // Drug addiction ?
|
||||
NoSteal = 0x20, // Can't be stolen from
|
||||
NoDrop = 0x40, // Doesn't drop items
|
||||
NoLimbs = 0x80, // Can't lose limbs
|
||||
NoAges = 0x100, // Dead body does not disappear
|
||||
NoHeal = 0x200, // Damage is not healed with time
|
||||
Invulnerable = 0x400, // Is Invulnerable (cannot be hurt)
|
||||
NoFlatten = 0x800, // Doesn't flatten on death (leaves no dead body)
|
||||
SpecialDeath = 0x1000, // Has a special type of death
|
||||
RangeHtH = 0x2000, // Has extra hand-to-hand range
|
||||
NoKnockBack = 0x4000, // Can't be knocked back
|
||||
};
|
||||
|
||||
enum DamageFlag : long
|
||||
{
|
||||
DAM_KNOCKED_OUT = 0x1,
|
||||
@@ -226,7 +253,7 @@ enum ArtType : char
|
||||
// Some FO2 PIDs possibly used by engine
|
||||
enum ProtoId : long
|
||||
{
|
||||
PID_ROCK = 19,
|
||||
// PID_ROCK = 19,
|
||||
PID_SMALL_ENERGY_CELL = 38,
|
||||
PID_MICRO_FUSION_CELL = 39,
|
||||
PID_STIMPAK = 40,
|
||||
@@ -238,8 +265,8 @@ enum ProtoId : long
|
||||
PID_GEIGER_COUNTER = 52,
|
||||
PID_MENTATS = 53,
|
||||
PID_STEALTH_BOY = 54,
|
||||
PID_WATER_CHIP = 55,
|
||||
PID_HOLODISK = 58,
|
||||
// PID_WATER_CHIP = 55,
|
||||
// PID_HOLODISK = 58,
|
||||
PID_MOTION_SENSOR = 59,
|
||||
PID_MUTATED_FRUIT = 71,
|
||||
PID_BIG_BOOK_OF_SCIENCE = 73,
|
||||
@@ -250,7 +277,7 @@ enum ProtoId : long
|
||||
PID_SCOUT_HANDBOOK = 86,
|
||||
PID_BUFFOUT = 87,
|
||||
PID_DOCTORS_BAG = 91,
|
||||
PID_PUMP_PARTS = 98,
|
||||
// PID_PUMP_PARTS = 98,
|
||||
PID_GUNS_AND_BULLETS = 102,
|
||||
PID_NUKA_COLA = 106,
|
||||
PID_RAD_X = 109,
|
||||
@@ -269,7 +296,8 @@ enum ProtoId : long
|
||||
PID_JET = 259,
|
||||
PID_JET_ANTIDOTE = 260,
|
||||
PID_DECK_OF_TRAGIC_CARDS = 306,
|
||||
PID_GECK = 366,
|
||||
// PID_GECK = 366,
|
||||
PID_SOLAR_SCORCHER = 390,
|
||||
PID_CAR_TRUNK = 455,
|
||||
PID_JESSE_CONTAINER = 467,
|
||||
|
||||
@@ -445,15 +473,6 @@ enum class ScenerySubType : long
|
||||
GENERIC = 5
|
||||
};
|
||||
|
||||
enum ScriptTypes
|
||||
{
|
||||
SCRIPT_SYSTEM = 0,
|
||||
SCRIPT_SPATIAL = 1,
|
||||
SCRIPT_TIME = 2,
|
||||
SCRIPT_ITEM = 3,
|
||||
SCRIPT_CRITTER = 4,
|
||||
};
|
||||
|
||||
// proto.h: stats //
|
||||
|
||||
enum Stat : long
|
||||
@@ -505,8 +524,9 @@ enum Stat : long
|
||||
STAT_real_max_stat = 38
|
||||
};
|
||||
|
||||
namespace ScriptProc {
|
||||
enum ScriptProc : long {
|
||||
namespace Scripts {
|
||||
enum ScriptProc : long
|
||||
{
|
||||
no_p_proc = 0,
|
||||
start = 1,
|
||||
spatial_p_proc = 2,
|
||||
@@ -537,10 +557,19 @@ namespace ScriptProc {
|
||||
combat_is_over_p_proc = 27,
|
||||
count = 28
|
||||
};
|
||||
|
||||
enum ScriptTypes : long
|
||||
{
|
||||
SCRIPT_SYSTEM = 0,
|
||||
SCRIPT_SPATIAL = 1,
|
||||
SCRIPT_TIME = 2,
|
||||
SCRIPT_ITEM = 3,
|
||||
SCRIPT_CRITTER = 4,
|
||||
};
|
||||
}
|
||||
|
||||
#define STAT_max_derived STAT_poison_resist
|
||||
#define STAT_max_stat STAT_current_hp
|
||||
#define STAT_max_stat STAT_current_hp
|
||||
|
||||
// Script data types
|
||||
#define VAR_TYPE_INT (0xC001)
|
||||
@@ -645,7 +674,33 @@ enum BodyType : long
|
||||
Robotic = 2
|
||||
};
|
||||
|
||||
#define PLAYER_ID (18000)
|
||||
enum KillType : long
|
||||
{
|
||||
KILL_TYPE_men = 0,
|
||||
KILL_TYPE_women = 1,
|
||||
KILL_TYPE_children = 2,
|
||||
KILL_TYPE_super_mutant = 3,
|
||||
KILL_TYPE_ghoul = 4,
|
||||
KILL_TYPE_brahmin = 5,
|
||||
KILL_TYPE_radscorpion = 6,
|
||||
KILL_TYPE_rat = 7,
|
||||
KILL_TYPE_floater = 8,
|
||||
KILL_TYPE_centaur = 9,
|
||||
KILL_TYPE_robot = 10,
|
||||
KILL_TYPE_dog = 11,
|
||||
KILL_TYPE_manti = 12,
|
||||
KILL_TYPE_deathclaw = 13,
|
||||
KILL_TYPE_plant = 14,
|
||||
KILL_TYPE_gecko = 15,
|
||||
KILL_TYPE_alien = 16,
|
||||
KILL_TYPE_giant_ant = 17,
|
||||
KILL_TYPE_big_bad_boss = 18,
|
||||
KILL_TYPE_count
|
||||
};
|
||||
|
||||
enum {
|
||||
PLAYER_ID = 18000
|
||||
};
|
||||
|
||||
#define OBJFLAG_CAN_WEAR_ITEMS (0xF000000)
|
||||
|
||||
@@ -661,6 +716,8 @@ enum BodyType : long
|
||||
|
||||
#define AUTOMAP_MAX (160)
|
||||
|
||||
#define MSG_GENDER_CHECK_FLG (0x80) // bit 8
|
||||
|
||||
enum TicksTime : unsigned long
|
||||
{
|
||||
ONE_GAME_YEAR = 315360000
|
||||
@@ -739,7 +796,7 @@ namespace WinFlags {
|
||||
Transparent = 0x20,
|
||||
UnknownFlag40 = 0x40,
|
||||
UnknownFlag80 = 0x80,
|
||||
scriptWindow = 0x100,
|
||||
ScriptWindow = 0x100,
|
||||
itsButton = 0x10000,
|
||||
};
|
||||
}
|
||||
@@ -762,4 +819,14 @@ enum QueueType : long
|
||||
gsound_sfx_event = 13 // no object
|
||||
};
|
||||
|
||||
enum DialogOutFlags : long
|
||||
{
|
||||
DIALOGOUT_NORMAL = 0x01, // uses regular graphic
|
||||
DIALOGOUT_SMALL = 0x02, // uses smaller graphic
|
||||
DIALOGOUT_ALIGN_LEFT = 0x04, // text aligned to left
|
||||
DIALOGOUT_ALIGN_TOP = 0x08, // text aligned to top
|
||||
DIALOGOUT_YESNO = 0x10, // DONE button replaced by YES/NO buttons
|
||||
DIALOGOUT_CLEAN = 0x20 // no buttons
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user