The Secret World

Setting up a development environment

The Secret World's UI is primarily a collection of Flash modules. Below, I've detailed the various components that are required to successfully make mods that are based off of the original UI elements. If you're developing new modules from scratch, you most likely won't need CLIK or the TSW fonts, as you are free to run whatever kind of interface you like. Using the fonts below will make your mod look more like it belongs in the game, though.

Adobe Flash Professional

I have verified that versions CS5.5 and CS6 of Adobe Flash Professional work acceptably for TSW mods. I personally use CS6, so if you want to open any of the .fla files from my addons, you'll need CS6 as well. Other versions or toolsets may work, but I cannot vouch for them.

Autodesk Scaleform CLIK

TSW's UI is built with Scaleform CLIK, but Funcom cannot provide a development license for players. However, a free version of CLIK is also available as part of the Unreal Development Kit. So, unless you are already a Scaleform licensed developer, you'll need to download the latest version of UDK (for UE3, not UE4) and install it.

TSW Source Files

It is a good idea to work from a separate copy of TSW's source files so that you always have the originals if anything goes wrong. I personally copy the source files into a versioned folder directly under my TSW folder. In other words, I copy "The Secret World\Data\Gui\Customized\Flash\Sources" to "The Secret World\Sources-1.7.2" (for example), for each major patch. This also makes it easy for me to compare each release to see what's changed so that I know when my mods need to be updated. As a side note, I highly recommend SourceGear DiffMerge for comparing two source trees.

Fonts

You will need to install at least three of the fonts that various Flash files need for proper embedding. One of them comes with TSW, one is easily downloaded, and the third can be generated from the first. There are likely other fonts you'll run into if you start loading up the various game files, but I've found that these three can get you through most situations.

Futura Md

FuturaStd-BookFix should be mapped to this one. It comes with TSW and can be found at "The Secret World\Data\Gui\Customized\Fonts\futura.ttf". Just right click it and choose "Install".

Russell Square

RussellSquareStd should be mapped to this one. This is the font used for timers. While there are many free versions scattered about the web, this one contains all the characters used by TSW and actually looks correct in-game.

Futura Heavy

Futura-HeavyFix should be mapped to this one. Unfortunately, there is no freely available version that includes all the glyphs that are used in TSW, specifically in the Romanian zones. However, a font editor can be used to generate a quite reasonable facsimile in short order. It isn't perfect, but it's far better than missing symbols.

When opening a Flash file, you'll generally get a missing fonts dialog - an example is shown below.

Font Mapping dialog

Configuring ActionScript

Once you have everything in place, launch Flash Professional. Go to Edit, Preferences, ActionScript and click the button labeled ActionScript 2.0 Settings. You'll want to edit the paths to match the picture below, with your own paths listed instead. The "." before the TSW sources ensures that we can override classes as needed.

ActionScript 2.0 Settings dialog

 

Reducing the size of embedded fonts

Before publishing a Flash file, you can reduce the resulting file size by only embedding glyphs that the game uses. Follow these steps:

  1. Go to Text, Font Embedding
  2. Select (Fonts/_Headline)
  3. In the Character ranges box, uncheck All
  4. In the same box, check only the following groups (resulting in 338 total glyphs):
    1. Punctuation
    2. Basic Latin
    3. Latin I
    4. Latin Extended A
    5. Latin Extended Add'l
  5. Select (_StandardFont) and make the same changes as above
  6. Select (Fonts/_TimerFont) and change the following (resulting in 16 total glyphs):
    1. Uncheck All
    2. Check Numerals
    3. Add (:-. ) to the additional characters list. (That's open-paren, colon, dash, period, space, close-paren.)
  7. Click OK

 

A few general notes

While I am a professional software engineer by trade, I do not use Flash nor ActionScript at all. Everything I know about both of these, I've learned during development of these addons. For that reason, I don't claim that any of the code in these addons is of particularly high quality. Indeed, much of it has been experimentation with a "just-get-it-done" attitude, and is probably quite abysmal. When possible, I've tried to use the approximate coding style of the code nearby to any changes I've made.

For any of the code blocks on these pages, keep in mind that the line numbers are taken from a completed mod (the one downloadable at the bottom of a page), so they aren't likely to line up if you're trying to "follow along at home". They also won't line up if a more recent patch has updated the files in question.