Jump to content

zilav

Members
  • Content Count

    1035
  • Joined

  • Last visited

About zilav

  • Rank
    Champion

Recent Profile Visitors

2642 profile views
  1. Only direct "referenced by" records have meaning (what xEdit already shows you), because if you try to go deeper checking references of references, other records can backward reference previous records creating infinite loops, and even recursion itself depending on how deep it goes could potentially grab all records in a plugin in the end depending on it's structure. That's why there is no such function in xEdit as "copy a record and it's references as new into the other plugin", this is like solving a single equotion with several variables. Only a human can decide when to stop and what should be included and what to skip. Newer versions of xEdit have built-in plugins merging functions, just search this thread for "merge" since I already posted step by step instruction.
  2. TES4 Header is the first record (element) in a plugin file, so header := ElementByIndex(f, 0); where `f` is a file object which you can get either by index from loaded plugins f := FileByIndex(N) or from a record f := GetFile(e), so getting the header from Oblivion.esm which is always loaded first for example header := ElementByIndex(FileByIndex(0), 0); Not sure about namespaces. You can place your code into separate .pas files and include them with using MyFile; at the top of the script. Storing additional data in separate files is perfectly fine, some demo scripts do that already, for example `Oblivion - Items lookup replacement.pas`. Recursion while checking for the element type can be seen in the `Skyrim - List used scripts.pas`. You should look into existing scripts more often, they contain a lot of example of how to do things in xEdit scripts and included for that purpose. No idea why would you need graphs for references, you provided no information on what exactly you want to do. Maybe you won't need graphs, references, recursions, etc, and your task can be implemented way more easier. By the way xEdit has discord server (button in the right upper corner on xEdit windiw) with a separare channel devoted to scripting.
  3. Updating HEDR is not necessary. You can skip overrides and process only the new records in a plugin using if IsMaster(e) then ... instead of checking the load order byte. By the way + ($00 shl 24) part does nothing (you shift zero to the left 24 times producing the same zero and adding it, and as we all know adding zero doesn't change the result). Also FormIDs should start from $800, below that are reserved.
  4. Lip files are named after the INFOs only, so if you want to renumber DIALs too then add a check to rename files only for INFOs.
  5. Looks fine (if RenameFile doesn't work, not a fan of starting cmd for each renaming). The only possible issue is SetLoadOrderFormID - you provide formidstart with the order byte of 00 (which corresponds to the file loaded at index 0 which is almost always Oblivion.esm) but this function expects load order corrected FormID. This is also somewhat relevant to RecordByFormID functon, however it works with file index FormIDs (00XXXXXX are overrides of the first master of a plugin, 01XXXXXX overrides second master, etc. Order byte > highest master index in the header is a new record). So for example if the plugin you are renumbering is loaded at the index 2 and has a single master Oblivion.esm, then RecordByFormID should be used with 01XXXXXX formids and SetLoadOrderFormID with 02XXXXXX. And you forgot about if Signature(e) <> 'INFO' then Exit;
  6. Forum has bugged out and I couldn't type in the same post, so lets continue. Your logic is fine - you have some FormIDs space to change to, you cycle over it, check that FormID is free, then lookup matching lip file names by FormID (cycle over list of files in a directory and check with Pos for FormID with zero load order byte), rename file(s), change FormID of a record. 1) The code to get the list of lip files should be in Initialize function which is called once when the script starts, you don't want to populate that list over and over again for each processed record. 2) You need to process INFO records only, so if Signature(e) <> 'INFO' then Exit; should be the first line of code in Process function. 3) No need to cycle over FormIDs space for each processed record. Set the initial FormID number to look from using global integer variable in Initialize function, then in Process make a loop to increment it by 1 until FormID number is free. Something like while Assigned(RecordByFormID(GetFile(e), LookupFormID, True)) do Inc(LookupFormID); 4) There is RenameFile function in Delphi for renaming files, try it instead (not sure if it is exposed for scripting).
  7. '$' in Pascal is the same as '0x' in C - a prefix indicating a hex number in a string. Alright, so you are changing FormIDs yourself and want to rename associated assets. First I suggest you to stop treating FormIDs as strings, they are integer 32 bits numbers. If you want to remove/zero the load order byte then FormID and $00FFFFFF will do that. To set load order byte (assuming that load order byte is already zero) FormID or (order shl 24) So the final code to change load order number in FormID will be FormID := (FormID and $00FFFFFF) or (order shl 24); This avoids all those string conversions and $.
  8. xEdit has discord server. You need to be more specific on what you want to do. As I see you want to rename .lip files because FormIDs have changed in a plugin, and perform some sort of a weird lookup matching in a cycle. Lip file name consist of EditorID of QUST + EditorID of DIAL + FormID + Response Number. The only unique part in this name is FormID and the rest can repeat in quite a lot of files, so I don't understand the logic of how you match the old lip file name. This is like solving a single equation with several variables.
  9. JSON convertion works with all games from Morrowind to Fallout 4. When you select an operation in Sniff it shows the list of supported games.
  10. No, it doesn't accept wildcards. You'll have to modify it for that or just provide all the possible replacement pairs (it supports any number of them). For example replace all "textures\old\wood" with something else in report only mode so it will list all such used textures in the messages, then use that info for actual replacement. I doubt it will take you more than a few minutes. By the way it is a part of standalone Sniff tool https://www.nexusmods.com/newvegas/mods/67829
  11. Create any new record in a plugin, copy it's FormID, remove record.
  12. The old tests mentioned here are subjective, they are based on human perception only. Recently New Vegas has been profiled with debugging software to test in which code parts the engine spends the most time and zlib code had a significant weight, and this is an objective test. In other words - the fact. That's why New Vegas decompressor was made first a year ago. We even pushed forward and also utilize ESM decompression now (half of the game master is compressed with zlib) to completely get rid of zlib bottleneck in the engine. Decompression showed performance increase both objectively (through profilers) and subjectively (stutter perception while playing) by proficient mod authors in New Vegas modding scene and users. It is an integral part of TTW and has been extensively tested by dozens of thousands of users for almost a year as of now, and I can say with all assurance that decompression didn't cause any issues. People asked for same feature for Oblivion, that's why I made it. Considering that FO3/FNV are very similar to Oblivion I don't see why it won't help with performance here too. But I'm not forcing anyone to decompress their files, I don't even advise that anywhere. I didn't make any forum/reddit/news posts, simply uploaded it for people who asked for and want to use it.
  13. It is in the first topic opening post
  14. xEdit source code is available on GitHub https://github.com/TES5Edit/TES5Edit/
  15. Contributed in the past while Elminster was away.

Support us on Patreon!

Patreon
×
×
  • Create New...