diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md index 97d344d7..56e9e790 100644 --- a/artifacts/scripting/sfall function notes.md +++ b/artifacts/scripting/sfall function notes.md @@ -120,7 +120,7 @@ FUNCTION REFERENCE #### `void inc_npc_level(int pid/string name)` - Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party. - This function ignores the player's minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall's **NPCAutoLevel** or **PartyMemberNonRandomLevelUp** setting. -- Starting from sfall 4.4.10/3.8.50, the maximum possible NPC level is 10. +- Starting from sfall 4.5/3.8.50, the maximum possible NPC level is 10. ----- #### `int get_npc_level(int pid/string name)` @@ -823,7 +823,7 @@ sfall_funcX metarule functions - Items with unique IDs will not stack with other items of the same type in the inventory - To just get the current ID number of an object, use `sfall_func2("get_object_data", object, OBJ_DATA_ID)` - Unique ID numbers are saved in your savegame, and have a range from `0x10000000` to `0x7FFFFFFF` -- There is also a unique ID number range for the player and party members from 18000 to 83535 +- There is also a unique ID number range for the player and party members from 18000 to 16795215 - To assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument ---- @@ -848,7 +848,7 @@ sfall_funcX metarule functions - Loads a custom message file and returns the file ID number assigned to it, in the range of `0x3000` to `0x3FFF`, for use with the `message_str_game` function - `fileName`: the name of the custom message file (including the **.msg** extension) in the `text\\game\` directory - __NOTE:__ if the msg file does not exist in the current language directory, the function will try to load it from the `text\English\game\` directory -- __Deprecation notice:__ Starting from sfall 4.4.10/3.8.50, the two-argument form is deprecated. The `fileNumber` argument is ignored, and the function behaves the same as the one-argument form. +- __Deprecation notice:__ Starting from sfall 4.5/3.8.50, the two-argument form is deprecated. The `fileNumber` argument is ignored, and the function behaves the same as the one-argument form. ---- #### unwield_slot diff --git a/sfall/Modules/Objects.cpp b/sfall/Modules/Objects.cpp index 82c04332..0d758c65 100644 --- a/sfall/Modules/Objects.cpp +++ b/sfall/Modules/Objects.cpp @@ -31,7 +31,7 @@ static int maxCountLoadProto = 512; long Objects::uniqueID = UniqueID::Start; // current counter id, saving to sfallgv.sav bool Objects::IsUniqueID(long id) { - return (id > UniqueID::Start || (id >= fo::PLAYER_ID && id < 83536)); // 65535 maximum possible number of prototypes + return (id > UniqueID::Start || (id >= fo::PLAYER_ID && id < 16795216)); // party member ID = (pid & 0xFFFFFF) + PLAYER_ID } void Objects::SetScriptObjectID(fo::GameObject* obj) { @@ -97,11 +97,11 @@ identical: static __declspec(naked) void new_obj_id_hook() { __asm { - mov eax, 83535; + mov eax, 16795215; cmp ds:[FO_VAR_cur_id], eax; jle pickNewID; retn; -pickNewID: // skip PM range (18000 - 83535) +pickNewID: // skip PM range (18000 - 16795215) mov ds:[FO_VAR_cur_id], eax; jmp fo::funcoffs::new_obj_id_; }