Gathered most of the pearl scripts into a heap and adapted them to a single library. The archives are all taken from the AMK website, and re-uploaded here because they were on a Yandex disk
xr file unpackers gamemtl.xr (full unpacking supported) lanims.xr (full unpacking supported) particles.xr (only unpacking into binary files is supported) shaders.xr (full unpacking supported) shaders_xrlc.xr (full unpacking supported) senvironment.xr (full unpacking supported)
Introduction (Hide) As some may know, the X-Ray Engine Toolset is developing utilities that we inherited along with the source code from prominent community programmers (first of all, of course, bardak). Due to my meager programming skills, I primarily deal with perl scripts - ACDC, game.graph recompiler, etc. In this thread, I'm asking those modders who often work with perl scripts to help with catching bugs. First of all, I'm interested in Universal ACDC - which mod spawns it doesn't unpack, which features don't work, whatever you find. Sound thoughts on the development of scripts are also welcome. I am hope for your help. Readme from ACDC: universal acdc-S.T.A.L.K.E.R. *.spawn compiler/decompiler-Version: 1.38 Last edit date: 05/21/2014 Briefly This acdc is designed to unpack and pack all.spawn/level.spawn from any build starting from 1265. Main features: -unpacking of original PM, CN, RFP spawns and PM builds starting from xrCore build 1265. - unpacking spawns from mods (requires config folder from mod) -convert spawn to any other version. -mass replacement of game vertices in the unpacked spawn. - split all.spawn into level.spawns and level.games -compare unpacked spawn files -updating vertices according to object coordinates What you need for work: -actually, the spawn itself (all.spawn, level.spawn) -game.graph (only if unpacking all.spawn). If all.spawn is from build 3120, CN or WP - game.graph is not needed (it is built into the spawn). -configs folder (if you unpack the mod and acdc complains about unknown section) For correct work, use strictly the latest version of stkutils with the folder. Usage: Put all.spawn (or level.spawn) and game.graph in the folder with the program, make a batch file (commands below), run a batch file, enjoy life. Explanation of the following text: angle brackets (<>) indicate the value of the option. This is the way to spawn a folder for unpacking, etc., that is, what you need to enter. In square brackets ([]) optional options are specified. Options without brackets are required. Spawn Unpacking (Hide) The mode is intended for unpacking all.spawn and level.spawn files Command: universal_acdc.pl -d <spawn_file> [common_options] Command: universal_acdc.pl -d <spawn_file> -d <spawn_file> - path to spawn. common_options - common options. Read about them below. When unpacking spawns from mods, an "unknown section" error may occur. This means that the mod uses non-standard item/mob sections. To unpack such a spawn, you must use the -scan key, specifying it as a parameter path to the config/configs folder. For an example, see the acdc_decompile_scan batch file. Spawn packing The mode is intended for packing unpacked spawn text files into all.spawn or level.spawn Command: universal_acdc.pl -compile <dir> [-idx <index_file>] [-f <flag1,flag2,...>] Command: universal_acdc.pl -compile <dir> [-idx <index_file>] [-f <flag1,flag2,...>] -compile <dir> - folder containing the unpacked spawn. If you are working in the current folder, <dir> is not needed. common_options - common options. Read about them below. -idx <index_file> - with this key, the script will generate an ltx config with sections like: [13_box_wood_01_0021] ;format - "location_index"_"object_name" id = 2907 ;object id story_id = -1 ;story_id of the object Such records will be created for ALL objects from the spawn. If you specify the -idx key without the path to the config, it will appear in the folder with acdc (spawn_ids). Why is this needed? In the game, you can open this file from scripts and find the object you need. If earlier, to find the desired object id by name, it was necessary to go through all the objects in the game, now this can be done by simply reading the id from the desired config section. There are also some additional features: - when compiling for correct work, it is not necessary to put down all sections in the spawn version and script_version parameters. It is enough to put them in the actor section, the addc will use them further. Useful when the spawn is "prefabricated". - when compiling, the uniqueness of the story_id parameters is controlled so as not to suffer later with game crashes. Spawn conversion The mode allows you to convert the spawns of PM, CN, ZP among themselves. Command: universal_acdc.pl -convert <file> -version <new_version> [common_options] Command: universal_acdc.pl -convert <file> -version <new_version> [common_options] -convert <file> - file to be converted. Can be specified as a packed (*.spawn) spawn, and unpacked (alife_***.ltx). Attention! Since the graph and cross-tables in the CN and WP are sewn into the spawn, to convert PACKED PM spawns to these formats you will need to put in a folder with acdc levels folder from the game. It is not necessary to copy all the files, it is enough to leave in the folder with each location level.gct file.
-version <new_version> - new spawn version. You can pick up the version by looking at the spawn_versions.txt file common_options - common options. Read about them below. It also supports fine-tuning the conversion through the convert.ini file. The file has two sections: [exclude] and [change]. In the exclude section, you can write those sections, which must be removed from spawn during conversion. Example: [exclude] secti m car, flesh_weak The change section contains the names of those sections in which something needs to be changed or added. Example: [change] secti Next fill the file with entries for those sections that you specified in change. Example: [inventory_box] //section_name of the desired section add:custom_data = PREVED //the add prefix is used for the parameters to be added to add:game_vertex_id = 10000 //required value (if number - added, if string - added to the end) rep:level_vertex_id = 0 //rep prefix is used for parameters that need to be replaced with something General example. The following config will cause all stalkers to have 500 added to their game vertex and the visual will change to the visual of warriors in a gas mask: [exclude] [change] secti [stalker] add:game_vertex_id = 500 rep:visual_name = actors/soldier/soldier_antigas.ogf Bulk replacement of vertices (Hide) When connecting new locations without recompiling the graph, it becomes necessary to simultaneously shift all game vertices of spawning new locations by some specific value. It can be done in this mode. Command: acdc -parse <file> -old <old_gvid0> -new <new_gvid0> [-way] [common_options] Command: acdc -parse <file> -old <old_gvid0> -new <new_gvid0> [-way] [common_options] -parse <file> - the name of the ltx where the spawn is located. -old <old_gvid0> - old starting game_vertex_id of the location. -new <new_gvid0> - new starting game_vertex_id of the location. -way - also processes the way_***.ltx file for the same location. Example: acdc -parse alife_l01_escape.ltx -old 0 -new 934 Splitting all.spawn into level.spawn (Hide) Breaking down all.spawn into level.spawn can be useful when editing spawn in both KFOR and ACDC at the same time. Command: acdc -split <file> [-use_graph] [-way] [common_options] Command: acdc -split <file> [-use_graph] [-way] -split <file> - split spawn. To restore graph points, level.spawn is required for all locations, located in the graph. They should be placed in the levels folder according to their position in the stalker's gamedata - by folders, the respective locations. The levels folder must be in the acdc folder (or you can set the path to it with a key - read on). -use_graph - use game.graph to restore graph points. Plus - no need for level.spawn, minus - graph-point names are not restored (with the exception of transition graph-points). -way - level.game is also generated from spawn Compare unpacked spawn files (Hide) In this mode, two spawn text files are compared. The final file is formed on the basis of the first file. All sections that are not in the second file, but are in the first, are deleted, and those sections that are in the second, but not in the first one, are transferred to the final file. Section parameters do not change. The mode allows save time if you need to combine two files, and the sections there are out of sync. Command: acdc -compare <file1,file2> [common_options] Command: acdc -compare <file1,file2> -compare <file1,file2> - files to compare Update vertices by coordinates (Hide) Why is it necessary: when changing the ai-mesh, the game_vertex_id and level_vertex_id of the objects change. This entails the need to re-remove these parameters in the game. This mode allows you to automatically update the vertices of all sections of the spawn. Command: universal_acdc -update <spawn_name> [common_options] Command: universal_acdc -update <spawn_name> [common_options] -update <spawn_name> - all.spawn to update vertices for. The update mode requires additional configuration. In the folder with acdc there is a file fs_vertex.ltx In this file you need to enter the path to the locations with the UPDATED ai-grid. Necessarily level.ai, level.gct files must be present for all spawn locations. ATTENTION! For normal working out of the gamegraph mode, the gamegraph must be OLD, used before recompilation. After normal working out of the spawn mode, you can unpack it already with a NEW gamegraph. General Options (Hide) -out <file> - path to the file/folder with the result. Has a different meaning for different options: for decompile, parse - folder with result for compile, convert is the resulting file. for split - levels folder, where to save level.spawn. -scan <scan_dir> - path to the folder with configs. Used in case of spawns from mods. -g <graph_dir> - path to folder with game.graph. Useless for compile and parse, and also if you are working with spawn CN, RFP, build 3120. -level - handle spawn like level.spawn. -af - places are also unpacked/packed
nofatal - disables crash on a fatal error, replacing it with a warning. Important Notes (Hide) If acdc generates an 'unknown clsid ... for section...' error, it means that this mod added new client/server class pairs to class_registrator.script. In order not to complicate the work with acdc, such pairs are not determined automatically. It's best to let me know, but if you understand what's inside class_registrator.script, you can add new sets to clsids.ini yourself. Sets are added in the following format: clsid = corresponding_server_class Example: ZS_ELECT = se_zone_anom .
Any option names can be abbreviated. For example, it is not necessary to use exactly -use_graph, the script will also understand -use and -u. However, a number of options may conflict with each other when their name is abbreviated. -compile cannot be shortened to -c because in this case it is not clear to the script what is meant: -compile or -convert. In this case, the shortest name for compile will be like this: -com
P.S. May God protect and help you in the modostroy
PS May God protect and help you in the modostroy
Thanks a lot for tthis.
hello! this information is so usseful! thanks for this.
Im currently working on a history mod and i wanted to include a new map on it but im strugling with that. Do you think if I manage to attach a new map all lvid and gvid will change and corrupt all the work iv done? btw i managed to unpack Call of Chernobyl with this acdc by editing some small sections.
greetings from argentina, man! thanks again