Edited the log messages in LoadOrder.cpp

Cleaned up some module headers.

Updated version number in documents.

Updated changelog in sslc document, and removed the mention about
empty statements (it never worked).
This commit is contained in:
NovaRain
2023-06-21 22:21:12 +08:00
parent 3a3760704c
commit 3b29088818
13 changed files with 22 additions and 38 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
;sfall configuration settings ;sfall configuration settings
;v4.3.9 ;v4.4
[Main] [Main]
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash ;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
@@ -19,7 +19,7 @@ UseCommandLine=0
;This section allows you to set multiple paths to folders containing mods or patches ;This section allows you to set multiple paths to folders containing mods or patches
;Paths to folders and Fallout .dat files are supported ;Paths to folders and Fallout .dat files are supported
;The PatchFileXX options are available from 0 to 99. Larger numbers take precedence over smaller numbers (same as patchXXX.dat) ;The PatchFileXX options are available from 0 to 99. Larger numbers take precedence over smaller numbers (same as patchXXX.dat)
;Starting from 4.3.9/3.8.39, the game will load custom .dat files and folders from <GameRoot>\mods\mods_order.txt ;Starting from 4.4/3.8.40, the game will load custom .dat files and folders from <GameRoot>\mods\mods_order.txt
;The files and folders in mods_order.txt will have a higher priority than the PatchFileXX options ;The files and folders in mods_order.txt will have a higher priority than the PatchFileXX options
;The complete order of how the engine loads game data is: ;The complete order of how the engine loads game data is:
;master_patches > critter_patches > mods_order.txt > PatchFileXX > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat ;master_patches > critter_patches > mods_order.txt > PatchFileXX > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
+8 -11
View File
@@ -220,16 +220,6 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
end end
``` ```
- Empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the Fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
```
#define my_macro display_msg("foo");
procedure start begin
my_macro;
end
```
__NOTE:__ **Does not work currently.**
- Procedure stringify operator `@`: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by `@` by a string constant. - Procedure stringify operator `@`: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by `@` by a string constant.
- old: - old:
``` ```
@@ -360,6 +350,13 @@ There are several changes in this version of sslc which may result in problems f
### Changelog ### Changelog
**sfall 4.4:**
- fixed compiler crash when trying to define an exported procedure with variables
- fixed compiler giving "symbol or string expected" error when trying to call procedure using a string literal
- fixed optimizer not treating `call string_variable` as variable use
- fixed unused arguments in a procedure being removed incorrectly by the optimizer
- fixed unused string literals in an optimized-out procedure not being removed by the optimizer
**sfall 4.2.9:** **sfall 4.2.9:**
- added support for additional universal opcodes `sfall_func7` and `sfall_func8` - added support for additional universal opcodes `sfall_func7` and `sfall_func8`
- fixed a compilation error when the script has a UTF-8 BOM - fixed a compilation error when the script has a UTF-8 BOM
@@ -368,7 +365,7 @@ There are several changes in this version of sslc which may result in problems f
- added ability to declare local variables anywhere in the procedure body - added ability to declare local variables anywhere in the procedure body
**sfall 4.2.3:** **sfall 4.2.3:**
- fixed compiler giving "assignment operator expected" error when a variable-like macro is not being defined properly - fixed compiler giving "assignment operator expected" error when a variable-like macro is not defined properly
- added new logical operators `AndAlso`, `OrElse` for short-circuit evaluation of logical expressions - added new logical operators `AndAlso`, `OrElse` for short-circuit evaluation of logical expressions
- added an alternative (C/Java-style) assignment operator `=` - added an alternative (C/Java-style) assignment operator `=`
- added support for new `div` operator (unsigned integer division) - added support for new `div` operator (unsigned integer division)
+1 -1
View File
@@ -1112,7 +1112,7 @@
detail: int get_string_pointer(string text) detail: int get_string_pointer(string text)
doc: | doc: |
(DEPRECATED) Returns a pointer to a string variable or to a text (DEPRECATED) Returns a pointer to a string variable or to a text
- __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.3.9/3.8.39, you can return normal strings directly in the hook without calling the function - __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function
macro: sfall.h macro: sfall.h
- name: string_format - name: string_format
detail: string string_format(string format, any val1, any val2, ...) detail: string string_format(string format, any val1, any val2, ...)
+1 -1
View File
@@ -722,7 +722,7 @@ sfall_funcX metarule functions
#### get_string_pointer #### get_string_pointer
`int sfall_func1("get_string_pointer", string text)` `int sfall_func1("get_string_pointer", string text)`
- (DEPRECATED) Returns a pointer to a string variable or to a text - (DEPRECATED) Returns a pointer to a string variable or to a text
- __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.3.9/3.8.39, you can return normal strings directly in the hook without calling the function - __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function
---- ----
#### dialog_message #### dialog_message
-10
View File
@@ -228,16 +228,6 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
end end
``` ```
- Empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the Fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now it's always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition:
```
#define my_macro display_msg("foo");
procedure start begin
my_macro;
end
```
__NOTE:__ **Does not work currently.**
- Procedure stringify operator `@`: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by `@` by a string constant. - Procedure stringify operator `@`: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by `@` by a string constant.
- old: - old:
``` ```
-1
View File
@@ -27,7 +27,6 @@ class Animations : public Module {
public: public:
const char* name() { return "Animations"; } const char* name() { return "Animations"; }
void init(); void init();
//void exit() override;
}; };
} }
+2
View File
@@ -18,6 +18,8 @@
#pragma once #pragma once
#include "Module.h"
namespace sfall namespace sfall
{ {
-1
View File
@@ -27,7 +27,6 @@ class EngineTweaks : public Module {
public: public:
const char* name() { return "EngineTweaks"; } const char* name() { return "EngineTweaks"; }
void init(); void init();
//void exit() override;
}; };
} }
-1
View File
@@ -26,7 +26,6 @@ namespace sfall
class HeroAppearance : public Module { class HeroAppearance : public Module {
public: public:
const char* name() { return "HeroAppearance"; } const char* name() { return "HeroAppearance"; }
void init(); void init();
void exit() override; void exit() override;
+6 -6
View File
@@ -280,8 +280,8 @@ static bool NormalizePath(std::string &path) {
// Disallow paths trying to "escape" game folder: // Disallow paths trying to "escape" game folder:
if (path.find(':') != std::string::npos || if (path.find(':') != std::string::npos ||
path.find(".\\") != std::string::npos || path.find(".\\") != std::string::npos ||
path.find("..\\") != std::string::npos) { path.find("..\\") != std::string::npos) {
return false; return false;
} }
return !path.empty(); return !path.empty();
@@ -304,7 +304,7 @@ static bool FileOrFolderExists(const std::string& path) {
static bool ValidateExtraPatch(std::string& path, const char* basePath, const char* entryName) { static bool ValidateExtraPatch(std::string& path, const char* basePath, const char* entryName) {
if (!NormalizePath(path)) { if (!NormalizePath(path)) {
if (!path.empty()) { if (!path.empty()) {
dlog_f("Error: %s entry invalid: '%s'\n", DL_INIT, entryName, path.c_str()); dlog_f("Error: %s invalid entry: \"%s\"\n", DL_INIT, entryName, path.c_str());
} }
return false; return false;
} }
@@ -333,12 +333,12 @@ static void GetExtraPatches() {
// If the mods folder does not exist, create it. // If the mods folder does not exist, create it.
if (!FolderExists(modsPath)) { if (!FolderExists(modsPath)) {
dlog_f("Mods folder does not exist, creating: %s\n", DL_INIT, modsPath.c_str()); dlog_f("Creating Mods folder: %s\n", DL_INIT, modsPath.c_str() + 2);
CreateDirectoryA(modsPath.c_str(), 0); CreateDirectoryA(modsPath.c_str(), 0);
} }
// If load order file does not exist, initialize it automatically with mods already in the mods folder. // If load order file does not exist, initialize it automatically with mods already in the mods folder.
if (!FileExists(loadOrderFilePath)) { if (!FileExists(loadOrderFilePath)) {
dlog_f("Mods Order file does not exist, generating based on contents of Mods folder: %s\n", DL_INIT, loadOrderFilePath.c_str()); dlog_f("Generating Mods Order file based on the contents of Mods folder: %s\n", DL_INIT, loadOrderFilePath.c_str() + 2);
std::ofstream loadOrderFile(loadOrderFilePath, std::ios::out | std::ios::trunc); std::ofstream loadOrderFile(loadOrderFilePath, std::ios::out | std::ios::trunc);
if (loadOrderFile.is_open()) { if (loadOrderFile.is_open()) {
// Search all .dat files and folders in the mods folder. // Search all .dat files and folders in the mods folder.
@@ -358,7 +358,7 @@ static void GetExtraPatches() {
// Sort the search result. // Sort the search result.
std::sort(autoLoadedPatchFiles.begin(), autoLoadedPatchFiles.end()); std::sort(autoLoadedPatchFiles.begin(), autoLoadedPatchFiles.end());
// Write found files into load order file. // Write found files into load order file.
for (auto& filePath : autoLoadedPatchFiles) { for (const auto& filePath : autoLoadedPatchFiles) {
loadOrderFile << filePath << '\n'; loadOrderFile << filePath << '\n';
} }
} else { } else {
-1
View File
@@ -27,7 +27,6 @@ namespace sfall
class MainLoopHook : public Module { class MainLoopHook : public Module {
public: public:
const char* name() { return "MainLoopHook"; } const char* name() { return "MainLoopHook"; }
void init(); void init();
// Main game loop (real-time action) // Main game loop (real-time action)
-1
View File
@@ -33,4 +33,3 @@ public:
}; };
} }
+2 -2
View File
@@ -180,9 +180,9 @@ static void SetCurrentDude(fo::GameObject* npc) {
// copy existing party member perks or reset list for non-party member NPC // copy existing party member perks or reset list for non-party member NPC
long isPartyMember = fo::util::IsPartyMemberByPid(npc->protoId); long isPartyMember = fo::util::IsPartyMemberByPid(npc->protoId);
if (isPartyMember) { if (isPartyMember) {
std::memcpy(fo::var::perkLevelDataList, fo::var::perkLevelDataList[isPartyMember - 1].perkData, sizeof(DWORD) * fo::Perk::PERK_count); std::memcpy(fo::var::perkLevelDataList, fo::var::perkLevelDataList[isPartyMember - 1].perkData, sizeof(DWORD) * fo::PERK_count);
} else { } else {
std::memset(fo::var::perkLevelDataList, 0, sizeof(DWORD) * fo::Perk::PERK_count); std::memset(fo::var::perkLevelDataList, 0, sizeof(DWORD) * fo::PERK_count);
} }
// change level // change level