kreejaffa Posted November 25, 2017 Share Posted November 25, 2017 (edited) I'm working on a little script to do what it says in the title, in order to make it easier to keep track of all animations that I have available. I've gotten pretty far, but two things are causing a roadblock to the script being finished (one major, one minor). The first being finding the display name of an animation, and the second being translating "custom" object IDs into something a little more readable (class name or whatever). I feel like probably only TURBODRIVER himself would be able to shed light on this since it relies a lot on his code, but I'll post it here anyway in case anyone else has looked into the scripting behind WW. So, let's get to the grit... Getting a full list of animations and their properties is easy enough, using get_sex_animations() and iterating through it. Most of the properties come out fine (aside from animators who didn't fill out their XML properly), but SexAnimationInstance.get_display_name() pretty much only returns some sort of hash value (unless the animator specified the name as raw text). Of course this hash value references the actual display name text in the STBL file, but nothing I've tried seems to work in converting the hash into the full text for the purposes of printing it out. I've looked through the code for other places that SexAnimationInstance.get_display_name() is used, and it seems like all it does is pass it through TurboL18NUtil.get_localized_string() and move on. When I do that, I just get another seemingly unusable hashed object. Technically it's a LocalizedString object, but same problem: I don't know what to do with it. The only data I can find contained in it is still just the hash value. I did decide to go a little deeper and get crazy. It would seem the game itself never displays strings outside of a "dialog", and dialogs have a function called _build_localized_string_msg() that must do something. I tried creating a temporary dialog just to use its function, but that didn't do what I need either. I finally tried looking into how the code gets the data from the STBL within the .package file itself, but a few key .pyo files wouldn't decompile, so I hit another roadblock. Problem #2 is that custom objects used by animations are listed as IDs in the XML file and stored as such. I tried telling the game to create a temporary instance of the object (in the household inventory or somewhere) and then use that to get a more readable name. I'm not really sure how to do that though. I tried TurboObjectUtil.GameObject.create_object() using the ID, but that always seems to fail and return None. Not sure what else to try. I'm sure if the script user does not have the object installed this will never work, but I do have the objects in question installed, and I assume the end-user will too most likely. It's not critical, but it would be nice to have a solution for this as "Azmodan22:DancingPoleShort26012017" is a bit more useful than a random number. I attached what I have so far in case anyone is interested, source included (with lots of commented out things that I tried). Basically you type 'getanims' in the console and it will output a TSV file you can import/paste into a spreadsheet or something. Updated Mar 1 2018: It had been broken for a while due to some scripting changes in WW. Fixed now in case anyone uses it. (Fixed as in got it back to it's previous state; none of the above problems have been fixed.) WWanimationList.zip Edited November 28, 2017 by kreejaffa updated file 2 Link to comment
Redabyss Posted November 26, 2017 Share Posted November 26, 2017 I thought many times about wanting something like this. Very good work, I hope you'll succeed. I feel there are so many animations I forgot about. Perhaps you could do it so that you have an interaction on a object, and said interaction gives a menu of all available animations for said object? Link to comment
kreejaffa Posted November 28, 2017 Author Share Posted November 28, 2017 (edited) Well after hours of tracing back every relevant line of code through the game's and WW's script files, I've made pretty much zero progress on either front. The only thing I could add is a lookup table for object WWIDs for the ones that I am able to figure out myself (some of them are nice enough to include what objects they work for in the description). But a few that I am not able to determine, there's no way to do so short of looking through every single object in the entire game and manually checking the WWID. It'd be nice if there was a script function to iterate through every object in the build/buy menu, because that would also solve this. But I can find no such thing, except for a function that returns ResourceKeys, which, much like the LocalizedStrings I mentioned in the OP, are seemingly useless to me. I've spent way too much time on this already and gotten nowhere, so I think I'm giving up unless someone with more expertise in TS4 scripting is able to help. I updated the zip in the OP. Only changes are: I added a header line to the TSV so people can make sense of the columns once pasted into a spreadsheet; and added get_object_animation_clip_name() as a column, for the animations that filled it out, as another potential way to distinguish one animation from another. To reiterate, the script "works", it's just that: Pretty much none of the animations will have a full display name (and some have no other identifying information filled out by the animator, so there will be no way to tell some animations apart if they have the same author, location, and type, and sim combination). Custom objects will just appear as numbers, so you'll just have to guess what object they are attached to. Edited November 28, 2017 by kreejaffa Link to comment
TURBODRIVER Posted November 30, 2017 Share Posted November 30, 2017 Hey! I have already implemented something like this. WickedWhims now produces the WW_Animations_Report.txt file which contains the list of every animation with some basic information. I included an example. There is no way to display names besides the raw ones that creators can include now. WW_Animations_Report.txt 1 Link to comment
kreejaffa Posted November 30, 2017 Author Share Posted November 30, 2017 Thanks for the response! I guess it's good to know that I wasn't just missing something. I suspected I might be beating my head against a wall to get those last bits of info. Now I can stop worrying. Link to comment
JaybeeAnimations Posted May 16, 2022 Share Posted May 16, 2022 I'm reviving a 2017 thread, but this is the first thing that comes up if you google how to dump your animations: it's an in-game cheat code. Open the console commands and enter ww.dump_installed_animations . I knew this was a feature but couldn't figure out how to use it lol. Link to comment
sbudy Posted June 18, 2022 Share Posted June 18, 2022 Anyone knows a good tool to list and organize the installed animations? A simple txt file dump is not enough. The information is there but it's not in a useful format. I'm looking for something that would generate a excel-like sheet with all the animations organized by creator, type, participants, package file, etc. That would make managing and filtering your installed animations easier. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now