Jump to content

[FO4] .swf recompilation ?


Kesta

Recommended Posts

Is anyone here aware of swf-compilation specificities for FO4 ? I'm trying to work with SoThink (I'm just lost in adobe's interaces...).

 

I can edit/create .swf, export them, and re-import them in SoThink without problems (I just have a clip, no actionscript, it's to create new perks clips), but for some reason the game won't load them.

 

It's not a path problem (tried to replace my file by one of the vanilla clip and it show up properly).

 

 

In case you're wondering what I'm actually talking about, perk clips are the animated icons that show up in the pipboy under the Statistics -> Perk tab of the pipboy (not the poster where you level up, in the actual pipboy interface).

 

 

P.S. : Already tried to reach StrangerNPC on nexus, who made the Asuka park UI, but since he's a japanese modder with no mod description, I kinda expect the answer to be "sorry, I can't english" :/ )

Edit: Completely forgot to ask expired. It'll most likely be a 10 ~ 20 characters long answer, but that could be enough.

Link to comment
Share on other sites

I'm using JPEXS Free Flash Decompiler to inspect Skyrim swf files but I still never tried to compile them back. Whatever you find about this issue, please report your findings here as many people should be interested in how to deal with these files.  ;)

Link to comment
Share on other sites

Yeah, I'm currently digging though the old Beth.net forum in the CK help. I remember mofakin had a huge (and awful to follow) tutorial in here about tinkering swf with free softwares. I just hope he didn't wipe it out.

 

Edit: Found it: http://forums.bethsoft.com/topic/1509769-tuthow-to-create-widgets-using-flash-tools/

That was about widgets so compilation infos should be in here. Just hoping stuffs are similar for fo4.

 

Edit2: A tutorial on WoT forums is supposed to work fine to edit FO4 .swf: http://forum.worldoftanks.eu/index.php?/topic/287391-tutorial-editing-actionscript-in-as3-swf-files-for-wot-088-with-rabcdasm/

 

Also, according to the decoding done by mardoxx and mofakin back in november, it seems FO4's UI is in Flash CS4 + AS3. (source : https://forums.nexusmods.com/index.php?/topic/3375175-deobfuscate-the-swf-files-aka-ui-moddinga-start)

 

Edit3: Okay, after further inspection : do NOT use the free version of SoThink, or at least not to directly import-edit-export .swf, that just completely srew them up. I'm not saying that the non-free version work, just that the free one do NOT.

 

Also, perk clips are in CS6, not CS4, according to the embedded metadata.

Link to comment
Share on other sites

All right. End of day 1. I learned a lot, even managed to edit and get a modified swf in-game. However getting something clean and nice-looking is an other level. I'm just gonna push the update with clumsy effects and dive in this later.

 

Here are the informations I managed to gather:

 

SWF ?

 

Wikipedia have a few informations, but the modifications the SWF format seems to have been through make it a bit pointless without extra links.

SWF stand either for Small Web Format or ShockWave Flash depending on what you read (most likely the later in our game-modding case). According to wikipedia, it was originally intended to display lightweight non-pixel-based (by opposition to GIFs) animations on webpages.

The literature available kind of imply that our .swf are actually closer to Scaleform GFx files used in video games interface, including games based on GameBryo (the engine Bethesda edited to make the Creation Engine).

 

This is a display format. It isn't intended to be edited as such (thus the struggle to find a proper editor). Think of it as a compiled script, or an exported bitmap, it's actually both.

 

However, this is isn't a "secure" format, so .swf files can easily be opened / decompiled, or even edited directly with certain limitations.

 

The tricky part is that it actually embed 3 kind of datas:

 - Graphics, refereed to as Symbols. Those are drawn shapes, textes, sprites, vector images, ...

 - ActionScripts, high-level object-oriented scripts with a lot of similarities with java.

 - The movie, the combination of the two things above, assembled on frames following a timeline with keys ("state of an object at a given moment of an animated event")

 

Also, terminology point : graphics, frames, and some other metadata are all called "tag" inside a SWF

 

 

Basically the conclusion is that it allow to have dynamic animated visuals to create menu, as the animation can loop and be controlled via ActionScripts, listening to user's input.

 

 

The innards

 

You have at least three group of things in a SWF file:

 - A group of graphics

 - A group of frames, which constitute the movie, each frame including one or several of the graphics available, possibly modified (distorsions, color changes, displacements, ...)

 - A group of metadata that tie the whole thing together.

 

To have a peak inside a .swf file, the best tool available is most likely JPEXS, consider this the xEdit of SWF files. Free, easy to install, and allow you to tweak a handful of things. But as you already know, xEdit's main problem is that it's crap when trying to edit worldspace, and you can't edit papyrus, nifs or textures with it... well, it's the same here, except that instead of worldspaces you have frames (you can try, but good luck guessing the end-result), instead of nifs/textures you have graphics, and instead of papyrus scripts you have ActionScripts.

 

Knowing that, what we need is a way to :

1) Edit graphics and frames (so the whole movie chain)

2) Edit ActionScripts

 

This is were things get tricky... most of the tools available can either:

 - Preview the SWF

 - Edit directly the SWF in a very-limited way

 - Extract the ActionScripts from the SWF

 - Edit / Compile ActionScripts

 - Extract/Convert the whole SWF into an other format

 

But editing just the graphics kinda sucks, you most likely need to completely all of the assets, change all your stuff, then recompile into a .swf

 

SoThink SWF Quiker can edit a few stuffs directly on the SWF, however it have several import/export issue (small workaround to use JPEXS to attempt to fix them is described later)

 

 

Official Adobe Tools

 

And what's even more tricky... the previous official tool to work with swf, Adobe Flash Professional CS_, have been replaced by Adobe Animate CC, which doesn't support SWF edition/extraction anymore. Instead, it expect an FLA file (the default project file) that can then be compiled into a .swf

Even worse, the trial version only last 7 days, and the paid version is 35€/month if you just need it for a few month, or 287€/year.

 

The Adobe Creative Cloud (Adobe CC) seems to be about locking all older softwares / versions, so I didn't dig in that much. However, grabbing a trial version or licensed version of Adobe Flash Professional CS4 or CS6 seems to be the best course of action. 

Actually, you might need both for perfectly designed UI mods, as some part seems to be compiled with the CS4 compiler (all of the vanilla Skyrim UI if I'm not mistaken) however a few features from SkyUI are built with CS6 in mind. For FO4, there is both CS4 and CS6 files (it seem that only those containing ActionScripts are in CS4. PerkClip like I was trying to edit are in CS6).

CS6 and Animate CC can most likely compile to both CS4 and CS6, so I'm not 100% sure if there is even a point to get CS4, but since I've seen it mentioned...

 

If building UI elements from scratch, Animate CC will most likely be the best choice though.

 

If going with Animate CC to edit vanilla SWF, you will need to:

1) Get the FLA out of the SWF

2) Maybe decompile ActionScripts (because those embedded can be compiled...). I'm still not sure, I've seen several screenshot where people seemed to be able to have directly access to what look like source code without much of an effort.

 

Decompiling SWF

 

The 1) seem to be easily doable with SoThink SWF Decompiler. While yesterday's experience with SoThink Quicker (the actual editor) wasn't satisfying, it seem that this decompiler is the most recommended wherever I look.

There is a free 30-days trial, so one could most likely decompile the whole FO4 Interface once with it and make it available on github, like SkyUI team did with Skyrim. Sadly, the free trial refuse the extract ActionScript, to get them with it you NEED to buy the full software.

 

If not direclty accessible, the 2) is a bit more complexe. Most powerful decompilers I read about are RABCDAsm, which I haven't gotten to work yet, so I'm not sure of the output (the readme seems to mention some kind of assembly-like format specific to ActionScript named ABC) , and Flare which will dump the whole project in a single text file that you'll have to re-organize as an actual ActionScript project.

I'm still not sure what Flasm (the twin-brother of Flare I just mentioned) is about, but it might be a completely free alternative to SoThink SWF DeCompiler

 

Note that JPEXS have a few export format (.gfx, and some kind of xml-based swf), but I haven't found anything yet that could alter those afterward

 

Accessile Tools

 

As mentioned at the beginning, for quick and dirty edits to visuals, you can try to use the combination of SoThink Quiker and JPEXS. To do so :

 - Import directly your SWF in SoThink and edit the graphics and frames/movie.

 - Export as .SWF

 - Open your .SWF in JPEXS

 - Open the SWF you originally edited in JPEXS as well

 - Delete the broken stuffs ("tags") under "others" in your edited SWF

 - Select all the stuffs under "others" in the original SWF and use "Right-Click" -> "Copy Tag To" and copy them into your edited SWF

 - Remove the blinking watermark added by SoThink by deleting the text and the sprite it added.

 - Save and test.

 

However the end result look a bit screwed up , and SoThink's interface isn't exactly convenient to use. 

 

If you just want to edit ActionScripts, without worrying about the visuals (or take care of the visuals with the method I just mentioned), you can use FlashDevelop, a free and apparently powerful IDE to work on ActionScripts.

You will need the Flash Compiler you wish to compile for installed (shipped with Adobe Animate / Flash Pro CS_, no need to have a license for the compiler to work). That is, again, if sources are available (Again, still not sure if those need to be decompiled or not, I wasn't all that interested by ActionScript)

 

 

 

All of this is still pretty much try and see, it's possible that some of the tool mentioned actually have more feature that what's described above, or instead that the features mentioned somehow doesn't work for our modding purpose for whatever compatibility reason they could generate.

Link to comment
Share on other sites

All right. Answer from Expired:

He's using Flash CS4 (the one Skyrim and most of the complex FO4 menus have been done with) but don't see any reason why more recent ones wouldn't work.

After checking a few stuffs about Adobe's suit, that's definitely the best course of option to get seriously into modding anyway (Animate CC for SWF, Photoshop for Textures, Illustrator for mod page's art). The whole suit is 50€/month, not cheap, but considering Animate CC alone is 30€/month, imo this is all or nothing. I'll probably give it a shot this summer.

 

Any decent decompiler should be able to extract everything, but not necessarily in a re-compilation ready state for complex ones, especially with FO4 which use ActionScript3 (AS3).

A list of free good decompilers is available on this link, just make your choice :)

SoThink decompiler produce directly an editable .fla, which is cool, but isn't free and kinda awful. I'm probably going to try a few and give better feedback on this later, but JPEXS seems to be the best.

 

There is 2 catchs Expired pointed out :

1) Do not embed fonts. For Skyrim/FO4, you'll want to import the fonts from the swf fonts files the game use (fonts_en.swf for FO4).

2) Whenever scripts (AS3) are involved, you'll probably need to revisit them a bit to be able to compile it.

 

Once you're aware of that, just decompile into FLA, open in Animate CC, edit, and export the .swf

Always keep your .fla so you don't have to re-decompile everything again !

 

To get started on SWF production :

Awesome video tutorial to learn to use Adobe Animate CC

Good tutorial to learn about ActionScript3

 

And that's it. Now, time to make some perks clips before my 7 day trials of Animate CC :P

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...