-
Content Count
3 -
Joined
-
Last Visited
Community Reputation
5 GoodAbout pbox
-
Rank
Freshman
Recent Profile Visitors
185 Profile Views
-
WIP: .crp file parser/editor; input appreciated
pbox replied to pbox's topic in Cities: Skylines Modding - Open Discussion
OK, I've updated -- image import/export should now work for both formats. It can also decipher more stuff now. Note that things like colour palettes need to be saved *without* mipmaps in order to come out at the right size. For PNG *with* transparency, I honestly have no idea how to keep it at the same file size when editing (I've been using paint.net; maybe other editors have more options when saving). The only such PNGs I've encountered so far are UITextureAtlas entries for assets though, not the main preview pics. Also, the PNGs that are being displayed will probably not change, since they're cached by the browser. The easiest workaround is save the file, then open it again; or disable caching (which is generally not a good idea though). -
WIP: .crp file parser/editor; input appreciated
pbox replied to pbox's topic in Cities: Skylines Modding - Open Discussion
Yes, that's exactly what it does best at the moment -- for PNG it also displays the actual PNG; DDS does not have a display but you can export and import them. (This is because in order to display a DDS, I would need to convert it first so the browser can digest it, and then people would likely try to use that converted preview instead of the actual DDS data. Which would not be good. Also, it takes a little while when there's a bunch of textures in a file.) Edit: Oh wait -- I forgot that I havent put an *import* link on the PNG fields yet. I'll update that and post here again when I've done so. But for now you can at least rightclick > save the pngs (they are full resolution, I'm only squeezing them for display). Some crps have the PNGs near the end, so you might have to scroll down a bit (it's parsing everything in the same order as it is in the crp). Let me know how it works for you! -
WIP: .crp file parser/editor; input appreciated
pbox posted a topic in Cities: Skylines Modding - Open Discussion
Hello there, I saw that this parser (crp-extract.py) has apparently been outdated by some recent-ish patch -- I've been running into issues with the in-game editor, so I wrote a script that can parse/import/export data from .crp files directly. Maybe this is useful for others as well? (I'm aware there are plenty of mods for the in-game editor, but the editor has its limits it appears ..) http://unera.se/crper (dump a .crp on it and see if it can make sense of it) Right now the script suffers a bit from my own lack of knowledge about the various data formats inside a .crp (and I've found hardly any documentation except for a few posts in this forum (thank you!)) -- PNG/DDS import/export seems to work well though, and that was the main reason I wrote it. Other than that, -- all text/data fields are readonly for now -- there are export links for DDS, PNG, and every other data blob it encounters (like meshes) -- no guarantee though that things other than image data will be useable -- if you want to use it to replace images, make sure the new import is the same size as the original -- I'm not doing any sanity checks atm, other than letting the browser throw its "out of range" errors and such -- when an entry ends with an "end" field that has anything but zero in it, and is also quite red, that means it got a bit lost in that entry (there might either be missing parts, or it read half of the next entry as well -- in any case it didn't land at the end of that part like it should have). -- I'm also not doing any cleanup, so please reload the page before dumping the next file on it. When it behaves weird, it makes sense to open it in a new *window* (not just a new tab). -- it should work in recent-ish browsers (FF 4 / Chrome 7 / IE 10 /Opera 11.6 / Safari 5.1 I believe), and hopefully on all platforms. I only have Win7 here so I haven't really tested that (feedback welcome, of course). -- It's javascript and runs in your browser, dealing with local files only, no uploads or anything. So, if anyone knows more about the missing bits+pieces (UnityEngine.Material, for example), or finds something specific that's off (like "you're cutting three bytes too much off the end of suchandsuch thing"), I'd appreciate feedback! The things I know about are mostly in http://unera.se/crper/struct.js . UÙAñ<ιç¦*©Ø5öcÑ and ç¦*þõJç!
