HzanRsxa2959 Posted March 3, 2021 Author Share Posted March 3, 2021 Just now, fastman92 said: Remember to leave the task of finding the free weapon ID up to the FLA: Is it compatible with saves? Link to comment Share on other sites More sharing options...
fastman92 Posted March 3, 2021 Share Posted March 3, 2021 Just now, HzanRsxa2959 said: Is it compatible with saves? No. It only finds a free ID while loading a file, that's all. Is AutoID somehow compatible with saves? Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 3, 2021 Author Share Posted March 3, 2021 2 minutes ago, fastman92 said: Is AutoID somehow compatible with saves? Yeah, that's actually one big feature of AutoID: compatibility with saves. Seriously, CLEO+ is a blessing. Using it, before the game saves (on the SAVE_CONFIRMATION event), I remove the weapon from the player, and then give it back after, and whenever the player loads that game. It's working well so far. Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 3, 2021 Author Share Posted March 3, 2021 Adapted Mods: Cheat-Menu LUA 2.2 Portable: Fixed it not detecting the latest version of AutoID. Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 3, 2021 Author Share Posted March 3, 2021 Adapted Mods: Cheat-Menu LUA 2.2 Portable: Fixed it detecting AutoID even when AutoID was not installed. Sorry for such frequent updates. The issue has finally been resolved. Link to comment Share on other sites More sharing options...
fastman92 Posted March 4, 2021 Share Posted March 4, 2021 (edited) For information. "Count of killable model IDs" é alterada para metade do limite de ID do modelo (modificável por "FILE_TYPE_DFF", mas requer que o FLA seja instalado fora do Mod Loader)." This limit takes the following amount of memory: (Count of killable IDs * 2 * 2) bytes by default: 800 * 2 * 2 = 3600 bytes. This limit takes a very little memory. Edited March 4, 2021 by fastman92 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 5, 2021 Author Share Posted March 5, 2021 Let's see: Quote Default Game without AutoID: 3.6kB (800). Default Game: 40kB (10000). SAxVCxLC: 60kB (15000). GTA Underground (theoretically; I'm not sure AutoID works there): 120kB (30000). @fastman92 I don't understand. Is it too much? Should I decrease it? Maybe one-fourth instead of half? Or maybe leave it up to the mod-makers to change it when necessary (they can put the setting in their mods, after all)? Link to comment Share on other sites More sharing options...
fastman92 Posted March 5, 2021 Share Posted March 5, 2021 (edited) 2 hours ago, HzanRsxa2959 said: Let's see: @fastman92 I don't understand. Is it too much? Should I decrease it? Maybe one-fourth instead of half? Or maybe leave it up to the mod-makers to change it when necessary (they can put the setting in their mods, after all)? No. I have posted it just for information. Whether 4 bytes of memory per killable ID is too much or not, this is for you to decide and possibly do some implementation changes knowing this. Edited March 5, 2021 by fastman92 HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 15, 2021 Author Share Posted March 15, 2021 (edited) Update 2.1.5: 1. Added support for FLA Vehicle Audio Settings (requires initialization and will copy file gtasa_VehicleAudioSettings.cfg to AutoID directory while modifying the original file; use the section "FLS:"). I initially didn't implement it because I thought that Mod Loader already handled it, but it turns out that this is not the case, and is still a consideration: https://github.com/thelink2012/modloader/issues/53.2. Replaced many operations and functions (related mainly to loops, tables and strings), resulting in a performance boost. (Not much with a thousand files or less, but it was noticeable with 10000 or more).3. Now, if run out of regular free model IDs (objects, weapons etc.), then AutoID will use killable free model IDs (peds, vehicles) for regular models instead if there are any left. (As such, it actually makes sense to set the killable model ID limit to half the model ID limit, as no free ID will be wasted.)4. Marked IDs 15000-15024 as occupied for better compatibility with command GET_MODEL_DOESNT_EXIST_IN_RANGE from CLEO+.5. It was available from 2.1 but I forgot to tell: Now, for the first time in the history of GTA SA mods, it is possible to get the name (dff name) of a model from its ID (model ID)! In addition to: ID (model ID) to TXD (txd name), Name (dff name) to TXD (txd name), and many more; even sections dedicated to types! For example, suppose you want to get the dff name of model 346: {$CLEO .cs} {$USE INI} 0AC8: [email protected] = allocate_memory_size 255 if 0AF4: [email protected] = read_string_from_ini_file "AutoID\\AllModels.ini" section "IDsToNames" key "346" then while true 0AD1: show_formatted_text_highpriority "%s" time 0 [email protected] wait 0 end else 0AC9: free_allocated_memory [email protected] 0A93: terminate_this_custom_script end It will display "colt45" by default. For weapon icons, prefer getting the TXD name (IDsToTXDsType4). After installing AutoID and launching the game once, go to game directory\AutoID. See that big, phat, multi-MB file named "AllModels.ini"? Open it and see its contents. Know how to handle ini files, and you can use it easily. As for the typed sections, they correspond to the enum "ModelInfoType" at here: https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CBaseModelInfo.h. E.g., if you want to access the list of only weapon models, use the section(s) ending with "Type4". The sections starting with "IndexesTo" are for iterating through SCM: {$CLEO .cs} {$USE CLEO+} {$USE INI} const list = [email protected] max = [email protected] s = [email protected] i = [email protected] id = [email protected] name = [email protected] end 0E72: create_list 0 store_to list 0AF0: max = read_int_from_ini_file "AutoID\\AllModels.ini" section "IndexesToIDsType7" key "max" if max > 0 then 0AC8: s = allocate_memory_size 255 for i = 1 to max 0AD3: s = string_format "%d" i if 0AF0: id = read_int_from_ini_file "AutoID\\AllModels.ini" section "IndexesToIDsType7" key s then 0AD3: s = string_format "%d" id if 0AF4: s = read_string_from_ini_file "AutoID\\AllModels.ini" section "IndexesToIDsType7" key s then 0AC8: name = allocate_memory_size 255 0D4D: copy_string s to name 0E74: list_add list value name end end end while true wait 0 end 0A93: terminate_this_custom_script This code iterates through the list of all the peds models currently defined in the game, and stores them in a CLEO+ list. It will probably kill performance, though; prefer to use a faster language instead. LuaJIT is fast enough in my experience- especially the "inicfg" libary built into MoonLoader. If using a fast language, e.g. Lua, then read the ini file inside the main() function (after game loads), preferably after a delay like wait(100). As in AutoSpawn: local models -- make this variable local TO this script, but global IN this script, for it to be accessible in all functions function main() wait(100) models = inicfg.load({}, table.concat({getGameDirectory(), "\\AutoID\\AllModels.ini}) end By getting the dff/txd name, you can have functions such as: show weapon icons, in-game entity spawner (like AutoSpawn), and even an in-game map editor (be sure to adapt it to AutoID)! Note: Since I was scanning the game's data files already, I thought that I should create a list of the model and txd names of the scanned lines. Creating this list has had a minimal impact on performance.6. Added a readme with various links. Only the "AutoID.lua" file has been changed: replace it for a quick installation. Edited March 16, 2021 by HzanRsxa2959 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 18, 2021 Author Share Posted March 18, 2021 Adapted Mods: Added: Pre-lighting Fixes Pack. Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 25, 2021 Author Share Posted March 25, 2021 (edited) Update 2.1.6: At least two users had reported that AutoID was not working, and giving the error "not enough memory", later to be identified to be caused when used with any version of fastman92 Limit Adjuster other than 5.6 from MixMods. This issue has been resolved by reading the required values from the fastman92 Limit Adjuster INI file upon game launch. Previously, these values were read from memory addresses within the plugin, which gave errors between different plugin versions. Thanks to @XG417 for the help. Note: Only the "AutoID.lua" file has been changed; replace it for a quick update. Adapted Mods: Cheat-Menu LUA 2.2 Portable: The "Auto Aim" feature from the "Weapon" tab has been disabled as it caused issues with different control types. Previously, the script was loaded on game launch, slowing down the initialization process. Now, the original script is launched using a "launcher" script, one second after the game loads. The file structure has changed, so it is recommended to delete older versions of this mod before installing this one. I'm still waiting for the HDD to start working on the ASI version, so in the meantime, I'll keep working on this. Here are some ideas for the next version: Support for FLA Radar Blip Sprite Filenames, but I can't figure out a way to load icons. Support for FLA paths (gonna need to carefully read the documentation for this one). Edited March 25, 2021 by HzanRsxa2959 XG417 1 Link to comment Share on other sites More sharing options...
fastman92 Posted March 26, 2021 Share Posted March 26, 2021 (edited) Reading memory from ASI plugin by constant address can never be a good idea. The FLA gets updated. For few things the FLA has got exported functions, for example weapon name I think. You can see Exports.h from the FLA It's also possible to read the value from game EXE memory. FLA4 extended path format is the newest and the simplest format. You only need to support this one. It's very similar to standard path format, with things changed. Edited March 26, 2021 by fastman92 HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted March 26, 2021 Author Share Posted March 26, 2021 (edited) Update 2.1.7: Fixed the custom save system not working correctly with modified save file format, e.g., from fastman92 Limit Adjuster. Now it will work with every save file format. Previous AutoID custom saves may not work, though. Small but important update. Changed files: AutoID.lua. (Same directory as AutoID.lua)\AutoID\AutoID.s. Replace them for a quick install. Edited March 26, 2021 by HzanRsxa2959 XG417 1 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted April 8, 2021 Author Share Posted April 8, 2021 (edited) Update 2.1.8: Here it is: The last update. I tried to add support for FLA blips and paths, but it was going nowhere. Maybe in the ASI version. Do report any bugs, though, and I'll probably release another version with them fixed. 1. Some major and minor code improvements. 2. Fixed Melee Combos not being replaced with their assigned IDs when reading AUID files. 3. Added a new feature: Silent Mode: Quote Now, when reading AUID files, if the AUID file name enclosed in <> has a * at the end and the AUID file does not exist, then no error message will be shown and a default ID (-1 if not defined) will be assigned instead. The format is this: <AUID file name*default ID, -1 if not set>, i.e., <coltanaconda*1239> will be assigned ID 1239 if coltanaconda.auid is not found or not assigned any ID. This is especially useful with the AutoID section "FIL: filename". 4. Improved the dialog boxes: They are now more informative. Only the AutoID.lua file has changed. Replace it for a quick update. Edited April 8, 2021 by HzanRsxa2959 -Anti- and XG417 2 Link to comment Share on other sites More sharing options...
Insomnium Posted June 1, 2021 Share Posted June 1, 2021 Great mod, I have only one question tho. When I adopt a car for AutoID, how am I supposed to adapt the cargrp.dat file so the car spawns in the world? Instead of editing cargrp.dat, I mean. HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted June 1, 2021 Author Share Posted June 1, 2021 (edited) 6 hours ago, Insomnium said: Great mod Thanks. 6 hours ago, Insomnium said: I have only one question tho. When I adopt a car for AutoID, how am I supposed to adapt the cargrp.dat file so the car spawns in the world? Instead of editing cargrp.dat, I mean. Spoiler Note: This method recommends Mod Loader. 1. Copy the cargrp.dat from the game's data folder to the car's mod folder. If you don't have Mod Loader, then you need to edit the cargrp.dat from the game's data folder directly, so open that. 2. Open the cargrp.dat with any text editor. 3. Here is the format of each cargrp.dat line: Quote modelname1, modelname2, modelname3 #comment modelnames cannot contain commas or spaces. If there are more than one modelnames in a line, they must contain between them a comma, a space, or a combination of both. The order of modelnames does not matter. Each line can have a maximum of 23 modelnames by default, but AutoID increases the limit to 63 if fastman92 Limit Adjuster is installed. Comments start with a "#", are optional, and can be placed anywhere but will include all the data that comes afterwards until the next line. The comment at the end of the line describes the zone in which the vehicle will spawn. 4. For example, here is one cargrp.dat line: Quote buffalo, stretch, taxi, cabbie, coach, flash, sultan, club # POPCYCLE_GROUP_CLUBBERS And here is the same line after I added a car with model benzin and the end of it: Quote buffalo, stretch, taxi, cabbie, coach, flash, sultan, club, benzin # POPCYCLE_GROUP_CLUBBERS 5. Mod Loader will automatically merge this modified cargrp.dat with the original cargrp.dat at runtime and load the merged file instead of the original. Only if you have Mod Loader, of course. 6. To find the newly-added car, search the in-game location where the other cars in the list spawn. EDIT: Everyone: After taking a break, I have been working on a new version (2.1.9) for about a week. I should be done in about two days. Edited June 1, 2021 by HzanRsxa2959 XG417 and Insomnium 2 Link to comment Share on other sites More sharing options...
Insomnium Posted June 1, 2021 Share Posted June 1, 2021 Thank you, this helped a lot. Looking forward for the new version of the mod. HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
CarlJohnson92 Posted June 2, 2021 Share Posted June 2, 2021 YeS BaBy ThANkS YoU HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
XG417 Posted June 2, 2021 Share Posted June 2, 2021 11 hours ago, HzanRsxa2959 said: After taking a break, I have been working on a new version (2.1.9) for about a week. I should be done in about two days. That's super neat! What can we expect in the new version? HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted June 2, 2021 Author Share Posted June 2, 2021 (edited) Changes in 2.1.9: Now AutoID will ignore IDE files inside Mod Loader which have a missing level (gta.dat) line (peds.ide, vehicles.ide, default.ide and veh_mods.ide are always read). Previously, ALL the files inside Mod Loader were read, which resulted in some free IDs being wasted. (I don't have much faith in this feature, so if it proves to be more trouble than it is worth, I will remove it.) Both the read and ignored IDE files are listed under "Read IDE files:" in file game directory\AutoID\logs\Assigned.log. Fixed the formatting of fastman92 Limit Adjuster's gtasa_vehicleAudioSettings.cfg which fixed issues with older versions of FLA complaining about non-existent models being registered. Vastly improved the Message Boxes. Fixed Silent Mode using -1 even if a default ID was provided. Now all AUID files which do not have any ID assigned will be written under "Unassigned IDs:" in file game directory\AutoID\logs\Assigned.log. Empty lines are now skipped while reading AUID files. Now installing at least one vehicle adapted to AutoID increases the "VehicleStructs" value in fastman92limitAdjuster_GTASA.ini by 2500. This is to prevent any crashes caused by changing the "Cargrp cars per group" value to 63 if Open Limit Adjuster is not installed. It's late here, so I will post it tomorrow morning. Edited June 4, 2021 by HzanRsxa2959 XG417, -Anti- and Insomnium 3 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted June 4, 2021 Author Share Posted June 4, 2021 (edited) I was going to post this early yesterday, but something suddenly came up. Sorry for being so late. But the silver lining is that this also gave me a chance to fix 2 serious issues with saving weapons. Anyways, here: Update 2.1.9: The post above is included. AutoID will no longer save adapted weapons that have run out of ammo (state 3). This fixes the player being given back the adapted weapon with 1 ammo on game save/load even if said adapted weapon had run out of ammo beforehand. Improved the method that added the ammo to adapted weapons after giving them to the player on game save/load. This increases compatibility with mods that prevent the weapons from reloading when switching between them (E.g., Scroll Reload Fix in MixSets). Changed files: AutoID.lua. (Same directory as AutoID.lua)\AutoID\AutoID.s. Replace them for a quick update. Adapted Mods: Spoiler 1. SAMP Objects: Combined all of the 200+ TXD files into a single TXD file named samphzan.txd to prevent the game from hitting the limit of the amount of different TXD files. Added a combined IFP file named SAMPHZAN.ifp for the animated objects. 2. Los Santos City Hall: Modified the map a little, adding collision to the roof and tables with flower pots. 3. Cheat-Menu LUA 2.2 Portable: Now reloading the script will no longer update the Mod Loader log. The Object Spawner now displays the AutoID objects in alphabetical order. Now you can hold X to hide the cursor and regain control of the mouse. 4. Added: Food Eating Fix Links added to main post. Edited June 4, 2021 by HzanRsxa2959 Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted July 19, 2021 Author Share Posted July 19, 2021 (edited) Update 2.2: Fixed a serious issue with the Refined IDE Search feature (point 1 from here)- IDE files that were not explicitly registered in Mod Loader using a level line but were still being loaded by Mod Loader were mistakenly being ignored by AutoID, which resulted in occupied model IDs being marked as free and ultimately lead to serious bugs and/or crashing. Special thanks to @XG417 for the help. Changed files: AutoID.lua. Note: I discovered a serious incompatibility with another mod: Garage Extender, which I plan to resolve in the next version (2.2.1). I am currently clueless and will appreciate any and all help, specifically: How to get access to the CStoredCar structure of all the cars stored in garages in Garage Extender. Links added to main post. Edited July 20, 2021 by HzanRsxa2959 XG417 1 Link to comment Share on other sites More sharing options...
wwwwandrarijaz Posted August 4, 2021 Share Posted August 4, 2021 On 3/1/2021 at 2:01 AM, Pedro2737 said: incompatible with the moonloader outside the modloader is the "failed to identify caller ...setup asi " or something caused due to it? Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted August 5, 2021 Author Share Posted August 5, 2021 16 hours ago, LolPacino said: is the "failed to identify caller ...setup asi " or something caused due to it? The error message is show by Mod Loader, but yes: It is caused by MoonLoader being outside Mod Loader. Link to comment Share on other sites More sharing options...
wwwwandrarijaz Posted August 7, 2021 Share Posted August 7, 2021 On 8/5/2021 at 6:19 PM, HzanRsxa2959 said: The error message is show by Mod Loader, but yes: It is caused by MoonLoader being outside Mod Loader. Allriht thanks for tellan HzanRsxa2959 1 Link to comment Share on other sites More sharing options...
wwwwandrarijaz Posted August 15, 2021 Share Posted August 15, 2021 and how am i supposed to download the adapted mods gicen in the 1st post? Link to comment Share on other sites More sharing options...
HzanRsxa2959 Posted August 15, 2021 Author Share Posted August 15, 2021 Open the spoiler below "Adapted Mods:". Open the spoiler below either "ShareMods:" or "Google Drive:". Click the name of the mod you want to download. Download the mod archive. Extract the mod folder inside Mod Loader. Start the game. AutoID may initialize the new data and close the game. If the game still requires initialization after doing so for more than 5 times in a row, then report here. Play the game. Link to comment Share on other sites More sharing options...