Jump to content

HUD Modding


Deathpossum

Recommended Posts

Ok I was doing this tutorial on how to modify my HUD, and during the step in the spoiler below, I ran into a problem: I'm using the swfquicker program, and if I directly open the .swf from from the BSA extractor-thing, it come up with something I can't edit. But if I go into the .fla files I downloaded, I couldn't find anything about what the author talks about in my first spoilers, the numbers. Also I am just trying to move peices of the HUD around.

 

 

 

(The whole file is below for reference)

 

3) SWF contents

If you have flash, open the appropriate .fla file from the folder you downloaded earlier.

Otherwise, open swfquicker (or trillix) and open the .swf file.

From now on out things get a bit tedious thanks to the decompiled swf file only containing item info as numbers.

Here's a list of some of the more important things in hudmenu.swf for example:

 

430 = Compass

677 = Health

688 = Magicka

695 = Stamina

709 = Magicka Enchant

721 = Weapon Enchant

726 = Arrows

749 = Enemyname

750 = Enemyhealth

656 = Name of item for prompts (open door, pick up item, etc)

660 = Key for prompts

653 = Sneak

414 = Location

121 = AnimatedMessages (crit, bounty, etc)

 

If you want to modify some other file, or some other parts of hudmenu, you'll have to go through it all and find out which item does what.

It's very tedious and confusing, took me a day to finally start remembering the numbers for a few items in hudmenu.

 

 

 

 

 

___________________________________________________

|\__________________________________________________\

|| |

||Orava's modding guide for skyrim SWF and GFX files| <-- Prettiest ASCII box ever. It even has a shadow.

\|__________________________________________________|

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

---------------------------------------------------

 

A few days ago I wanted to do something about the HUD, and decided to read around a bit.

For a day or so, nothing special, very cryptic stuff from various modders.

A couple of modders had found out how to access and edit files, but none of them provided accurate enough instructions.

The next day I found the first complete set of instructions. At first, I gave up, but later on I decided to actually try it.

 

These are the instructions I found.

- Unpack the "Skyrim - Interface.bsa" file

- Copy out the hudmenu.gfx file, rename it to .swf, and used the hex editor in Notepad++ to edit the first three characters to "CWS".

- Decompile the swf with Trillix or similar. This is only to identify sprites and scripts so far - you won't be recompiling.

- Pore through the assets and determine which ones you want to alter. Note their shape numbers.

- Using SWiX, open the .swf file and manually remove the shapes in question

- Save in SWiX, hex edit the first three characters back to "CFX", and rename the file back to .gfx.

 

Okay, so I finally got something to work, but the instructions are rather vague for my taste.

So I decided to write my own instructions, with some additional help and findings.

 

 

 

1] Gathering the tools

 

1) Unpacking the BSA

As an amateur modder, the first thing that puzzled me was the .bsa archive.

After some digging around (and testing one or two tools that didn't work)

I found out BSA Unpacker which worked like a charm.

 

================================================================

BSA Unpacker: http://www.tesnexus.com/downloads/file.php?id=3117

================================================================

 

2) Opening the files

My preferred choice is Flash, so I got the .fla files from skyrimnexus.

If you don't have access to Flash, you'll probably want to go with Trillix or Swfquicker.

I gave swfquicker a go, and it was pretty good, but didn't quite cut it compared to Flash.

 

================================================================

Fla files : http://www.skyrimnexus.com/downloads/file.php?id=216

Flash : http://www.adobe.com/go/tryflash

SWF Quicker : http://www.sothink.com/product/swfquicker/

Trillix : http://www.flash-decompiler.com/

================================================================

 

3) Editing

I had notepad++ to begin with, because it's awesome. If you don't, shame on you, better get it now.

As per the instructions for modifying the swf files, I tried SWiX, and it worked perfectly.

================================================================

Notepad++ : http://notepad-plus-plus.org/

SWiX : http://www.swixkit.com/

================================================================

 

2] Editing

 

1) Getting the files

This part is rather straightforward, so here's a list of instructions:

- Open BSA Unpacker

- Navigate to \skyrim\Data

- Open "Skyrim - Interface.bsa"

- Choose which files you want (I just exported them all so I can choose later)

- Export them wherever you want

 

2) GFX or SWF

If you want to modify SWF files, you don't have to do anything special to the file itself.

But, if you want to modify the HUD or something else that's contained in GFX file, you'll have to do some voodoo to get it working:

- Open Notepad++ (NPP from now on)

- Open hudmenu.gfx with NPP

- Change the first line to "CWS" (without quotes)

- Save the file and optionally close NPP

- Find the file you just saved

- Change the file extension from .gfx to .swf (Don't have file extensions visible? Go to folder settings and enable them.)

 

3) SWF contents

If you have flash, open the appropriate .fla file from the folder you downloaded earlier.

Otherwise, open swfquicker (or trillix) and open the .swf file.

From now on out things get a bit tedious thanks to the decompiled swf file only containing item info as numbers.

Here's a list of some of the more important things in hudmenu.swf for example:

 

430 = Compass

677 = Health

688 = Magicka

695 = Stamina

709 = Magicka Enchant

721 = Weapon Enchant

726 = Arrows

749 = Enemyname

750 = Enemyhealth

656 = Name of item for prompts (open door, pick up item, etc)

660 = Key for prompts

653 = Sneak

414 = Location

121 = AnimatedMessages (crit, bounty, etc)

 

If you want to modify some other file, or some other parts of hudmenu, you'll have to go through it all and find out which item does what.

It's very tedious and confusing, took me a day to finally start remembering the numbers for a few items in hudmenu.

 

4) SWiX

Next you'll want to fire up SWiX and open the swf in it. A bunch of stuff slams on the screen. Lots of numbers.

Yeah, numbers. Just like the ones you were going through before, what a coincidence.

Okay, so now you hopefully have a number that you know is tied to a certain item in the swf that you want to modify.

Find that number in the "Attributes" list by scrolling down a while and finding: Id="yourNumberHere" OR ShapeId="yourNumberHere"

Then, doubleclick!

SLAM. Face full of XML, you two are going to have some real fun real soon.

 

5) XML

Next up would be understanding how the contents work, knowledge in XML would definitely help, but is not a must.

I had no prior xml experience, but now I can understand it just fine after a couple of days.

By comparing some of the XML stuff with Flash or SWFQuicker, you might notice that they correspond pretty well. Examples later.

 

Quick overview of some of the XML stuff. I'll be using the compass (430) of hudmenu.swf as an example.

 

<PlaceObject2 Depth="15" CharacterId="406" Name="ShoutMeterInstance" Move="false">

- Places an object at Depth 15 (1 being highest as far as I know, since HUD items are often 1)

- The object that's placed is 406, you can find it through SWiX and often, but not always (explained later), through the IDE of your choice.

- Object has the name of ShoutMeterInstance in this case, which would be the glow/cooldown around the compass when you shout

- I'm not quite sure what 'Move' does yet, but it might be something like Flash's tweens (meaning making something move/change)

<Translate TranslateX="-3329" TranslateY="226" />

- Simply changes the coordinates of the object.

- X = RIGHT, -X = LEFT, Y = UP, -Y = DOWN.

- I have no clue whatsoever what unit is used, but it's most certainly annoying (the X-coordinate of my modified stamina bar was like -25000 at some point).

- Note: My coordinates may differ, since I've moved the compass around while testing

 

Moving on to item "429" that was mentioned in the compass XML, it's the shout "not cooled down yet" blinking that happens when you spam the shout key.

 

<DefineSprite Id="429" FrameCount="26">

- Has 26 frames, this is automatically updated if it differs from the amount of ShowFrames when you save through SWiX

 

<FrameLabel Name="Warning Start" IsAnchor="false" />

- There's code somewhere that tells the game to "go to frame Warning Start"

- You can invert the labels for some funky effects on certain items (I tried it with stamina bar, for example, making the green area become "drained stamina" instead of "stamina left")

 

You might notice there's a pattern, here are the important lines, the other stuff is just placing the items on screen and updating the frame.

 

<ColorTransform MulR="256" MulG="256" MulB="256" MulA="31" />

<ColorTransform MulR="256" MulG="256" MulB="256" MulA="61" />

<ColorTransform MulR="256" MulG="256" MulB="256" MulA="92" />

- Multiply(Red, Green, Blue, Alpha) values, should be between 1 and 256 to my knowledge.

- Notice how the alpha value keeps growing, this makes the "428" item (introduced earlier in the xml) become visible

- Later on the alpha is decreased (and so it becomes the annoying blink we all can see ingame)

If you want to, for example, stop it blinking and just make it glow, you can constant all the alpha values to 220 (brightest default frame) or something.

Or you could remove everything but the 220-alpha frame. Latter would probably be more efficient, but I'm fairly sure a few frames in the GUI won't make a drastic difference in performance.

The former choice is probably easier to do, since you don't have to worry about breaking the syntax. NPP offers a regex replace that lets you replace all MulA=".*" with MulA="0" for example.

 

 

Other than that, you'll have to discover for yourself.

 

6) Saving from SWiX

Pretty simple. Just hit the "Save Xml"-button or navigate to "File->Save As..."

Make sure you select .swf from the type list, then name it to match the original swf or gfx file in the bsa archive ("hudmenu.swf" for example)

 

7) Back to GFX

If the file was GFX, you'll have to change the extension and edit it in NPP again.

- Change extension from .swf to .gfx.

- Open in NPP and change first line to "CFX" (without quotes)

- Save

 

8) Testing ingame

You'll have to place the file in the right place in your Data folder to make it work ingame.

If you're using Steam, it can be found at DRIVE:\Programs\Steam\steamapps\common\skyrim\Data

Now, the subfolders are important. If the file was found in \Interface\Export in the BSA, that's exactly where you put it in your Data-folder.

hudmenu.gfx, for example, is located exactly there, so the final location for the modified file is:

DRIVE:\Programs\Steam\steamapps\common\skyrim\Data\Interface\Exported\hudmenu.gfx

Then just launch Skyrim and hope it doesn't crash. If it does, remove the file and you're all good again - except that you'll probably want to fix the file, but that's something I can't help you with.

 

 

 

3] Thanking Orava big time for writing this massive guide at 3am

Pretty straightforward I think.

 

 

 

 

 

Appreciate any help

-Death'

Link to comment
Share on other sites

The numbers come from the sprite numbers in the decompiled hudmenu.swf.fla, you can get the fla files from here.

 

See attachment.

In SWF quicker, I can't 1. Open the .fla files, 2. When I convert the plain GFX from the BSA to .swf, I can't click on anything in particular.

And the folders in the .fla files that are .swf_as aren't useful as far as I can tell because they are all action script files, and from what I could tell from them, there was no easy way to reposision the HUD.

 

Thanks

 

EDIT: Found out that I had to go right-click>edit

Edited by Deathpossum
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...