UI Modding Tools - LaughingLeader-DOS2-Mods/LeaderLib GitHub Wiki
- JPEXS Flash Decompiler
-
Flash Player 10.3 playerglobal.swc
This is the version of Flash Larian/iggy uses for their modified flash player. You'll need this both for JPEXS and for the Actionscript 3 vscode extension. Since Adobe killed Flash, this file can be a pain to locate. - ActionScript & MXML in Visual Studio Code Extension
- Flex SDK Google Drive | Possible Future Broken Adobe Link
The Google Drive Flex SDK link contains the flash libraries already set up, so it just needs to be extracted somewhere. This is used by the vscode extension. - Google Drive folder with related flash files
The Adobe link will need the required playerglobal.swc and Flash CS3 libraries placed in flex_sdk_4.6\frameworks
like so:
flex_sdk_4.6\frameworks\libs\player\10.3\playerglobal.swc
flex_sdk_4.6\frameworks\libs\flash.swc
flex_sdk_4.6\frameworks\libs\ik.swc
flex_sdk_4.6\frameworks\libs\PffLib.swc
flex_sdk_4.6\frameworks\libs\tlfruntime.swc
The last 4 swc files are files included with an older Flash installation at a location like so:
FlashProCS6\Adobe Flash CS6\Common\Configuration\ActionScript 3.0\libs
- Extracted GUI files. Use lslib.
All the game's various GUI files need to be extracted from Game.pak. Ultimately you may want to extract every pak in patch order since a patch may have updated one of these (such as the gift bag updates). The GUI files are located underPublic/Game/GUI
.
- Open JPEXS.
- Click the Settings tab, then the Advanced Settings button.
- Configure the following script settings:
Register variable format
is what determines what local variable names are. I prefer var1/var2 etc instead of_loc_1
. - Set your pathways to the swc and projectors like so:
- Clock "OK" so your settings are saved. The main thing needed here was the swc as you need the right flash version.
The ActionScript & MXML vscode extension will allow you to have syntax highlighting and error checking with your scripts.
- Install Visual Studio Code if you haven't already, then install the extension (you can do this from the extension tab if you search for Actionscript).
- Click the cog next to the extension entry, then click Extension Settings.
- Scroll down to the option named
As3mxml › Sdk: Framework
and clickEdit in settings.json
. - Set the value to your flex sdk folder, making sure to escape back slashes, like so:
"as3mxml.sdk.framework": "D:\\Modding\\DOS2DE\\UI_Modding\\flex_sdk_4.6"
This part is more for when you have a project with scripts set up, but the final requirement the extension needs is a config file to specify the flash version and project type. Create a file named asconfig.json
in your workspace and add the following text to it:
{
"mainClass": "MainTimeline",
"compilerOptions": {
"source-path": ["src"],
"target-player": "10.3"
},
"files": [
"src/MainTimeline.as"
]
}
The source-path entry should be the folder that includes your scripts (this can be relative or an absolute path). The "files" part here is only really necessary if you use a relative path and the extension complains about no files being included.
With this your Actionscript 3 scripts should be automatically checked for errors.
Using the commandline, JPEXS can extract every GUI file in one go, saving a ton of time compared to manually extracting each through the UI. The fla format will allow you to open each UI file in Flash.
Simple enter this command in the command prompt:
ffdec.bat -export fla OutputFolder InputFolder -format fla:cs6 -cli
Param | Description |
---|---|
ffdec.bat | This should be the path to ffdec.bat included in the JPEXS release. |
OutputFolder | This is the folder path you want the GUI fla files exported to. They will go in their own individual folders. |
InputFolder | This is the input folder containing the GUI files, i.e. Public/Game/GUI, Public/Game/GUI/GM |
JPEXS allows you to replace scripts and symbols inside of existing swf files, without needing to export it to fla and break the ImportAssets2 tags by publishing it through flash.
Most of the time this isn't necessary, but LeaderLib does utilize this to extend the functionality of optionsSettings beyond what's available.
ffdec.bat -replace SourceSwf OutputSwf className scriptFile className2 scriptFile2
Param | Description |
---|---|
ffdec.bat | This should be the path to ffdec.bat included in the JPEXS release. |
SourceSwf | This is the swf you're wanting to modify. This won't actually be modified, but instead copied to the OutputSwf path with your changes. |
OutputSwf | This is the output file path. |
className | The class of the script you want to replace, such as optionsSettings_c_fla.MainTimeline. You can get the names with the -dumpAS3 <infile> JPEXS command. |
scriptFile | The path to the script file to replace the className with. |
You can replace multiple scripts with this method, including each className scriptFile option after the last.