phobos2077
e33a025c62
get_ini_config: sanitize and validate INI path
2023-06-18 15:01:25 +02:00
phobos2077
20088ffcb1
Save window positions in OnBeforeGameClose
...
- This way we can guarantee sfall has not started to "destruct" yet, so we don't have to rely on the order of destructor calls
2023-06-18 00:41:45 +02:00
phobos2077
cec091bda2
IniReader: Remove ini file from cache when it's changed by SetString
...
- Had to reorganize some code to make this work. Changed how some singletons are created to guarantee destructor calls in correct order (IniReader is constructed first and destructed last, after every other module).
2023-06-17 23:33:37 +02:00
phobos2077
4d19fa2d60
Use single function for all string-to-integer conversions for consistent behavior
...
- Reading INI from within sfall as well as get_ini_setting opcode
- calling atoi opcode
- Support auto-detecting 0x, 0 and 0b for hex, octal and binary representations respectively
2023-06-16 16:06:24 +02:00
phobos2077
0a6a604abc
Add support for using 0b prefix in INI files to denote binary base (consistent with GetPrivateProfile*)
2023-06-16 15:10:25 +02:00
phobos2077
2cef5310e2
Rewrite console writing
...
- Separate debug_msg and display_msg as separate Source
- Merge writing to one function with proper filtering
2023-06-16 14:57:41 +02:00
phobos2077
fe7aa9ae04
Removed unused code
2023-06-16 02:16:25 +02:00
phobos2077
b36771da48
Increase maximum size of one INI line to 1023 and fix potential crash in IniReader::getString()
...
- Now can read strings up to 1021 from INI files using all available functions (get_ini_string, get_ini_section, get_ini_config)
2023-06-16 00:53:03 +02:00
phobos2077
ad6491d61e
Increase array string limit to 1024 bytes
...
- Because it is now safe to log longer stuff
2023-06-16 00:16:36 +02:00
phobos2077
4de5de6a0c
Restore code page option from NovaRain
2023-06-16 00:02:55 +02:00
phobos2077
347b4a3ecb
Fix buffer overflow when DebugMode is enabled and printing messages longer than 259 via script
...
- Refactoring: moved ConsoleWindow into separate file
2023-06-15 23:57:41 +02:00
phobos2077
0b161c7374
Rename metarule for consistency with other ini-related functions, add to functions.yml
2023-06-15 21:48:06 +02:00
phobos2077
7bbc15ab0b
Made Config queries case-insensitive for both section names and keys to match GetPrivateProfile* behavior
2023-06-15 21:01:24 +02:00
phobos2077
ac02971d61
get_ini_section(s): switched to using Config class
...
- Load configs via IniReader to take advantage of it's cache
2023-06-15 19:28:52 +02:00
phobos2077
e4ea3645d6
Add config_load metarule to efficiently load INI into array and also load INI from DAT
...
- Refactoring: moved all ini-related handlers into new cpp
- Moved modified_ini opcode to C++
2023-06-15 19:01:07 +02:00
phobos2077
3f7ce8c412
Custom Config parser based on Vanilla & Fallout CE
2023-06-15 15:30:46 +02:00
phobos2077
6d3afd4e7d
Attempt to fix config reader memory allocation issues (unsuccessful)
2023-06-15 15:30:46 +02:00
phobos2077
2fcf81cb78
Read all ini's using built-in FO config parser
2023-06-15 15:30:46 +02:00
phobos2077
b8c52304eb
Add precise time measurements for: Sfall Init, Game Init, New Game start and Save game load.
2023-06-15 15:30:24 +02:00
phobos2077
5f38a934ca
Console improvements
...
- Save & restore window position
- Fix display_msg not mirrored to console
- Fix log prefixes showing up mid line
2023-06-14 21:34:57 +02:00
phobos2077
3c40518e87
Make sfall logs a little prettier
2023-06-14 20:01:13 +02:00
phobos2077
dc665cb741
Debugging.ConsoleWindow option
2023-06-13 23:09:21 +02:00
phobos2077
d7127a4deb
Fix crash in debug mode due to __stdcall not being explicitly specified for C++ function ( closes #476 )
2023-06-13 19:45:11 +02:00
phobos2077
f5e7235a80
get_tile_fid: take FRM Limit patch into account by extending FRM mask from 12 to 14 bits
2023-06-13 01:10:23 +02:00
phobos2077
0fef6f1f8c
mods_order: remove comments before other checks, to prevent valid paths being ignored
2023-06-12 19:55:33 +02:00
phobos2077
4b9008d53c
get_tile_fid correct for backwards compatibility and flexibility
...
- Allow to pass elevation using the free bits of the tileNum value to access elevations 1 and 2 (instead of defaulting to dude_elevation, which is not how it worked before)
- Access roof FID and raw data using mode flags in the top 4 bits
2023-06-12 18:26:28 +02:00
phobos2077
0d960ca326
Fix get_tile_fid function to work on elevations 1 and 2
...
- Since it has no second argument, assume dude elevation
- Rewrite into new opcode system
2023-06-12 16:44:07 +02:00
phobos2077
94388d3470
LoadOrder update
...
- Rename to "mods_order.txt"
- Create "mods" folder if it doesn't exist before creating an empty mods_order.txt
- Trim space and tab characters
- Allow comments after file names with ; or # (INI-style)
2023-06-12 11:59:10 +02:00
phobos2077
208cacc4dd
load_order.txt per #469
2023-06-12 11:59:10 +02:00
phobos2077
f222348b25
Update docs, remove deprecated macro
2023-06-12 11:55:06 +02:00
phobos2077
49cf0e6726
Allow passing string directly to set_sfall_return in HOOK_DESCRIPTIONOBJ
...
- HookScripts: track return types in addition to values
- Set allowNonIntReturn in hook code to allow non-int return values to be accepted
- Moved get_sfall_arg and set_sfall_return opcodes to the new table
2023-06-12 11:52:12 +02:00
phobos2077
d107edbb23
invenWieldFunc fix for putting non-armor, non-weapon items into hand slot
2023-06-11 20:12:11 +02:00
phobos2077
e9f8984819
Script Headers: fix remove_items_pid function and fix naming
...
- It didn't take different stacks of items into account as well as cases where one item is in the backback and other in the slot and you need to remove both
2023-06-11 14:07:44 +02:00
phobos2077
1c34f85789
Add get_combat_free_move for better mod compatibility
2023-06-08 21:36:09 +02:00
phobos2077
21fe99a297
Docs: Clarification about get_ini_* function return values
...
- Also updated lib.strings.h
2023-06-04 20:32:43 +02:00
phobos2077
ac1abf71f8
Corrected hook documentation
2023-06-04 12:02:11 +02:00
phobos2077
bfc9fd4d88
Add set_combat_free_move metarule and 2 arguments to STDPROCEDURE to make it more useful
2023-06-04 11:59:13 +02:00
phobos2077
f755e0a1dc
Header update
2023-06-04 11:59:13 +02:00
phobos2077
d5268f3fbc
Small update to headers
2023-05-25 02:37:51 +02:00
phobos2077
a3cfc481a5
Remove postbuild.cmd from git
2023-05-16 18:50:13 +02:00
phobos2077
427a978bb4
Implemented YAAM damage formula in script
2023-05-14 23:31:40 +02:00
phobos2077
e6e941e14c
Updated gl_compute_damage example script to work as 1:1 reflection of vanilla damage formula
...
- In hope that this will make it easier for someone to write his own damage formula
2023-05-14 22:50:33 +02:00
phobos2077
493003af54
Updated some defines
...
- ATKMODE defines removed to avoid confusion - these are really two 4-bit fields, not bit flags!
2023-05-14 01:44:15 +02:00
phobos2077
1683678657
Revert adding RMOBJ to avoid duplication from devine_extra.h
2023-05-08 10:38:35 +02:00
phobos2077
a05207cc83
Add some missing script defines
2023-05-08 02:53:31 +02:00
phobos2077
c2e6d743a3
Changed LoadGame_after to be called before LoadGame state is ended #94
2017-05-20 18:10:59 +07:00
phobos2077
0486192c3c
Updated rebracer.xml
2017-05-03 22:47:40 +07:00
phobos2077
83f2d48668
Fix hero appearance bug ( #92 ) and broken sfall global variables
...
- Changed LoadGame_before function to be called AFTER GameReset when loading the game
- Don't set appearance globals in RefreshPCArt function
- Moved functions for saving/loading appearance globals into HeroAppearance.cpp
2017-04-24 16:37:53 +07:00
phobos2077
fd4fe5fd0e
HeroAppearance: Fixed AppStyle and AppRace frms not being loaded and drawn #94
2017-04-24 13:41:05 +07:00
phobos2077
85020d66f2
Added new functions into docs #90
2017-04-15 22:17:42 +07:00
phobos2077
629641eb96
Added new HOOK_CARTRAVEL #90
2017-04-15 21:59:18 +07:00
phobos2077
0af8010861
Added scripting function "set_car_intface_art" #90
2017-04-15 02:04:21 +07:00
phobos2077
addccd2bc6
Added rebracer.xml
2017-04-12 00:35:25 +07:00
phobos2077
8a0ac2082e
Fixed some override structs not being initialized on starting the game, leading to min/max skills/stats/hit chances being wrong #92
2017-04-12 00:35:10 +07:00
phobos2077
d484be45c8
Added function car_gas_amount #90
...
- Sorted some defines
- Minor code formatting fixes
2017-04-08 13:48:14 +07:00
phobos2077
e34a00148f
Fixed path do Delegate.h in Inventory.h
2017-04-05 00:40:24 +07:00
phobos2077
478684f8ef
Enabled Elevators module and fixed incorrect loading from Elevators.ini
2017-04-05 00:16:30 +07:00
phobos2077
e2a383511d
Refactor opcodes in Objects.cpp
...
- Added missing argument type checks
- Replace asm blocks with wrapper function calls
- Use GameObject instead of DWORD
2017-04-03 23:27:33 +07:00
phobos2077
116c522bdc
Moved hard-coded "ControlCombat" mod from sfall into a global script #87
...
- Exactly the same functionality and settings
- Mod settings are now in sfall-mods.ini
2017-04-01 21:11:19 +07:00
phobos2077
9531fcbebd
Added new hook script HOOK_COMBATTURN - runs before and after every turn in combat
2017-04-01 20:31:19 +07:00
phobos2077
76a946c72e
Moved all combat-related hook scripts into separate unit
2017-04-01 16:09:34 +07:00
phobos2077
20bc5b9fd6
Make modules interfaces public
2017-04-01 16:01:53 +07:00
phobos2077
dcc471fc47
Reorganize HookScripts.cpp
...
- Moved most hook script implementations into several separate files
- Group HS implementations together by their category
2017-04-01 15:57:25 +07:00
phobos2077
d881dc9e89
Make Metarule.cpp more accessible
...
- Improve comments
- Rename metaruleTable and move it on top of the file
- Use C++ style iteration
2017-04-01 03:28:50 +07:00
phobos2077
fef690c2c2
Merge branch 'feature/armor-appearance' into develop
2017-04-01 02:21:58 +07:00
phobos2077
5bbdcbd2db
Added final version of NPC armor appearance script, compatible with both HeroAppearance mod and set_dude_obj (NPC control) function #82
2017-04-01 02:21:12 +07:00
phobos2077
24e9dde577
Add missing code for real_dude_obj
2017-04-01 02:15:09 +07:00
phobos2077
029419db3d
Added real_dude_obj scripting function, useful for checking if currently controlling NPC or "real" character
2017-04-01 02:14:27 +07:00
phobos2077
6e0fe881df
Added new hook script for controlling FID of character figure on inventory screen
2017-04-01 02:12:20 +07:00
phobos2077
203dcdf6be
Refactor adjust_fid function, make it compatible with NPC control, Hero Appearance and NPC Armor appearance mods
2017-04-01 00:20:00 +07:00
phobos2077
34500d9dd5
Replace adjust_fid engine function with C++ implementation
2017-03-31 20:55:45 +07:00
phobos2077
cbe987df25
First prototype of armor appearance mod (hook-based)
...
- Add test version of gl_npcarmor script with config file for FO2 RP
- Add some useful scripting headers
- Add new scripting functions to sfall.h
2017-03-30 01:20:44 +07:00
phobos2077
5dadba6e56
Better solution for NPC inventory FID: skip reading from proto, use existing art instead (partially fixes incompatibility with armor appearance mod);
...
Fixed conflict with HeroAppearance mod (assumed adjust_fid was always called for "real" Dude)
2017-03-28 02:49:55 +07:00
phobos2077
b592d6bdbe
PartyControl: added fix for displaying proper NPC art in inventory screens (not taking armor into account - like vanilla game); removed redundant SetInventoryCheck function; minor refactoring (not compatible with current scripted implementation of NPC armor appearance mod)
2017-03-28 01:26:40 +07:00
phobos2077
0fe6c2a426
Fixed crash after barter
2017-03-27 23:42:34 +07:00
phobos2077
32564d64d1
Added scripting functions for reading INI sections
2017-03-27 04:07:16 +07:00
phobos2077
897f1ab323
Fixed bug and added description for new scripting function #17
2017-03-27 00:58:06 +07:00
phobos2077
4e3168e2e3
Added function set_dude_obj to take control of any critter at any time [EXPERIMENTAL] #17
2017-03-27 00:18:27 +07:00
phobos2077
8a65172927
Minor refactoring of PartyControl
2017-03-27 00:17:37 +07:00
phobos2077
778230dde1
Added item_weight script function;
...
Return -1 on metarule argument validation error (to match normal opcodes) #63
2017-03-26 23:16:35 +07:00
phobos2077
6a78206c2e
Added SafeWriteBatch function for writing the same value to a list of addresses;
...
Rewrite AnimationsAtOnceLimit: get rid of redundant loops and unsafe heap allocations
2017-03-26 22:06:27 +07:00
phobos2077
c519fb6fb6
Replaced all usages of MakeCall with 3 arguments with either MakeJump or MakeCall (2 arguments) - code readability.
2017-03-26 20:10:44 +07:00
phobos2077
96fa2668cc
Reduce duplication in HookScripts's hooking code using HookCalls; Added function MakeJump to improve code readability
2017-03-26 20:00:49 +07:00
phobos2077
c32dc7664e
Added new modes for get_game_mod to match Crafty's; implemented HookCalls function to reduce code duplication #66
2017-03-26 19:41:04 +07:00
phobos2077
f2243f2874
Added definitions for AnimationSet structures (based on Crafty's work); refactor Proto struct definitions, added a couple of static asserts for safety
2017-03-23 01:57:06 +07:00
phobos2077
52e24a4dd4
Added a hack from Crafty that allows to use reg_anim_animate() inside combat_p_proc without game hanging in eternal loop #75
2017-03-23 01:13:49 +07:00
phobos2077
7bbe84feef
Fixed TOHIT hook issues: added 3 missing hook arguments, fixed incorrect attack type argument being passed to vanilla function, thus potentially breaking vanilla to hit calculations, even when not using any scripts at all
2017-03-18 21:45:28 +07:00
phobos2077
c83fe0690b
Merge branch 'develop' of https://github.com/phobos2077/sfall into develop
2017-03-18 20:26:11 +07:00
phobos2077
76e32e1bef
InputFuncs: added OnMouseClick delegate, moved debug editor related code into new module;
...
HookScripts: added check for map being loaded in MouseClick hook, minor renaming.
2017-03-18 20:23:34 +07:00
phobos2077
1f74aa5c22
Refactor LoadGameHook: replaced MainMenuLoop hook with separate game_reset and main_init_system hooks #83
2017-03-18 18:24:08 +07:00
phobos2077 and NovaRain
b48549b524
Fixed 0 prices in all shops when not using barter mods
...
(cherry picked from commit 2d278bf4c7 )
2017-03-18 10:34:01 +08:00
phobos2077
2525e8a005
Prevent crashes due to global scripts being executed during game closing
2017-03-18 03:21:50 +07:00
phobos2077
7c661ce408
Merge branch 'develop' of https://github.com/phobos2077/sfall into develop
2017-03-18 02:59:04 +07:00
phobos2077
2d278bf4c7
Fixed 0 prices in all shops when not using barter mods
2017-03-18 02:58:41 +07:00
phobos2077
2fbf4a0518
Add notes for new scripting functions
2017-03-16 02:01:29 +07:00
phobos2077
9514602f91
Removed CommonTypes.h, it's redundant because with precompiled header, Windows.h defines are available everywhere
2017-03-16 01:33:11 +07:00
phobos2077
adf8dd13dd
Moved highlighting-related settings into new "sfall-mods.ini", dedicated for scripted sfall mods;
...
Reverted description for MotionScannerFlags 1 and 2, it was actually correct before.
2017-03-16 01:21:20 +07:00
phobos2077
c5698d74ce
Update documentation on hook scripts
2017-03-14 02:24:30 +07:00
phobos2077
afadbb71c4
Refactor highlighting mod script, added check for outlined_object (via new scripting function), updated ddraw.ini to reflect the actual meaning of highighting-related settings (they way it worked for a long time); #53
...
HighlightMod is permanently removed from sfall code, it is now only a script.
2017-03-14 00:20:34 +07:00
phobos2077
a74bab42e8
Full implementation of highlight mod with motion scanner interaction; #53
...
Fixed incorrect string lookup failsafe in Inventory.cpp
2017-03-13 23:54:54 +07:00