Compare commits

..
75 Commits
Author SHA1 Message Date
NovaRain fe5f4bb2aa Changed the fix for multihex critter moving in combat to a more proper one (from Mr.Stalin)
Added AIBestWeaponFix option to ddraw.ini.
2018-09-02 18:08:37 +08:00
NovaRain 715b55dda8 Fixed multihex critters moving too close and overlapping their targets in combat (from Crafty)
Fixed critters not checking weapon perks properly when searching for the best weapon (from Mr.Stalin)
Changed BugFixes module to be initialized at the beginning.
2018-08-21 07:19:51 +08:00
NovaRain 1d7fd442b0 Minor edits to sfall-mods.ini. 2018-08-19 00:41:50 +08:00
NovaRain 9f0797f8ad Added extra comment for CarChargingFix to ddraw.ini. 2018-08-14 23:58:09 +08:00
NovaRain ccd897281f Fixed obj_can_see_obj not checking if source and target objects are on the same elevation before calling is_within_perception_ (from Mr.Stalin) 2018-08-10 22:54:07 +08:00
NovaRain d200262a2b Added a fix for the display issue in the pipboy when a quest list is too long with UseScrollingQuestsList diabled (from Mr.Stalin)
Added a fix for the clickability issue of holodisk list in the pipboy (from Mr.Stalin)
2018-08-06 22:04:21 +08:00
NovaRain d0c97f7118 Fixed an issue with file IDs of additional game msg files being shifted when a file in ExtraGameMsgFileList is missing.
Minor edit to the description of CityRepsList in ddraw.ini, to avoid misunderstanding.
Updated version number.
2018-07-28 22:46:59 +08:00
NovaRain 41c8722179 Merged a couple of fixes and minor improvements for 4.0.x from the develop branch:
* Fixed the game thinking you dropped an active explosive when the dropping is prevented with hs_inventorymove.
* Added "inventory_redraw" script function (from Mr.Stalin)
* NPC combat control mod now centers the screen on the controlled critter and has new options to display critter's name.
* Removed obsoleted WIN2K preprocessor defines.
Updated version number.
2018-07-16 09:14:01 +08:00
NovaRain 1b3b5dc523 Fixed premature assignment of arguments before the beginning of the hooks in InventoryHs.cpp. (#173)
(cherry picked from commit fff48407c3)
Updated version number.
2018-06-24 12:36:01 +08:00
NovaRain 8c2483a289 Merge branch 'develop' 2018-06-12 21:01:12 +08:00
NovaRain e14ac89463 Added more info to the comments of various keys in [Input] section of ddraw.ini. 2018-06-12 20:52:03 +08:00
Mr.StalinandNovaRain d5a38eb3aa Fix for inventory moving hook - an item drop into container when it is in the slot of the hands. (#167) 2018-06-12 12:13:42 +08:00
NovaRain 177137f2ee Edited the description in hookscripts.txt for changes to HOOK_INVENTORYMOVE and HOKK_INVENWIELD.
Fixed a bug in DisplaySecondWeaponRange that didn't display correct weapon range when the secondary mode is aimed (e.g. spear and throwing knife)
Removed trilling spaces in previous commit.
2018-06-11 13:40:09 +08:00
Mr.StalinandNovaRain 76f88eae18 Added new events to HOOK_INVENTORYMOVE. Added possible to get a pointer to an weapon item in HOOK_INVENWIELD before unweld it. (#163)
Refactoring the hooks code of the inventory.
2018-06-11 13:14:52 +08:00
NovaRain 28962f428f Added ItemFastMoveKey and ItemCounterDefaultMax options to ddraw.ini.
Set ReloadReserve to be disabled by default.
2018-06-06 06:33:46 +08:00
Mr.StalinandNovaRain aaa76cb3d1 Quickly moving items in inventory. (#162)
* Added an option for quickly moving items (w/o dialog box) in inventory.

* An separate option is added to set the counter of maximum number of items when moving items.
2018-06-06 06:23:07 +08:00
NovaRain ea1c00ec91 Added the ability to define allowed weapon animations for NPCs to NPC armor appearance mod (#159) 2018-06-05 22:08:39 +08:00
NovaRain 410c7ab417 Minor edits to documents. 2018-06-04 21:21:32 +08:00
VladandNovaRain ab3ddc68b6 Retarget project to use VS2017 build tools, fix deprecation warnings (#161) 2018-06-03 16:35:08 +08:00
NovaRain 1652072391 Fixed a bug that critters killed in combat by scripting still being able to move in their combat turn if the distance parameter in their AI packages is set to stay_close/charge, or NPCsTryToSpendExtraAP is enabled (from Mr.Stalin) 2018-06-02 18:15:53 +08:00
NovaRain 051b1c98aa Edited the added comments in AnimationsAtOnceLimit.cpp.
Renamed obj_move_hack to object_move_hack because it hooks on object_move_ engine function.
2018-06-01 23:36:56 +08:00
Mr.StalinandNovaRain 56945c7437 Fixed crash game when playing animation when the critter/pc goes through the door. Refactoring code. (#158) 2018-06-01 23:30:37 +08:00
NovaRain 2f6f0d8b28 Added the description of new metarule2_explosions mode to function notes.txt.
Fixed a typo in metarule2_explosions error message.
2018-05-30 21:07:51 +08:00
Mr.StalinandNovaRain 0e715236bf Added an additional mode to the function 'metarule2_explosions', sets a constant radius of the explosion grenades and rockets. (#146) 2018-05-30 21:02:35 +08:00
NovaRain b24a860d40 Renamed WorldMapFont to WorldMapFontPatch and changed its description in ddraw.ini. 2018-05-30 09:27:58 +08:00
NovaRain 120a8cd964 Added WorldMapFont option to use Fallout font on the world map instead of system font. (#48) 2018-05-29 16:22:58 +08:00
Mr.StalinandNovaRain 62d4577152 Adding to the function get_mouse_buttons the return of pressing the middle mouse button (#114). (#157)
Change the type of argument checking for the len_array function to remove an unwanted error message (# 128).
2018-05-29 09:29:11 +08:00
NovaRain 2d8ea2b44c Added description of HOOK_GAMEMODECHANGE to hookscripts.txt.
Fixed the line break for debug.log message of GameReset.
Minor edits to Tiles.cpp code format.
2018-05-28 23:37:45 +08:00
Mr.StalinandNovaRain 4ef20c3526 Added new hook for function get_game_mode, when the game mode changes. (#86) (#153) 2018-05-28 23:32:14 +08:00
NovaRain 5e0e8dd2f1 Added MoreTiles option to ddraw.ini.
Changed MoreTiles to work independently of HRP 4.1.8 and removed the redundant define.
Added sfall log messages to both options in Tiles.cpp.
Implemented HookCalls in TimeLimitPatch().
Fixed a minor typo in function notes.txt.
2018-05-28 09:27:53 +08:00
Mr.StalinandNovaRain 04bd88cdc2 Added MoreTiles option to increase the limit of FRM images for tiles from 4096 to 16383 (from Crafty) (#156) 2018-05-28 09:18:55 +08:00
NovaRain 839e86ed26 Added the description and setting for the previous commit to ddraw.ini.
Improved DisablePipboyAlarm so that when the player press Z key they won't see a blank Pipboy screen.
2018-05-27 15:08:46 +08:00
Mr.StalinandNovaRain eeef8759d3 Display statistics of the weapon's range for the second attack mode in player inventory. (#154) 2018-05-27 14:48:09 +08:00
NovaRain c4903abd4c Added the description of set_iface_tag_text to notes.txt.
Fixed compilation error in BarBoxes.cpp.
Updated version number.
2018-05-21 10:51:12 +08:00
Mr.StalinandNovaRain e0c0b9ba19 Added function 'set_iface_tag_text' - sets custom text and color to bar boxes. (#152) 2018-05-21 10:41:59 +08:00
NovaRain b9c7f5ea82 Fixed commit 470a0b3386. 2018-05-15 20:20:07 +08:00
NovaRain 56fdec8b37 Reverted the previous changes of ASM code due to the bug that AppChCrt.frm overwrites AppChEdt.frm. 2018-05-14 21:14:50 +08:00
NovaRain 470a0b3386 Simplified the code from previous commit. 2018-05-14 20:52:26 +08:00
NovaRain 279c524da9 Added support for adding custom background image to the character creation/screen of the hero appearance mod (From Mr.Stalin)
AppChCrt.frm (for the character creation) and AppChEdt.frm (for the character screen) should be in art/intrface, and the image size must be 640x480.
2018-05-14 10:05:49 +08:00
NovaRain 57c4c0bd5d Merge branch 'develop' 2018-05-11 20:01:53 +08:00
NovaRain 3ff0e77c26 Added the description of attack_is_aimed to notes.txt.
Removed unnecessary function declaration in Misc.h.
2018-05-09 10:07:11 +08:00
mr.StalinandNovaRain 15909dbb5b Fixed function "get_attack_type" and new function "attack_is_aimed". (#145)
* Fixed broken function 'get_attack_type'. Adding a new function 'attack_is_aimed'.
2018-05-09 10:03:07 +08:00
NovaRain ee9010217e Added description of HOOK_RESTTIMER, set_rest_heal_time, and set_rest_mode to documents.
Renamed the bit flags for set_rest_mode.
Fixed compilation error in Worldmap.cpp.
2018-05-08 12:30:53 +08:00
mr.StalinandNovaRain 9fa59a0d75 Rest hook and functions (#144)
* Added new HOOK_RESTTIMER (#89)

* Added "set_rest_mode" and "set_rest_heal_time" script functions.
2018-05-08 12:18:44 +08:00
NovaRain 371a299640 Added new HOOK_SETGLOBALVAR (#34) (from Mr.Stalin) 2018-05-02 11:14:02 +08:00
NovaRain 31f42128e1 Added "floor2" script function to work with ceil (#109)
Added the missing description of ceil to notes.txt.
Disabled ceil marco in lib.math.h.
Removed duplications in Utils.h.
2018-04-28 11:07:37 +08:00
NovaRain 57225bbd38 Fixed max tile number for set_map_enter_position and compilation error in Worldmap.cpp.
Added the description of get/set_map_enter_position to function notes.
2018-04-27 19:40:23 +08:00
mr.StalinandNovaRain 310d029801 New *_map_enter_position functions. (#141)
Added "get/set_map_enter_position" script functions (#101)
2018-04-27 19:35:29 +08:00
NovaRain b52f4544c0 Fixed the last additional notification boxes to the interface being missing (#140) 2018-04-26 10:01:15 +08:00
NovaRain 0950efec8c Changed the upper limit of set_unjam_locks_time to 127.
Added set_unjam_locks_time to documents.
2018-04-25 20:00:49 +08:00
NovaRain d86794be3a Added "set_unjam_locks_time" script function (from Mr.Stalin) 2018-04-24 09:20:16 +08:00
NovaRain d6aff61607 Added "lock_is_jammed" and "unjam_lock" script functions. 2018-04-24 08:13:26 +08:00
NovaRain 0eeab768bd Fixed a bug in item highlighting that caused items to be kept highlighted when entering combat while holding the highlight key. 2018-04-22 11:06:36 +08:00
NovaRain e474ba1660 Updated README.txt for info about additional headers/libraries. 2018-04-21 09:18:51 +08:00
NovaRain 3abebb8486 Added a new script function: set_ini_setting (from Mr.Stalin) (#85)
Added set_ini_setting to documents, and updated info for get_ini_setting.
Updated credits.
Replacing a couple of strcpy usages with strcpy_s.
2018-04-21 09:01:27 +08:00
NovaRain 29910e98bf Revert "Fixed a bug when using HOOK_ITEMDAMAGE and calling item_w_damage_ engine function at the same time. It would result in player self-damaging when attacking targets."
This reverts commit 4194feafdf.
2018-04-13 20:42:09 +08:00
NovaRain 4194feafdf Fixed a bug when using HOOK_ITEMDAMAGE and calling item_w_damage_ engine function at the same time. It would result in player self-damaging when attacking targets.
Set DataLoadOrderPatch to be enabled by default, for preventing partial of a game crash issue due to unusual game folder setup. #136
2018-04-13 11:06:21 +08:00
NovaRain 1c6729a25f Added a fix for being at incorrect hex after map change when the exit hex in source map is at the same position as some exit hex in destination map (from Crafty) #134 2018-04-02 23:19:07 +08:00
NovaRain 39388fd927 Rewrote the fix for player's base EMP DR as an engine-level fix (from Crafty) 2018-04-01 12:45:30 +08:00
NovaRain 72093079c5 Fixed a bug in NPC combat control that caused Gecko Skinning to appear in the perk selection window. 2018-03-28 21:29:22 +08:00
NovaRain 5141ca4ebb Fixed typos in hookscripts.txt. 2018-03-23 23:08:42 +08:00
NovaRain 78e9f08682 Fixed typos in sfall function notes.txt. 2018-03-23 22:01:22 +08:00
NovaRain ce779b4764 Fixed the long existing slotdat.ini function in ExtraSaveSlots.
Reduced duplication in ExtraSaveSlots code using MakeCalls.
Unified the indent style in ExtraSaveSlots.cpp.
2018-03-16 12:25:12 +08:00
NovaRain 1a108cade5 Implemented MakeCalls function to reduce code duplication.
Updated version number.
2018-03-16 11:32:23 +08:00
NovaRain cc875291d1 Merge branch 'develop' 2018-02-13 09:50:43 +08:00
NovaRain 9e28f8bdfd Lined up some code in MiscPatches.cpp. 2018-02-12 21:07:02 +08:00
NovaRain b2894268f6 Reverted item highlighting mod to the previous status (commit 90485a205a). #132 2018-01-28 18:15:35 +08:00
NovaRain b3e2b8b5b8 Rearranged and simplified gl_highlighting.ssl from the previous commit a bit. 2018-01-17 21:22:37 +08:00
burner1024andNovaRain 3227966767 More highlighting (#130)
* allow to highlight alive critters

* allow to ignore NO_HIGHLIGHT flag

* don't highlight while in loot screen, so that it's not constantly toggled by shift-A ("Take All" hotkey)
2018-01-17 13:55:22 +08:00
NovaRain 9475b8c482 Fixed add_mult_objs_to_inven only adding 500 of an object when the value of "count" argument is over 99999. #129 2018-01-17 07:36:05 +08:00
NovaRain 8b356b1213 Fixed broken ExtraGameMsgFileList option. #127 2018-01-11 07:42:50 +08:00
NovaRain 90485a205a Changed item highlighting mod to only highlight lootable corpses. #126 2018-01-07 21:37:26 +08:00
NovaRain d5be2fdc9b Made sure the value of player's base EMP DR is set correctly. 2018-01-02 23:22:45 +08:00
NovaRain a705341e02 Updated version number and the year. 2018-01-02 10:16:32 +08:00
NovaRain ca3f59ad1e Fixed a bug in NPC combat control that kept increasing the perk rank of Gecko Skinning after the combat ended.
Condensed the code in ApplyHeaveHoFix a bit.
2018-01-02 09:58:30 +08:00
73 changed files with 2081 additions and 885 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
[sfall]
SaveInCombat=Cannot save at this time
SaveInCombat=Cannot save at this time.
KarmaGain=You gained %d karma.
KarmaLoss=You lost %d karma.
HighlightFail1=You aren't carrying a motion sensor.
+6
View File
@@ -19,6 +19,7 @@ Robe=16777218
; Sulik
[1]
PID=16777313
WeaponAnims=1,3,4,6
Default=16777280
Leather=16777325
Power=16777324
@@ -29,6 +30,7 @@ Combat=16777322
; Vic
[2]
PID=16777278
WeaponAnims=1,5,7
Default=16777307
Jacket=16777329
Combat=16777330
@@ -39,6 +41,7 @@ Leather=16777333
; Cassidy
[3]
PID=16777305
WeaponAnims=4,5,7
Default=16777354
Leather=16777260
Power=16777328
@@ -49,6 +52,7 @@ Combat=16777326
; Myron
[4]
PID=16777376
WeaponAnims=1,5
Default=16777304
Leather=
Power=16777349
@@ -57,6 +61,7 @@ Combat=16777350
; Cat Jules
[5]
PID=16777734
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777353
Leather=16777347
Metal=16777348
@@ -66,6 +71,7 @@ Combat=16777226
; Kitsune
[6]
PID=16777724
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777222
Leather=16777221
Metal=16777223
+18 -4
View File
@@ -1,14 +1,14 @@
[Highlighting]
; DX scandode of a key to press to highlight items on the ground
; DX scancode of a key to press to highlight items on the ground
; 42 - SHIFT key
Key=42
; Set to 1 to also highlight containers
Containers=1
Containers=0
; Set to 1 to also highlight corpses
Corpses=1
; Set to 1 to also highlight lootable corpses
Corpses=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=0
@@ -38,3 +38,17 @@ MotionScanner=0
;If you want to control only specific critters, uncomment the PIDList line and set a comma delimited list of PIDs
Mode=0
;PIDList=62,89,97,107,160,161
;Choose a notification box to display the name of the controlled critter above the interface bar. Must be between 5 and 9
;Set to 0 to disable
DisplayName=0
;Set the color of display name, available colors:
;0 - green
;1 - red
;2 - white
;3 - yellow
;4 - dark yellow
;5 - blue
;6 - purple
DisplayNameColor=0
+33 -10
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.0.2
;v4.0.8
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -107,7 +107,7 @@ SpeedModKey=-1
;A key to press to toggle the speed tweak on or off
;Specify 0 if you don't want a toggle key, or a DX scancode otherwise
SpeedToggleKey=0x00
SpeedToggleKey=0
;The keys corresponding to the 10 speed slots
;Set to 0 to disable a slot, otherwise specify the DX scancode of the key you want to use
@@ -128,9 +128,15 @@ SpeedKey9=0x00
WindowScrollKey=0
;A key to press to reload your currently equipped weapon
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
ReloadWeaponKey=0
;A key to press to open a debug game editor
;A key to hold down to let you move/drop a whole stack of items at once without the 'Move Items' window
;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise
ItemFastMoveKey=0x1d
;A key to press to open a debug game editor (requires FalloutClient.exe from the modders pack)
;Set to 0 to disable, or a DX scancode otherwise
DebugEditorKey=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -164,7 +170,7 @@ WorldMapEncounterRate=5
;The number of slots available in the locations list panel of the world map
;Set to 0 to leave unchanged. 17 is default.
;Setting this greater than 17 requires a replacement background frm, or you'll get glitched graphics
;Setting this greater than 17 requires a replacement background FRM, or you'll get glitched graphics
WorldMapSlots=0
;To start a new game somewhere other than artemple.map, uncomment the next line and set it to the map you want to load
@@ -184,7 +190,7 @@ WorldMapSlots=0
;PatchFile=patch%03d.dat
;MultiPatches=0
;Set to 1 to enable the modified data load order for the engine to find game data
;Set to 1 to use the modified data load order for the engine to find game data
;Original: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat
;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
DataLoadOrderPatch=0
@@ -288,7 +294,7 @@ SaveInCombatFix=1
;Player's level is capped once the highest specified level is reached
;XPTable=50,100,200
;Set to 1 to enable additional weapon animations codes from o-t
;Set to 1 to enable additional weapon animation codes from o-t
;The 4 byte value at 0x39 of weapon protos may range from 0 to 15 rather than 0 to 10
;Since the letters 'n' and 'r' are in use for other animations, an animation code of 11 corrisponds to 's' and 15 to 't'
AdditionalWeaponAnims=1
@@ -339,12 +345,19 @@ SkipOpeningMovies=0
;Set to 0 to disable
NPCsTryToSpendExtraAP=0
;Set to 1 to fix NPCs not checking weapon perks properly when searching for the best weapon
;Note that enabling this option can significantly affect the weapon choice of some NPCs in combat
AIBestWeaponFix=0
;Allows the use of tiles over 80*36 in size. sfall will just split and resave them at startup
;Set to 1 to check all tiles on started (slow)
;Set to 2 if you provide a XLtiles.lst file in art/tiles/ containing a list of the tile ids that need checking
AllowLargeTiles=0
;Change the Skilldex cursor frm numbers
;Set to 1 to boost the maximum number of tile FRMs from 4096 to 16383
MoreTiles=0
;Change the Skilldex cursor FRM numbers
;Default is 293 for all skills
Lockpick=293
Steal=293
@@ -357,7 +370,7 @@ Repair=293
;Remove window position rounding
RemoveWindowRounding=0
;Set to 1 to add scroll buttons to the pip boy quest list, and remove the quests per area limit
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
UseScrollingQuestsList=1
;Uncomment these lines to control the premade characters offered when starting a new game
@@ -366,7 +379,7 @@ UseScrollingQuestsList=1
;PremadeFIDs=201,203,202
;Use this line to modify the list of cities and their associated global variables used for city reputations
;Syntax is 'city id : global id', with each city/global pair separated by a comma.
;Syntax is 'city id:global id', with each city/global pair separated by a comma.
;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
@@ -379,7 +392,7 @@ ExtraSaveSlots=0
;Set to 2 to update the HP/AC counters instantly
SpeedInterfaceCounterAnims=0
;These lines allow you to control the karma frm's displayed on the character screen
;These lines allow you to control the karma FRMs displayed on the character screen
;Number of KarmaPoints should be 1 less than number of KarmaFRMs
;KarmaFRMs=47,48,49
;KarmaPoints=-100,100
@@ -401,6 +414,9 @@ 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
@@ -523,6 +539,9 @@ StackEmptyWeapons=0
;If the amount of ammo boxes in the inventory is less than or equal to the reserve, only one box will be used
ReloadReserve=-1
;Set to 1 to change the counter in the 'Move Items' window to start at the maximum number of items
ItemCounterDefaultMax=0
;Allows 9 options (lines of text) to be displayed correctly in a dialog window
DialogOptions9Lines=1
@@ -536,6 +555,7 @@ DontTurnOffSneakIfYouRun=0
CanSellUsedGeiger=1
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenary/critters
;Set to 0 if another mod you're using has custom vehicles
CarChargingFix=1
;Set to 1 to skip weapon equip/unequip animations when performing various actions
@@ -548,6 +568,9 @@ InstantWeaponEquip=0
;Set to 1 to display numbered dialogue options
NumbersInDialogue=0
;Set to 1 to use Fallout's normal text font instead of DOS-like font on the world map
WorldMapFontPatch=0
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
CreditsAtBottom=0
Binary file not shown.
+14 -2
View File
@@ -4,7 +4,7 @@
Previously was part of sfall itself, now a separate mod.
Features:
- highlighting items, containers (optional) and dead bodies (optional) on the ground
- highlighting items, containers (optional) and lootable corpses (optional) on the ground
- configurable hotkey is used to trigger highlight
- only objects in direct line-of-sight of player are highlighted (optional)
- motion scanner is required to enable highlight (optional)
@@ -23,9 +23,11 @@
#define CRITTER_IS_DEAD (1)
#define PID_MOTION_SENSOR (59)
#define NO_HIGHLIGHT(obj) (get_flags(obj) bwand FLAG_NOHIGHLIGHT)
#define NO_STEAL(obj) (get_proto_data(obj_pid(obj), PROTO_CR_FLAGS) bwand CFLG_NOSTEAL)
variable configSection := "Highlighting";
variable highlightKey;
variable isHighlight;
variable alsoContainer;
variable alsoCorpse;
variable checkLOS;
@@ -52,7 +54,7 @@ procedure ToggleHighlight(variable enable) begin
end
if (alsoCorpse) then begin
foreach obj in list_as_array(LIST_CRITTERS) begin
if critter_state(obj) == CRITTER_IS_DEAD then begin
if critter_state(obj) == CRITTER_IS_DEAD and not NO_STEAL(obj) then begin
call ToggleHighlightObject(obj, enable);
end
end
@@ -67,6 +69,7 @@ procedure KeyPressHandler begin
if scanCode == highlightKey then begin
if pressed then begin
isHighlight := true;
if motionScanner then begin
scanner := obj_carrying_pid_obj(dude_obj, PID_MOTION_SENSOR);
if scanner then begin
@@ -89,11 +92,19 @@ procedure KeyPressHandler begin
call ToggleHighlight(true);
end
end else begin
isHighlight := false;
call ToggleHighlight(false);
end
end
end
procedure CombatTurnHandler begin
if isHighlight then begin
isHighlight := false;
call ToggleHighlight(false);
end
end
procedure start begin
if game_loaded and (sfall_ver_major >= 4) then begin
call InitConfigs;
@@ -110,5 +121,6 @@ procedure start begin
highlightFailMsg2 := Translate("HighlightFail2", "Your motion sensor is out of charge.");
register_hook_proc(HOOK_KEYPRESS, KeyPressHandler);
register_hook_proc(HOOK_COMBATTURN, CombatTurnHandler);
end
end
Binary file not shown.
+44 -4
View File
@@ -4,18 +4,19 @@
Used to replace the scripted part of B-Team mod.
Appropriate graphics are required for this mod to work.
Can be adopted to any mod by adjusting armor PIDs, NPC PIDs and NPC FIDs in INI file.
Can be adopted to any mod by adjusting armor PIDs, allowed weapon anim codes, NPC PIDs and NPC FIDs in INI file.
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
version 1.0
version 1.1
*/
#include "main.h"
#define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor)
#define IS_WEAPON(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_weapon)
variable
modIni := "npcarmor.ini",
@@ -41,9 +42,28 @@ procedure check_armor_change(variable critter, variable item, variable isWorn) b
return -1;
end
// for NPCs when they change armor themselves
procedure check_weapon_change(variable critter, variable item, variable isWield) begin
variable npc, newWeaponAnim, weaponAnimList, i;
if (npcMap[obj_pid(critter)]) then begin
npc := npcMap[obj_pid(critter)];
if isWield then begin
newWeaponAnim := get_proto_data(obj_pid(item), PROTO_WP_ANIM);
weaponAnimList := string_split(npc["WeaponAnims"], ",");
if newWeaponAnim then begin
foreach (i in weaponAnimList) begin
if (newWeaponAnim == atoi(i)) then return -1;
end
end else begin // anim code 0 - none/unarmed
return -1;
end
end
end
return 0;
end
// for NPCs when they change armor/weapon themselves
procedure invenwield_handler begin
variable critter, item, fid, slot, isWorn;
variable critter, item, fid, slot, isWorn, canWield;
critter := get_sfall_arg;
item := get_sfall_arg;
slot := get_sfall_arg;
@@ -55,6 +75,11 @@ procedure invenwield_handler begin
art_change_fid_num(critter, fid);
end
end
if (critter and item and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin
canWield := check_weapon_change(critter, item, isWorn);
set_sfall_return(canWield);
end
end
// when changing armor from inventory while controlling other NPCs
@@ -69,12 +94,26 @@ procedure adjustfid_handler begin
end
end
// when changing weapon from inventory while controlling other NPCs
procedure inventorymove_handler begin
variable slot, item, canWield;
slot := get_sfall_arg;
item := get_sfall_arg;
if (dude_obj != real_dude_obj) then begin
if (IS_WEAPON(item) and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin
canWield := check_weapon_change(dude_obj, item, item != 0);
set_sfall_return(canWield);
end
end
end
procedure start begin
variable sect, sects, armorTypes, armorType, npc, pid, pids, i;
if game_loaded and (sfall_ver_major >= 4) then begin
register_hook_proc(HOOK_INVENWIELD, invenwield_handler);
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
defaultFids := get_ini_section(modIni, "Default");
fix_array(defaultFids);
@@ -97,6 +136,7 @@ procedure start begin
sect := get_ini_section(modIni, ""+i);
while (sect.PID) do begin
npc := create_array_map;
npc["WeaponAnims"] := sect["WeaponAnims"];
npc["Default"] := atoi(sect["Default"]);
foreach (armorType: pids in armorTypes) begin
if (sect[armorType]) then begin
Binary file not shown.
+29 -3
View File
@@ -12,12 +12,16 @@
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "main.h"
variable
configSection := "CombatControl",
controlMode,
pidList,
displayName,
displayNameColor,
inControl := false,
hasGeckoSkinning := false;
@@ -33,23 +37,45 @@ procedure combatturn_handler begin
if (status == 1
and (len_array(pidList) == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1)
and (controlMode == 1 or party_member_obj(pid))) then begin
set_dude_obj(critter);
if hasGeckoSkinning then critter_add_trait(critter, TRAIT_PERK, PERK_gecko_skinning_perk, 1);
end else begin
if not(critter == real_dude_obj) then begin
set_dude_obj(critter);
if hasGeckoSkinning then critter_add_trait(critter, TRAIT_PERK, PERK_gecko_skinning_perk, 1);
inControl := true;
end
if inControl then begin
// center the screen on the controlled critter and remove roof tiles
move_to(dude_obj, dude_tile, dude_elevation);
if displayName then begin
set_iface_tag_text(displayName, obj_name(critter), displayNameColor);
show_iface_tag(displayName);
end
end
end else if inControl then begin
set_dude_obj(real_dude_obj);
if displayName then hide_iface_tag(displayName);
end
end
procedure gamemodechange_handler begin
if not(get_game_mode BWAND COMBAT) then inControl := false;
end
procedure start begin
if game_loaded and (sfall_ver_major >= 4) then begin
set_perk_ranks(PERK_gecko_skinning_perk, 1);
set_perk_level(PERK_gecko_skinning_perk, 999); // prevent it from appearing in the perk selection window
controlMode := GetConfig("CombatControl", "Mode", 0);
displayName := GetConfig("CombatControl", "DisplayName", 0);
displayNameColor := GetConfig("CombatControl", "DisplayNameColor", 0);
if (controlMode > 2) then controlMode := 0;
if (displayName < 5 or displayName > 9) then displayName := 0;
if (controlMode > 0) then begin
pidList := GetConfigListInt("CombatControl", "PIDList");
fix_array(pidList);
if has_trait(TRAIT_PERK, dude_obj, PERK_gecko_skinning_perk) then hasGeckoSkinning := true;
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
register_hook_proc(HOOK_GAMEMODECHANGE, gamemodechange_handler);
end
end
end
+15 -5
View File
@@ -3,13 +3,23 @@ This folder contains documentation about sfall scripting extensions.
headers\ - folder contains sfall headers that you should #include in your scripts
sfall.h - main sfall header, always include it
define_extra.h - some additional preprocessor constants for vanilla engine stuff (proto offsets, etc.)
dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS
define_lite.h - a lite version of official define.h
dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS
lib.arrays.h - procedures that will help you use arrays in their full:
- use them as stacks, sets
- easily compare, copy, slice, cut, add arrays
- display array contents (for debugging)
- save/load two-dimensional arrays to savegame in one command (e.g. arrays of objects)
lib.inven.h - fallout items manipulation functions
lib.math.h - a few simple functions for calculations
lib.strings.h - search in strings, join, repeat, etc.
lib.misc.h - misc stuff
sfall function notes.txt - incomplete reference for new opcodes
sfall opcode list.txt - list of all sfall opcodes (w/o descriptions)
hookscripts.txt - detailed manual for using hook scripts to modify engine behavior
arrays.txt - manual for sfall arrays
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in ScriptEditor\docs\sslc_readme.txt,
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in ScriptEditor\docs\sslc_readme.txt,
there are numerious new syntax features and extensions to SSL (Star-Trek Scripting language).
+2 -3
View File
@@ -26,15 +26,14 @@ end
return intp;
end*/
procedure ceil(variable val) begin
/*procedure ceil(variable val) begin
variable intp;
intp := floor(val);
if (abs(val-intp) > 0.0) then begin
intp++;
end
return intp;
end
end*/
procedure cap_number(variable num, variable min, variable max) begin
if (num > max) then num := max;
+21
View File
@@ -49,6 +49,9 @@
#define HOOK_ADJUSTFID (26)
#define HOOK_COMBATTURN (27)
#define HOOK_CARTRAVEL (28)
#define HOOK_SETGLOBALVAR (29)
#define HOOK_RESTTIMER (30)
#define HOOK_GAMEMODECHANGE (31)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
@@ -136,6 +139,7 @@
#define set_attack_explosion_radius(x) metarule2_explosions(3, x, 0)
#define set_attack_is_explosion(x) metarule2_explosions(4, x, 0)
#define set_attack_is_explosion_fire set_attack_is_explosion(DMG_fire)
#define set_explosion_radius(grenade, rocket) metarule2_explosions(5, grenade, rocket)
#define GAME_MSG_COMBAT (0)
@@ -178,6 +182,11 @@
#define CURSOR_COMMAND (1)
#define CURSOR_TARGETING (2)
//Valid flags for set_rest_mode
#define RESTMODE_DISABLED (1) // disable resting on all maps
#define RESTMODE_STRICT (2) // disable resting on maps with "can_rest_here=No" in Maps.txt, even if there are no other critters
#define RESTMODE_NO_HEALING (4) // disable healing during resting
#define mstr_combat(x) (message_str_game(GAME_MSG_COMBAT, x))
#define mstr_ai(x) (message_str_game(GAME_MSG_AI, x))
#define mstr_scrname(x) (message_str_game(GAME_MSG_SCRNAME, x))
@@ -209,26 +218,38 @@
#define party_member_list_all party_member_list(1)
#define attack_is_aimed sfall_func0("attack_is_aimed")
#define car_gas_amount sfall_func0("car_gas_amount")
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
#define display_stats sfall_func0("display_stats")
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
#define floor2(value) sfall_func1("floor2", value)
#define get_cursor_mode sfall_func0("get_cursor_mode")
#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_map_enter_position sfall_func0("get_map_enter_position")
#define get_outline(obj) sfall_func1("get_outline", obj)
#define intface_hide sfall_func0("intface_hide")
#define intface_is_hidden sfall_func0("intface_is_hidden")
#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_weight(obj) sfall_func1("item_weight", obj)
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
#define outlined_object sfall_func0("outlined_object")
#define real_dude_obj sfall_func0("real_dude_obj")
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
#define set_dude_obj(critter) sfall_func1("set_dude_obj", critter)
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
#define set_iface_tag_text(tag, text, color) sfall_func3("set_iface_tag_text", tag, text, color)
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
#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_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
#define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
+62 -30
View File
@@ -30,7 +30,7 @@ end
There are script functions available, specific to hook scripts:
> int init_hook()
The hook script equivilent of game_loaded; it returns 2 when the script is first loaded, 1 when the player reloads and 0 otherwise.
The hook script equivalent of game_loaded; it returns 2 when the script is first loaded, 1 when the player reloads and 0 otherwise.
> 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.
@@ -42,10 +42,10 @@ Returns all hook arguments as a new temp array.
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 usefull if you have several hook scripts attached to one hook point (see below).
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)
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 execuded in a current global script. You can use all above functions like normal.
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 hooktype, proc procedure)
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"). 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!).
@@ -77,7 +77,7 @@ The defines to use for the hooktype are in sfall.h.
HOOK_TOHIT (hs_tohit.int)
Runs when fallout is calculating the chances of an attack striking a target
Runs when Fallout is calculating the chances of an attack striking a target
Runs after the hit chance is fully calculated normally, including applying the 95% cap
int arg1 - The unmodified hit chance
@@ -94,7 +94,7 @@ int ret1 - the new hit chance
HOOK_AFTERHITROLL (hs_afterhitroll.int)
Runs after fallout has decided if an attack will hit or miss
Runs after Fallout has decided if an attack will hit or miss
int arg1 - If the attack will hit. (0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit)
critter arg2 - The attacker
@@ -110,22 +110,22 @@ critter ret3 - Override the target of the attack
HOOK_CALCAPCOST (hs_calcapcost.int)
Runs whenever fallout is calculating the ap cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the ap cost of whatever is in the players hands at the time the wrong ap cost will be shown. It will be fixed the next time the interface is redrawn.
Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the players hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
You can get the weapon object by checking item slot based on attack type (ATKTYPE_LWEP1, ATKTYPE_LWEP2, etc) and then calling critter_inven_obj().
critter arg1 - The critter performing the action
int arg2 - Attack Type (see ATKTYPE_* constants)
int arg3 - Is aimed attack (1 or 0)
int arg4 - The normal ap cost
int arg4 - The normal AP cost
int ret1 - The new ap cost
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
Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees
int arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
critter arg2 - The attacker
@@ -138,14 +138,14 @@ 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.
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.
item 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 - The death anim id calculated by fallout
int arg5 - The death anim id calculated by Fallout
int ret1 - The death anim id to override with
@@ -166,7 +166,7 @@ int arg5 - The special effect flags for the target
int arg6 - The special effect flags for the attacker
int arg7 - The weapon used in the attack
int arg8 - The bodypart that was struck
int arg9 - Damage Multipiler (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2, but with Silent Death perk and the corresponding attack conditions, it's 4; for critical hits, the value is taken from the critical table)
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, but with Silent Death perk and the corresponding attack conditions, it's 4; for critical hits, the value is taken from the critical table)
int arg10 - Number of bullets actually hit the target (1 for melee attacks)
int arg11 - The amount of knockback to the target
int arg12 - Attack Type (see ATKTYPE_* constants)
@@ -181,7 +181,7 @@ int ret5 - The amount of knockback to the target
HOOK_ONDEATH (hs_ondeath.int)
Runs immediately after a critter dies for any reason. No return values; this is just a convinence for when you need to do something after death for a large number of different critters and don't want to have to script each and every one of them.
Runs immediately after a critter dies for any reason. No return values; this is just a convenience for when you need to do something after death for a large number of different critters and don't want to have to script each and every one of them.
Critter arg1 - The critter that just died
@@ -189,7 +189,7 @@ 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. All 4 must be given if you want to override normal sorting; if you want to specify less than 4 targets fill in the extra spaces with 0's. If you do not give 4 targets, the npcs normal sorting mechanism will be used.
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. All 4 must be given if you want to override normal sorting; if you want to specify less than 4 targets fill in the extra spaces with 0's. If you do not give 4 targets, the NPCs normal sorting mechanism will be used.
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.
@@ -213,7 +213,7 @@ Runs when:
2) a critter uses an object from inventory screen AND this object does not have "Use" action flag set and it's not active flare or explosive.
3) player or AI uses any drug
This is fired before the object is used, and the relevent use_obj_on script procedures are run. You can disable default item behavior.
This is fired before the object is used, and the relevant use_obj_on script procedures are run. You can disable default item behavior.
NOTE: you can't remove and/or destroy this object during the hookscript (game will crash otherwise). To remove it, return 1.
Critter arg1 - The target
@@ -230,7 +230,7 @@ Runs when:
1) a critter uses an object from inventory which have "Use" action flag set or it's an active flare or dynamite.
2) player uses an object from main interface
This is fired before the object is used, and the relevent use_obj script procedures are run. You can disable default item behavior.
This is fired before the object is used, and the relevant use_obj script procedures are run. You can disable default item behavior.
NOTE: you can't remove and/or destroy this object during the hookscript (game will crash otherwise). To remove it, return 1.
Critter arg1 - The user
@@ -271,13 +271,13 @@ int ret1 - the modified value of all of the goods
HOOK_MOVECOST (hs_movecost.int)
Runs when calculating the ap cost of movement
Runs when calculating the AP cost of movement
Critter arg1 - the critter doing the moving
int arg2 - the number of hexes being moved
int arg3 - the original ap cost
int arg3 - the original AP cost
int ret1 - the new ap cost
int ret1 - the new AP cost
-------------------------------------------
@@ -305,14 +305,14 @@ object* ret1 - 0 if the hex doesn't block, or any sort of object pointer if it d
HOOK_ITEMDAMAGE (hs_itemdamage.int)
Runs when retriving the damage rating of the players used weapon. (Which may be their fists.)
Runs when retrieving the damage rating of the players used weapon. (Which may be their fists.)
int arg1 - The default min damage
int arg2 - The default max damage
Item arg3 - The weapon used. (0 if unarmed)
Critter arg4 - The critter doing the attacking
int arg5 - The type of attack
int arg6 - non zero if this is an attack using a melee weapon
int arg6 - non-zero if this is an attack using a melee weapon
int ret1 - Either the damage to be used, if ret2 isn't given, or the new minimum damage if it is
int ret2 - The new maximum damage
@@ -328,7 +328,7 @@ To add proper check for ammo before shooting and proper calculation of number of
Item arg1 - weapon
int arg2 - Number of bullets in burst (1 for single shots)
int arg3 - Ammo cost calculated by original function (this is basically 2 for Super Cattle Prod and Mega Power Fist)
int arg4 - Type of hook (0 - when substracting ammo after attack, 1 - when checking for "out of ammo" before attack)
int arg4 - Type of hook (0 - when subtracting ammo after attack, 1 - when checking for "out of ammo" before attack)
int ret1 - new ammo cost value (set to 0 for unlimited ammo)
@@ -393,12 +393,12 @@ HOOK_WITHINPERCEPTION (hs_withinperception.int)
Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.
NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors. If check fails, the end result is false. If check succeeds (eg. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails. You can override "within perception" check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add "line of sight" check inside your hook script, otherwise critters will detect you through walls.
NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors. If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails. You can override "within perception" check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add "line of sight" check inside your hook script, otherwise critters will detect you through walls.
This is fired after the default calculation is made.
Critter arg1 - Watcher object
Obj arg2 - Target objet
Obj arg2 - Target object
int arg3 - Result of vanilla function: 1 - within perception range, 0 - otherwise
int ret1 - overrides the returned result of the function: 0 - not in range (can't see), 1 - in range (will see if not blocked), 2 - forced detection (will see regardless, only used in obj_can_see_obj scripting function which is called by every critter in the game)
@@ -409,16 +409,16 @@ HOOK_INVENTORYMOVE (hs_inventorymove.int)
Runs before moving items between inventory slots in dude interface. You can override the action.
What you can NOT do with this hook:
- force moving items to inapropriate slots (like gun in armor slot)
- force moving items to inappropriate slots (like gun in armor slot)
- block picking up items
What you can do:
- restrict player from using specific weapons or armors
- add AP costs for all inventory movement including reloading
- apply or remove some special scripted effects depending on PC's armor
int arg1 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo)
int arg1 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo, 5 - container, like bag/backpack, 6 - dropping on the ground)
Item arg2 - Item being moved
Item arg3 - Item being replaced or weapon being reloaded (can be 0)
Item arg3 - Item being replaced, weapon being reloaded, or container being filled (can be 0)
int ret1 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon)
@@ -432,7 +432,7 @@ NOTE: when replacing a previously wielded armor or weapon, the unwielding hook w
If you need to rely on this, try checking if armor/weapon already equipped when wielding hook is executed.
Critter arg1 - critter
Obj arg2 - item being wielded or unwielded (weapon/armor), may be 0 when unwielding
Obj arg2 - item being wielded or unwielded (weapon/armor)
int arg3 - slot (INVEN_TYPE_*)
int arg4 - 1 when wielding, 0 when unwielding
@@ -467,10 +467,42 @@ int ret1 - pass 1 at the start of turn to skip the turn, pass -1 at the end
HOOK_CARTRAVEL (hs_cartravel.int)
Runs continously during worldmap travel on car.
Runs continuously during worldmap travel on car.
int arg1 - vanilla car speed (between 3 and 8 "steps")
int arg2 - vanilla fuel consumption (100 and below)
int ret1 - car speed override (pass -1 if you just want to override fuel consumption)
int ret2 - fuel consumption override
-------------------------------------------
HOOK_SETGLOBALVAR (hs_setglobalvar.int)
Runs when setting the value of a global variable.
int arg1 - the index number of the global variable being set
int arg2 - the set value of the global variable
int ret1 - overrides the value of the global variable
-------------------------------------------
HOOK_RESTTIMER (hs_resttimer.int)
Runs continuously while the player is resting (using pipboy alarm clock).
int arg1 - the game time in ticks
int arg2 - event type: 1 - when the resting ends normally, -1 - when pressing ESC to cancel the timer, 0 - otherwise
int arg3 - the hour part of the length of resting time
int arg4 - the minute part of the length of resting time
int ret1 - pass 1 to interrupt the resting, pass 0 to continue the rest if it was interrupted by pressing ESC key
-------------------------------------------
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
+91 -30
View File
@@ -14,9 +14,9 @@ Global scripts have multiple modes, which can be set using the set_global_script
Both set_global_script_repeat and set_global_script_type only have an effect on the script they were called from. Every global script needs its own game_loaded block to correctly set up the script type and repeat rate. set_global_script_repeat will have no effect if called on a non-global script.
The read_xxx functions take a memory address as the parameter and can read arbitrary pieces of fallouts address space. The write functions are equivilent except that they write to arbitrary memory addresses. The call_offset_xx functions can be used to call arbitrary functions inside fallout. Different versions are used to call functions with different numbers of arguments. None of these functions will work unless AllowUnsafeScripting is enabled in ddraw.ini
The read_xxx functions take a memory address as the parameter and can read arbitrary pieces of Fallout's address space. The write functions are equivalent except that they write to arbitrary memory addresses. The call_offset_xx functions can be used to call arbitrary functions inside Fallout. Different versions are used to call functions with different numbers of arguments. None of these functions will work unless AllowUnsafeScripting is enabled in ddraw.ini
The get/set_pc_base/extra_stat functions are equivelent to calling get/set_critter_base/extra_stat with dude_obj as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal get_critter_stat function to get a correctly perk adjusted and range clamped value for a stat.
The get/set_pc_base/extra_stat functions are equivalent to calling get/set_critter_base/extra_stat with dude_obj as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal get_critter_stat function to get a correctly perk adjusted and range clamped value for a stat.
The set_stat_max/min functions can be used to set the valid ranges on on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only effect the player, the set_npc_ functions only effect other critters, and the set_ functions effect both.
@@ -26,7 +26,7 @@ The graphics functions are only available if the user is using graphics mode 4 o
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.
get_shader_version gives you the higest shader version supported by the players graphics cards. Possible return values are 11, 12, 13, 14, 20, 21 and 30.
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.
set_shader_mode tells sfall when to use a shader. The parameter is a set of 32 flags which specify the screens on which the shader will be disabled, unless bit 32 is set, in which case the shader will only be active on those screens. Remember that screens are displayed on top of each other; if the player opens the character menu which in combat, the game still considers the player to be in combat. See sfall.h for a list of defines.
@@ -38,41 +38,41 @@ set_pipboy_available will only accept 0 or 1 as an argument. Using any other val
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.
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 weilded 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.
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.
The get/set_sfall_global functions require an 8 character long case sensitive string for the variable name. The variables behave the same as normal fallout globals, except that they don't have to be declared beforehand in vault13.gam. Trying to get a variable which hasn't been set will always return 0. These functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.
The get/set_sfall_global functions require an 8 character long case sensitive string for the variable name. The variables behave the same as normal Fallout globals, except that they don't have to be declared beforehand in vault13.gam. Trying to get a variable which hasn't been set will always return 0. These functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.
set_pickpocket_max and set_hit_chance_max effect all critters rather than just the player. set_skill_max can't be used to increase the skill cap above 300. set_perk_level_mod sets a modifier between +25 and -25 that is added/subtracted from the players level for the purposes of deciding which perks can be chosen.
set_fake_trait and set_fake_perk can be used to add additional traits and perks to the character screen. They will be saved correctly when the player saves and reloads games, but by themselves they will have no further effect on the character. For perks, the allowed range for levels is between 0 and 100; setting the level to 0 removes that perk. For traits, the level must be 0 or 1. The image is a numeric id that corrisponds to an entry in skilldex.lst. The name is limited to 64 characters and the description to 1024 characters by sfall, but internal fallout limits may be lower.
set_fake_trait and set_fake_perk can be used to add additional traits and perks to the character screen. They will be saved correctly when the player saves and reloads games, but by themselves they will have no further effect on the character. For perks, the allowed range for levels is between 0 and 100; setting the level to 0 removes that perk. For traits, the level must be 0 or 1. The image is a numeric id that corresponds to an entry in skilldex.lst. The name is limited to 64 characters and the description to 1024 characters by sfall, but internal Fallout limits may be lower.
has_fake_trait and has_fake_perk return the number of levels the player has of the perks/traits with the given name.
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 players traits, if bit 2 is set it is added to the players 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 it's 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 9 for custom boxes. Remember to add your messages to intrface.msg and setup the font colours in ddraw.ini if you're going to use custom boxes.
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 9 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.
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.
(re)set/get_critical_table are used for modifing the critical table. For details see 'http://falloutmods.wikia.com/wiki/Critical_hit_tables'. Changes are not saved, and will reset to the defaults, (or to the contents of CriticalOverrides.ini, if it exists,) at each game reload. These function also require OverrideCriticalTable to be set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.)
(re)set/get_critical_table are used for modifying the critical table. For details see 'http://falloutmods.wikia.com/wiki/Critical_hit_tables'. Changes are not saved, and will reset to the defaults, (or to the contents of CriticalOverrides.ini, if it exists,) at each game reload. These function also require OverrideCriticalTable to be set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.)
get/set_unspent_ap_bonus alter the AC bonus you recieve per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) get/set_unspent_ap_perk_bonus are similar, but effect the extra AC granted by the h2h evade perk. (The default value of this is also 4, equivilent to doubling the original bonus.)
get/set_unspent_ap_bonus alter the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) get/set_unspent_ap_perk_bonus are similar, but effect the extra AC granted by the h2h evade perk. (The default value of this is also 4, equivalent to doubling the original bonus.)
nb_* functions are reserved for the brotherhood tactical training mod, and should be avoided.
The fs_* functions are used to manipulate a virtual file system. Files saved here should have paths relative to the data folder, and use backslashes as the directory seperator. They will take precedence over files stored in the normal data folder. They will also be saved into save games, so be avoid creating large files. Using fs_copy followed by fs_read_xxx, you can read the contents of existing files.
The fs_* functions are used to manipulate a virtual file system. Files saved here should have paths relative to the data folder, and use backslashes as the directory separator. They will take precedence over files stored in the normal data folder. They will also be saved into save games, so be avoid creating large files. Using fs_copy followed by fs_read_xxx, you can read the contents of existing files.
get/set_proto_data are used to manipulate the in memory copies of the .pro files fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permenent. If you modify the protos, and then fallout subsequently reloads the file your changes will be lost.
get/set_proto_data are used to manipulate the in memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permanent. If you modify the protos, and then Fallout subsequently reloads the file your changes will be lost.
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 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.
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 permenent 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 permenent.
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.
NOTE: the above description only applies when "arraysBehavior" is set to 0 in ddraw.ini. Refer to "arrays.txt" for detailed description of new arrays behavior.
force_aimed_shots and disable_aimed_shots allow overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) force_aimed_shots will allow a weapon to make aimed shots even if it normally couldn't, and disable_aimed_shots stops a weapon from making aimed shots even if it normally could. Both of these functions affect player and npcs alike. force_aimed_shots does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the functions once at each reload. Use a pid of 0 to represent unarmed.
force_aimed_shots and disable_aimed_shots allow overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) force_aimed_shots will allow a weapon to make aimed shots even if it normally couldn't, and disable_aimed_shots stops a weapon from making aimed shots even if it normally could. Both of these functions affect player and NPCs alike. force_aimed_shots does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the functions once at each reload. Use a pid of 0 to represent unarmed.
get/set_critter_skill_points will get/set the number of additional points a critter has in a skill, on top of whatever they have from their stats and other bonuses. Note that skill points are part of the proto, so calling set_skill_points on a critter will affect all critters that share the same proto.
@@ -101,23 +101,23 @@ array - array ID to be used with array-related functions (actually an integer)
- returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. It's primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too.
> void inc_npc_level(string npc)
- takes an npc name as an argument. The npc must be in your party. This function ignores player level requirements and the minimum 3 player level delay between npc level gains. It also ignores the random element, regardless of sfall's NPCAutoLevel setting.
- takes an NPC name as an argument. The NPC must be in your party. This function ignores player level requirements and the minimum 3 player level delay between NPC level gains. It also ignores the random element, regardless of sfall's NPCAutoLevel setting.
> int get_npc_level(string npc)
- also takes the npc name as an argument, and returns the npc's current level. Again, the npc needs to be in your party.
- also takes the NPC name as an argument, and returns the NPC's current level. Again, the NPC needs to be in your party.
> void set_car_current_town(int town)
- changes the current town index for the player's car
> int get_ini_setting(string setting)
- reads an integer value from an ini file in the fallout directory.
- reads an integer value from an ini file in the Fallout directory.
- It only takes a single argument; seperate the file name, section and key with a '|' character; e.g. 'myvar:=get_ini_setting("myini.ini|mysec|var1")' If the file or key cannot be found, -1 is returned.
- The file name is limited to 16 chars, including the extension.
- The section name is limited to 8 characters.
- The file name is limited to 63 chars, including the extension.
- The section name is limited to 32 characters.
- It can also be used to get sfalls settings, by using ddraw.ini as the file name.
> string get_ini_string(string setting)
- reads a string value from an ini file in the fallout directory.
- reads a string value from an ini file in the Fallout directory.
> int get_game_mode()
- is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in.
@@ -157,21 +157,21 @@ array - array ID to be used with array-related functions (actually an integer)
- 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 it's 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 -1 if the object is unscripted.
> void set_self(int obj)
- overrides the scripts self_obj for the next function call.
- It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts;
- self_obj will revert back to its original value after the next function call.
- calling self_obj(0) will also revert self_obj to original value
- source_obj, target_obj, and similar functions will not work if preceeded by "set_self"
- source_obj, target_obj, and similar functions will not work if preceded by "set_self"
> void mod_skill_points_per_level(int x)
- accepts a value of between -100 and 100, and modifies the number of skill points the player recieves when they level up.
- accepts a value of between -100 and 100, and modifies the number of skill points the player receives when they level up.
- This is a modification of what would otherwise happen, rather than a replacement.
- The value is not saved into the save game, so should be reset in the game_loaded section of a script.
> void seq_perk_freq(int x)
> void set_perk_freq(int x)
- sets the number of levels between each perk.
- Setting 0 will reset it back to the default.
- This overrides the effects of the skilled trait.
@@ -182,7 +182,7 @@ array - array ID to be used with array-related functions (actually an integer)
- will return the last critter to be deliberately attacked
> object get_last_attacker(object)
- will return the last critter to deliberately launch an attack against the argument critter.
- If a critter has not launched/recieved an attack, it will return 0. This is only stored for the duration of combat, and outside of combat both functions will always return 0.
- If a critter has not launched/received an attack, it will return 0. This is only stored for the duration of combat, and outside of combat both functions will always return 0.
> void set_base_pickpocket_mod(int max, int mod)
- changes maximum chance of success and chance mod for each steal attempt
@@ -214,7 +214,7 @@ Some additional reg_anim_* functions were introduced. They all work in the same
- plays "take out weapon" animation for given holdFrameID. It is not required to have such weapon in critter's inventory.
> void reg_anim_turn_towards(object, tile/target, delay)
- makes object change it's direction to face given tile num or target object.
- makes object change its direction to face given tile num or target object.
> int metarule2_explosions(int arg1, int arg2)
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:
@@ -229,13 +229,17 @@ was made as a dirty easy hack to allow dynamically change some explosion paramet
- changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine)
> void set_attack_is_explosion_fire
- if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still recieve fire damage.
- if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still receive fire damage.
> void set_explosion_radius(grenade, rocket)
- sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius.
- changed radius will be reset each time the player reloads the game.
Some utility/math functions are available:
> array string_split(string, split)
- takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters.
- takes a string and a separator, searches the string for all instances of the separator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the separator, the string is split into individual characters.
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
> string substr(string, start, length)
@@ -245,7 +249,7 @@ Some utility/math functions are available:
- returns string length
> string sprintf(string format, any value)
- formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
- can be used to get character by ASCII code ("%c")
> int typeof(any value)
@@ -265,6 +269,9 @@ Some utility/math functions are available:
> float exponent(float x)
- e^x
> int ceil(float x)
- round x to the nearest integer that is not less than x
> int round(float x)
- round x to the nearest integer
@@ -340,7 +347,7 @@ Some utility/math functions are available:
- these opcodes allows to use additional scripting functions, that do not require new opcode
- first argument is always function name (string)
- there are 7 versions of this opcode for different number of additional arguments (for convenience)
- opcodes have return value, but it is not neccessary to use it
- opcodes have return value, but it is not necessary to use it
------------------------------------
@@ -372,6 +379,16 @@ Some utility/math functions are available:
> void sfall_func0("exec_map_update_scripts")
- executes map_update_p_proc for all objects on map and global/hook scripts as well
> void sfall_func2("set_ini_setting", string setting, int/string value)
- writes an integer or a string value to an ini file in the Fallout directory. If the ini file does not exist, it will be created
- The setting argument works in the same way as in get_ini_setting; seperate the file name, section and key with a '|' character; e.g. 'set_ini_setting("myini.ini|mysec|var1", 42)'
- The file name is limited to 63 chars, including the extension
- The section name is limited to 32 characters
> int sfall_func1("floor2", int/float value)
- works just like vanilla floor function, but returns correct integers for negative values
- vanilla floor function works exactly the same as ceil for negative values, much like trunc in C/C++
> int sfall_func1("item_weight", object)
- gets the current weight of an object
@@ -429,6 +446,50 @@ Some utility/math functions are available:
- displays player stats in the inventory screen display window
- works only in opened inventory
> int sfall_func1("lock_is_jammed", object)
- returns 1 if the lock (container or scenery) is currently jammed, 0 otherwise
> void sfall_func1("unjam_lock", object)
- unjams a lock immediately without having to wait until the next day, or leave the map and then return after 24 hours
- does not work in use_skill_on_p_proc procedure
> void sfall_func1("set_unjam_locks_time", int time)
- sets after how many hours (up to 127 hours) jammed locks will be unjammed if the player leaves the map
- also disables the auto unjam that occurs at midnight when the player is on the map
- passing 0 will disable the auto unjam mechanism completely
- The auto unjam mechanism will be reset each time the player reloads the game
> array sfall_func0("get_map_enter_position")
- returns an array of the player's position data (index 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids
- if entering from the world map, the tile value will be -1
- should be called in map_enter_p_proc procedure to get the correct position data
> void sfall_func3("set_map_enter_position", int tile, int elevation, int rotation)
- overrides the player's entry position when entering the map through exit grids
- setting the tile to 0 will put the player on the start hex (default tile and elevation) of the map
- works only in map_enter_p_proc procedure
> void sfall_func1("set_rest_heal_time", int minutes)
- sets the time interval in minutes for healing during resting. The default is 180
- The time interval will be reset each time the player reloads the game
> void sfall_func1("set_rest_mode", int mode)
- sets the bit flags for the rest mode (see RESTMODE_* constants in sfall.h)
- passing 0 will reset the rest mode. It will also be reset each time the player reloads the game
> int sfall_func0("attack_is_aimed")
- returns 1 if the aimed attack mode is selected, 0 otherwise
> void sfall_func3("set_iface_tag_text", int tag, string text, int color)
- sets the text messages and colors for custom notification boxes to the interface without the need to add messages to intrface.msg and set up the font colors in ddraw.ini
- tag value is the same as used in show_iface_tag, hide_iface_tag, and is_iface_tag_active. The valid range is from 5 to 9 (custom boxes)
- The text is limited to 19 characters
- available colors: 0 - green, 1 - red, 2 - white, 3 - yellow, 4 - dark yellow, 5 - blue, 6 - purple
> 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)
------------------------
------ MORE INFO -------
------------------------
+18
View File
@@ -74,7 +74,25 @@ void SkillSetTags(long* tags, long num) {
fo::func::skill_set_tags(tags, num);
}
int _fastcall GetItemType(GameObject* item) {
return fo::func::item_get_type(item);
}
_declspec(noinline) GameObject* GetItemPtrSlot(GameObject* critter, InvenType slot) {
GameObject* itemPtr = 0;
switch (slot) {
case fo::INVEN_TYPE_LEFT_HAND :
itemPtr = fo::func::inven_left_hand(critter);
break;
case fo::INVEN_TYPE_RIGHT_HAND :
itemPtr = fo::func::inven_right_hand(critter);
break;
case fo::INVEN_TYPE_WORN :
itemPtr = fo::func::inven_worn(critter);
break;
}
return itemPtr;
}
//---------------------------------------------------------
//print text to surface
+4
View File
@@ -50,6 +50,10 @@ void SkillGetTags(long* result, long num);
// wrapper for skill_set_tags with bounds checking
void SkillSetTags(long* tags, long num);
int _fastcall GetItemType(GameObject* item);
_declspec(noinline) GameObject* GetItemPtrSlot(GameObject* critter, InvenType slot);
// Print text to surface
void PrintText(char *displayText, BYTE colorIndex, DWORD x, DWORD y, DWORD textWidth, DWORD destWidth, BYTE *surface);
// gets the height of the currently selected font
+10 -2
View File
@@ -420,8 +420,8 @@ enum Trait : long
enum class ScenerySubType : long
{
DOOR = 0,
STAIRS = 1,
ELEVATOR = 2,
STAIRS = 1,
ELEVATOR = 2,
LADDER_BOTTOM = 3,
LADDER_TOP = 4,
GENERIC = 5
@@ -579,6 +579,14 @@ enum ItemType : long
item_type_key = 6,
};
// Inventory Equates
enum InvenType : long
{
INVEN_TYPE_WORN = 0,
INVEN_TYPE_RIGHT_HAND = 1,
INVEN_TYPE_LEFT_HAND = 2,
};
#define OBJFLAG_CAN_WEAR_ITEMS (0xf000000)
#define OBJFLAG_HELD_IN_RIGHT (0x10000)
+6
View File
@@ -30,6 +30,9 @@ WRAP_WATCOM_FUNC3(long, db_freadShortCount, DbFile*, file, WORD*, dest, long, co
WRAP_WATCOM_FUNC3(long, db_freadIntCount, DbFile*, file, DWORD*, dest, long, count)
WRAP_WATCOM_FUNC2(long, db_fwriteByte, DbFile*, file, long, value)
WRAP_WATCOM_FUNC2(long, db_fwriteInt, DbFile*, file, long, value)
WRAP_WATCOM_FUNC0(void, display_stats)
WRAP_WATCOM_FUNC3(void, display_inventory, long, inventoryOffset, long, visibleOffset, long, mode)
WRAP_WATCOM_FUNC4(void, display_target_inventory, long, inventoryOffset, long, visibleOffset, DWORD*, targetInventory, long, mode)
// perform combat turn for a given critter
WRAP_WATCOM_FUNC2(long, combat_turn, GameObject*, critter, long, isDudeTurn)
WRAP_WATCOM_FUNC1(long, critter_is_dead, GameObject*, critter)
@@ -54,6 +57,9 @@ WRAP_WATCOM_FUNC0(void, mouse_hide)
WRAP_WATCOM_FUNC6(long, make_path_func, GameObject*, objectFrom, long, tileFrom, long, tileTo, char*, pathDataBuffer, long, arg5, void*, blockingFunc)
// calculates bounding box (rectangle) for a given object
WRAP_WATCOM_FUNC2(void, obj_bound, GameObject*, object, BoundRect*, boundRect)
// checks/unjams jammed locks
WRAP_WATCOM_FUNC1(long, obj_lock_is_jammed, GameObject*, object)
WRAP_WATCOM_FUNC1(void, obj_unjam_lock, GameObject*, object)
WRAP_WATCOM_FUNC3(long, register_object_animate, GameObject*, object, long, anim, long, delay)
WRAP_WATCOM_FUNC3(long, register_object_animate_and_hide, GameObject*, object, long, anim, long, delay)
// WRAP_WATCOM_FUNC3(long, register_object_animate_and_move_straight_, GameObject*, object;
+12
View File
@@ -14,6 +14,7 @@
#define FO_VAR_art_vault_person_nums 0x5108A8
#define FO_VAR_bckgnd 0x5707A4
#define FO_VAR_black_palette 0x663FD0
#define FO_VAR_BlueColor 0x6A38EF
#define FO_VAR_bottom_line 0x664524
#define FO_VAR_btable 0x59E944
#define FO_VAR_btncnt 0x43EA1C
@@ -39,9 +40,11 @@
#define FO_VAR_dialogue_switch_mode 0x518718
#define FO_VAR_dialog_target 0x518848
#define FO_VAR_dialog_target_is_party 0x51884C
#define FO_VAR_dropped_explosive 0x5190E0
#define FO_VAR_drugInfoList 0x5191CC
#define FO_VAR_edit_win 0x57060C
#define FO_VAR_Educated 0x57082C
#define FO_VAR_elevation 0x631D2C
#define FO_VAR_Experience_ 0x6681B4
#define FO_VAR_fallout_game_time 0x51C720
#define FO_VAR_flptr 0x614808
@@ -60,10 +63,12 @@
#define FO_VAR_glblmode 0x5709D0
#define FO_VAR_gmouse_current_cursor 0x518C0C
#define FO_VAR_gmovie_played_list 0x596C78
#define FO_VAR_GoodColor 0x6AB4EF
#define FO_VAR_GreenColor 0x6A3CB0
#define FO_VAR_gsound_initialized 0x518E30
#define FO_VAR_hit_location_penalty 0x510954
#define FO_VAR_holo_flag 0x664529
#define FO_VAR_holodisk 0x6644F4
#define FO_VAR_holopages 0x66445C
#define FO_VAR_hot_line_count 0x6644F8
#define FO_VAR_i_fid 0x59E95C
@@ -99,6 +104,7 @@
#define FO_VAR_main_window 0x5194F0
#define FO_VAR_map_elevation 0x519578
#define FO_VAR_map_global_vars 0x51956C
#define FO_VAR_map_state 0x631D28
#define FO_VAR_master_db_handle 0x58E948
#define FO_VAR_max 0x56FB50
#define FO_VAR_maxScriptNum 0x51C7CC
@@ -134,6 +140,7 @@
#define FO_VAR_pc_proto 0x51C370
#define FO_VAR_pc_trait 0x66BE40
#define FO_VAR_pc_trait2 0x66BE44
#define FO_VAR_PeanutButter 0x6A82F3
#define FO_VAR_perk_data 0x519DCC
#define FO_VAR_perkLevelDataList 0x51C120
#define FO_VAR_pip_win 0x6644C4
@@ -145,11 +152,14 @@
#define FO_VAR_proto_main_msg_file 0x6647FC
#define FO_VAR_ptable 0x59E934
#define FO_VAR_pud 0x59E960
#define FO_VAR_quest_count 0x51C12C
#define FO_VAR_queue 0x6648C0
#define FO_VAR_quick_done 0x5193BC
#define FO_VAR_read_callback 0x51DEEC
#define FO_VAR_RedColor 0x6AB4D0
#define FO_VAR_retvals 0x43EA7C
#define FO_VAR_rotation 0x631D34
#define FO_VAR_sad 0x530014
#define FO_VAR_script_path_base 0x51C710
#define FO_VAR_scr_size 0x6AC9F0
#define FO_VAR_scriptListInfo 0x51C7C8
@@ -178,11 +188,13 @@
#define FO_VAR_text_spacing 0x51E3CC
#define FO_VAR_text_to_buf 0x51E3B8
#define FO_VAR_text_width 0x51E3C0
#define FO_VAR_tile 0x631D30
#define FO_VAR_title_color 0x56D750
#define FO_VAR_title_font 0x56D748
#define FO_VAR_trait_data 0x51DB84
#define FO_VAR_view_page 0x664520
#define FO_VAR_wd_obj 0x59E98C
#define FO_VAR_WhiteColor 0x6AB8CF
#define FO_VAR_wmAreaInfoList 0x51DDF8
#define FO_VAR_wmLastRndTime 0x51DEA0
#define FO_VAR_wmWorldOffsetX 0x51DE2C

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