- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Resources & Misc >
- CSV list of IDs, names, and tuning names and IDs of objects
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Resources & Misc >
- CSV list of IDs, names, and tuning names and IDs of objects
Replies: 1 (Who?), Viewed: 6871 times.
#1
19th Sep 2014 at 10:19 PM
Last edited by DarkWalker : 14th Aug 2015 at 3:05 AM.
Posts: 75
Thanks: 547 in 13 Posts
CSV list of IDs, names, and tuning names and IDs of objects
I was toying a bit with the files referenced as object definition in the custom content guide (type 0xc0db5ae7); they have inside a label and, if they reference a tuning, also the tuning label and ID.There are over 10k such files, though; manually creating a list would be one huge pain in the ass. So I created a small python script to output a CSV file with the labels and IDs I was looking for.
The script is just below; it's a quick hack, but it works well for files extracted by S4PE.
I've attached the resulting text file from running it on every type 0xc0db5ae7 file extracted from SimulationFullBuild0.package. My main use for it is to find the binary files of an object I already have the tunings for. Each line has the file ID in both hex and decimal (the decimal IDs are used in tuning files to create objects), the label of the object, and if there is a tuning reference the tuning label and its ID.
How to use: extract all type 0xc0db5ae7 files you want to generate the list from to a single folder, adjust the directory variable in the script below to point to the extracted files, change the path of the output file to something that will work for you (I doubt many of you keep a ramdrive at x: ), and run the script. Changing printall to 0 will skip files that don't reference a tuning. I've tested it under python 3.3.5, which is the same used for modding Sims 4 scripts.
Code:
import os, struct from pprint import pprint directory = 'C:/PathToFilesOfType0xc0db5ae7/' extension = '.bnry' out = open('x:/obj_list.txt', 'w') printall = 1 for file in os.listdir(directory): if file.endswith(extension): f = open(directory+file, 'rb') m1 = struct.unpack('H', f.read(2))[0] m2 = struct.unpack('I', f.read(4))[0] s1 = struct.unpack('I', f.read(4))[0] name1 = f.read(s1).decode('ascii') s2 = struct.unpack('I', f.read(4))[0] if s2 > 4: name2 = f.read(s2).decode('ascii') id = struct.unpack('I', f.read(4))[0] if printall or s2 > 4: out.write(file[21:21+16]+","+str(int(file[21:21+16],16))+","+name1) if s2 > 4: out.write(","+name2+","+str(id)) if printall or s2 > 4: out.write("\n") out.close()
Edit: found a way to semi-autonomously extract this info from the game without having to manually extract the files (by implementing .package extraction in python 3.3), so I can now provide this information far more easily. I'm attaching an updated version of the file, with all objects and CASP items from patch 1.10 with all expansions. I can also provide the scripts I'm using, but those are a work in progress and currently kinda messy.
Attached files:
obj_list.7z (70.4 KB, 548 downloads) - View custom content | ||
Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2014-09-19 16:33:02 ....A 771410 71950 obj_list.txt ------------------- ----- ------------ ------------ ------------------------ 771410 71950 1 files, 0 folders |
||
List_1.10.7z (185.1 KB, 440 downloads) - View custom content | ||
Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2015-08-13 20:58:02 ....A 758485 189368 caspart_list.txt 2015-08-13 22:01:56 ....A 1279713 obj_list.txt ------------------- ----- ------------ ------------ ------------------------ 2038198 189368 2 files, 0 folders |
||
Description: IDs, in hex and decimal, plus the internal names and (for objects) the tuning name for all CASP items and objects. Patch 1.10 with all expansions. |
Advertisement
#2
2nd Nov 2014 at 1:28 PM
Posts: 11,006
Thanks: 423046 in 1121 Posts
Moving to Resources.
Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.
In the kingdom of the blind, do as the Romans do.
Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.
In the kingdom of the blind, do as the Romans do.
Who Posted
|