40 ratings
Modding Jagged Alliance: Flashback
By Zuggi and 2 collaborators
Welcome to the official Jagged Alliance: Flashback modding guide!

There are several ways to create new levels, mod the original game or create entire new campaigns. This guide will be our hub to cover the different aspects of JAF modding, link to our how-to videos and give you all the relevant information to create your own Jagged Alliance experience.

This guide will help you get started with the Modding and using the TXEditor (our Level Editor), which is the editor available to everyone right now - it is very similar to the editor we use ourselves to create the game itself. All you need is a copy of Jagged Alliance:Flashback, the free version of Unity 3D and the TXEditor.

>> Download JAF Level Editor v.0.6 <<[www.jaggedallianceflashback.com]
>> Download Unity3d <<[unity3d.com]

We have split this guide into two main sections: Modding the game directly and creating new content and levels through the Level Editor (TXEditor). The first section focused on how to setup and use the TXEditor, how to create your own assets and sectors, quests and dialogs. The second sections is about how to change the game directly. That means changing or de-activating all kind of functionality in json files, like core game rules, units setup and other features. It also contains information on how to structure and share mods.

If you have any questions, please do not hesitate to ask here on the Steam Forums or at the official Jagged Alliance official forum[www.jaggedallianceflashback.com]

Please notice that, as the game is currently in development, things may change and render specific detail in this document obsolete. We will expand and upate this guide constantly with more tutorial videos, pictures and content as we go along with developing the game

Happy modding,
The JAF dev team

Enjoy!
Rate  
Favorite
Favorited
Unfavorite
Level Editor Setup (TXEditor)
The Level Editor (or TXEditor) allows to create your own sectors, or levels, to be played in Jagged Alliance: Flashback.

TXEditor is an extension to Unity. In order to use it, you have to have Unity installed on your computer. For most features, the free standard version can be used, but for building AssetBundles, the paid pro version is needed (or the trial 30 day trial version).

>> Download JAF Level Editor v0.6 <<[www.jaggedallianceflashback.com]
>> Download Unity3d <<[unity3d.com]

Unzip the Level Editor, open Unity and select "Open new project" while choosing the root of the unzipped Level Editor to get started. The video gives a quick overview on how to update setup the Editor with your game and get started creating your own unique content.


Setting up the game path reference

In order to get access to the assets (3d models etc.), you need to set the path to the game. This only has to be done once.

  • (1) With the TxEditor project open, open the preference window
    Mac: Unity -> Preferences... -> TxEditor
    PC: Edit -> Preferences... -> TxEditor
  • (2) Click “...” button next to the Game Data Folder input field.
  • (3) Navigate to you game directory:
    Mac: /Users/[user name]/Library/Application Support/Steam/SteamApps/common/Jagged Alliance Flashback/game.app/Contents/Data
    Windows: C:\Program Files (x86)\Steam\SteamApps\common\Jagged Alliance Flashback\game_Data
  • (4) Now go to the menu TxEditor -> Open AssetsPanel
  • (5) Wait while all the assets is loaded into the panel. This may take while.

A note for Mac users: To get to game data folder, you need to right click the JA:F application icon and select show content. This will open the underlying file structure.

Note: If the Assets Panel is empty or the assets disappears from your scene (happens if Unity recompiles for instance), just click the “Load AssetBundle” button to reload the assets from the game. Also remember to reload the scene you are working on.


Create a new Sector
  • (1) Go to TXEditor -> Create a new Sector
  • (2) Choose a name and place to save your Sector (saved as a Unity scene).
  • (3) In order to show the game's grid, to to TXEditor -> "Open Camera Control" and click "Show Grid". To disable Unity's grid, in the scene window, go to Gizmos, and deselect "Show Grid".
  • (4) Drag and drop items from the Assets Panel onto the scene window to place them and start building!
  • (5) Save and load scenes as you would normally do i n Unity.

Export a Sector to the game
When you are contempt with your new sector, it is time to export it to the game’s mod folder.

  • (1) Open TxEditor -> Export Scene As Level…
  • (2) Enter the name of your sector (or the name of an existing sector)
  • (3) Enter the name of your mod
  • (4)Press “Export”

Your new sector is now created in [game folder]/Data/StreamingAssets/Mods/[mod name]/Levels/[level name].xxx
The editor exports a data file containing information on how assets are placed in your sector. It also exports terrain maps.

To activate you mod, see the appropriate section in this document.
Editor: VFX
This video describes which VFX are currently available in the game, and how you can add them to your levels.

Editor: Creating your own Assets
You can create your own assets, or objects and models to be placed in your sectors.
An asset in JA:F is nothing but a prefab (see Unity documentation[docs.unity3d.com]) that has the AssetView component attached to the root GameObject.

Note: This requires a Unity Pro license.

  • (1) Open the WorkbenchScene included with the Editor project
  • (2) Create an empty GameObject. This will be the root of your asset
  • (3) Name it something meaningful.
  • (4)Add your content as a child of this object and place it correctly in the local coordinates.
  • (5) Drag the root of your Asset into the project view to make it a prefab.
  • (6)Select the newly created prefab in the project panel.
  • (7) Go into Debug mode by opening the drop-down menu right next to the lock icon in the top of the inspector panel.
  • (8) Click “Add Component” in the inspector panel.
  • (9) Write AssetView in the search field and select the class that show up.
  • (10)Enter a unique name in the PrefabID field.
  • (11) Go back to Normal mode.
  • (12) Select you Asset in the Hierarki panel (or in the scene)
  • (13) Set up your components blocking and snapping (you may need to deselect and select it again)
  • (14) Click “Close Asset Setup” button. This will apply the changes to the prefab.
  • (15) It is now ready to be used in your own sector levels.

Note: You cannot attach your own components (monobehavior scripts) to asset views, as they will not be exported with the AssetBundle.

Creating an AssetBundle
In order for the game to use custom created assets, you need to build an AssetBundle containing your assets and put it to your Mod folder.

  • (1) Make sure all your Asset prefabs are placed inside a designated folder.
  • (2) Select that folder
  • (3) Go to TxEditor -> Assets -> Export AssetsBundle…
  • (4) Give your assetbundle a name and provide the mod name
  • (5) Make sure the “Export only AssetViews” checkbox is checked out
  • (6) Click Export

An AssetBundle is now created and copied to your game folder and is ready to be used. Make sure to activate your Mod as described above.
Editor: Scripting Triggers, Quests & Dialogs
The TX Editor allows you to setup your own triggers, quests and dialogs.

Scripting in JA:F is done in Lua. For more information about writing Lua code, click here.[www.lua.org]

You can find the scripting reference for Jagged Alliance: Flashback in hte link below, it contains all the commands and checks you can do with LUA from within your scripts.

>> Download TX Editor Lua Scripting Reference Doc[dl.dropboxusercontent.com]

Triggers
In order for Lua to be executed, it needs to be tied to an trigger. A trigger is executed at certain events; OnSectorLoad, OnZoneEnter, OnUnitKilled etc. It can also be triggered when you click a Unit (an NPC).

The Trigger asset can be found in the AssetsPanel under Logic foldout. Just drag it into the scene like any other asset.

A trigger is split into two scripts. The first is the condition script. Only if this script returns true, the effect script is executed.

Zones
If a Trigger has the event type of OnEnterZone, it need to be connected to one or more zones.
A Zone is a collection of tiles marked up in the scene by a cube. Every tile within the cube belongs to the zone.

A Zone is an Asset prefab and you can find it in the Logic foldout in the AssetsPanel.

Part 1: Setting up triggers with zones.

Part 2: Setting up Quests
The following video follows the previous one, and shows how you can setup quests in connection with triggers.


Part 3: Creating custom Dialogs
Modding: Creating & Sharing Mods
Creating a Mod

All files in the "Original" folder can be overridden by a mod. A mod is basically just a set of files, that if they are placed in the same relative folder and named the same as a corresponding files in the original folder. Files from activated mods will be prioritized over the one in the original folder.

Example:
In the Mods folders, there is a folder called "TheGym". In this folder there is a sub-folder "Units" containing a modified copy of NPCs.json. When this Mod is active (more on that later), the game will use the NPC’s set up in the file in the Mod folder instead of the one in the Original folder.

You can do the same with unit portraits, GameRuleSettings, AssetBundles etc.

Activating a Mod
Mods can be activated and deactivated manually. You can also have multiply Mods active at the same time (and prioritized) if you want.

Here’s how to manually activate a Mod:
  • Open the StreamingAssets/Core/ModData.json file with a text editor (Notepad or TextEdit will do)
  • Add the following lines to the file:
    {
    “path”: “TheGym”,
    “active”: true
    }
  • Path is the path of your mod relative to the Mods folder.
    Active indicates whether the mod is active (true) or not (false)
  • Please note, that if you have multiple mods, you need to seperate these by a comma.
    Additionally, the order is the priority, where bottom is first priority. That means that if the same file exists in both mods, the bottom Mod file will used.

Referring to assets
Throughout the different datafiles, there are references to assets. This can be a portrait texture from a file or a 3d model from an assetbundle.
All theese assets have an AssetID (same as prefabID in the TxEditor) which is a unique string.

The SourceAssets.json file in the Assets folder for instance, contains a list of all the assetID’s in the SourceAssets.unity3d assetbundle.
So if you want to refer to a gavestone model, the assetID reference is Props/gravestone_01. Or a unit portrait could be UnitPortraits/LuisaGarneau.jpg

Open any of the json files in the StreamingAssets/Original/Assets folder, and you can see the reference AssetID for any moddable asset. In fact, you can add your own json file in the Assets folder, and that will setup your own assetID’s.

If you add assets to a mod yourself, you will have to add a reference file to be able to use them in the game.
Note: If you create assets using the TxEditor (as AssetBundles), reference files will be created for you.

Sharing a Mod

If you have created a cool Mod, you should share it with the rest of the JA:F community.
It is possible to just package your mod folder and let people download it manually. But we also provided the ability to share mods via SteamWorkshop.
In order for this to work, you must have steam running and be logged into your Steam account (it is also necessary that you have activated the game through Steam).

Upload your mod to SteamWorkshop
Uploading your mod to steam workshop will allow you to distribute your work to a lot of users. It also allows you and others to discuss, rate and subscribe to mods.

  • (1)Start JA:F via Steam
  • (2)When you see the disclaimer, press the little “mods” button in the top left corner.
  • (3)Your mod should be in the list that shows up
  • (4)Click it
  • (5)Click publish and wait for it to finish
  • (6)That’s it!

Subscribing to mods
In order to browse and subscribe to mods, you will need to use the steam interface for that.

  • (1)Open steam
  • (2)Navigate to the community page for JA:F
  • (3)Click the Workshop tab
  • (4)Look for a great mod, select it
  • (5)Click the subscribe button

That’s it. Now in order to play it, you need to unpack and activate it. You can use the same interface as you for uploading Mods.

  • (1)Start JA:F via Steam
  • (2)When you see the disclaimer, press the little “mods” button in the top left corner.
  • (3)If there are any newly subscribed mods or an update to one of the subscibed mods, it will now be downloaded, unpacked and installed…
  • (4)The mod should now be in your list. Click it.
  • (5)Click activate.
  • (6)Click the “save and close” in the upper right corner.
  • (7)Restart the game and you are now playing the mod.
Modding: Changing game settings
We have tried our best to add extract as much content into external files as possible. This makes is very easy to change. Most data values are put into json[en.wikipedia.org] files, which are easy to modify. Other data are simply image files that get’s loaded when needed. But a lot of content are provided as AssetBundles[docs.unity3d.com], a binary file format integrated into Unity that contains all kinds of assets.

File structure
If you take a look at the contents of the game folder in Finder (on Mac) or Explorer (Windows) you will see a folder called StreamingAssets.
On Windows, you will find it in the _Data folder and on Mac you will have to right click and select “Show Package Content”, then you will find the StreamingAssets folder inside the Data folder.


  • (a)The ModData.json files contains information on which mod are active and the priority of them.
  • (b)Inside the Mod folder you find all the mods. These are “filtered” copies of the Original folder. More on that later.
  • (c)GameSettings.json stores the game settings like ZoomSpeed for the camera etc.
  • (d)The NPC.json and the Units.json contains all the units available in the game (or Mod)
  • (e)The levels folder store everything concerning the different sectors.
  • (f)The FileResources.json stores information about external texture assets. This could be portraits f.ex.
  • (g)SourceAssets.json and SourceAssets.unity3d is an AssetBundle. More on this later.
  • (h)GameRulesSettings stores information about the core game rules. This could be combat settings, line of sight nerf’s etc.
Modding: Changing Characters
NOTE: You need to have some basic knowledge of how to edit .json files. It is also recommended that you do backups before changing stuff left and right. It is possible to make the game unplayable if you do this wrong.

That out of the way, let’s have some fun!

Opening the files
All modding of characters are done via Units.json and/or NPCs.json which you can find in "Jagged Alliance Flashback\game_Data\StreamingAssets\Original\Data\Units\Units.json"

Open the file with some text editing software that you are comfortable with(I usually use Notepad++ and sometimes MonoDevelop that ships with Unity, the free version also has this tool). Once opened you will be presented with all current existing units in our game (excluding some NPCs found in NPCs.json), complete with stats, visuals and such. For this tutorial we’re going to be modding JAF’s starter unit “#0047”. Search for “unitID”: “CIA_Agent” (at the moment of writing you can find this unit at the very bottom of the list).

Changing Colors
I’ll go into more depth further down what all these properties mean, but for now we’re going to look at the properties underneath “Visual”. The first thing in the list are the color settings. At this point a character has 9 color properties. The default values for #0047 looks like this:

"UpperBodyColor1": "0.208, 0.216, 0.271",
"UpperBodyColor2": "0.878, 0.804, 0.757",
"UpperBodyColor3": "0.318, 0.231, 0.192",
"LowerBodyColor1": "0.412, 0.427, 0.502",
"LowerBodyColor2": "0.396, 0.431, 0.451",
"LowerBodyColor3": "0.412, 0.427, 0.502",
"HairColor": "0, 0, 0",
"HeadColor": "1, 0.612, 0.494",
"MoustacheColor": "0, 0, 0",

As you can see, UpperBody and LowerBody models has a max support of 3 changeable colors, while HairColor, HeadColor and MoustacheColor only has 1. This does not necessarily mean all upperbody and lowerbody models have 3 changeable colors, they all technically support it however. Don’t think too much about it, but if you happen to change a color and you see no impact on the character, that means that the color property is not in use on that particular bodypart.

The colors are also presented in 3 decimal values(In the order of R, G and B) these are basically the result from converting RGB scale(0-255) to a number between 0 and 1, for instance UpperBodyColor1 has 0.208, 0.216 and 0.271.

Let’s change this number to something else, like orange.

To convert a RGB value to a 0-1 decimal value , all you have to do is to divide the RGB number by 255. For instance here’s the RGB for bright orange I chose: 255, 127, 39

255/255 = 1
127/255 = 0,4980392156862745
39/255 = 0,1529411764705882

I’ll round these values down to 1, 0.5, 0.15. Then we’ll push this into our CIA_Agent, UpperBodyColor1 property:

"UpperBodyColor1": "1, 0.5, 0.15",

Now, save Units.json and load up the game. Unit #0047 should now look like this image below. Feel free to experiment with other colors and explore further!




Changing body parts
Now continuing we’re we left off in the Units.json file, you’ll find that right after colors you’ll come across this:

"EnabledParts":

"LowerBody01",
"UpperBody04",
"Mask"

This is the part where we define which parts of the body we want to show on this character. Both the male and female characters has a set of models you can turn on and off using this list. I don’t want a mask on my guy anymore. So I’ll erase Mask and instead add a head with beard and also a cap.

"EnabledParts":

"LowerBody01",
"UpperBody04",
"Head01",
“Beard01”,
“Cap”

Save your changes and once again start up JAF. Congratulations, you’ve created a lumberjack merc! Below is our current lists of available body parts. #0047 should now look like this:


Available parts, Male characters:
UpperBody01 - Shirt, rolled up sleeves
UpperBody02 - Shirt without sleeves
UpperBody03 - Jacket
UpperBody04 - Unzipped jacket with shirt underneath

LowerBody01 - Army style pants + boots
LowerBody04 - Shorts + shoes

Head01 - Basic head
Hair01 - Short receding hair
Hair02 - Short hair
Hair03 - Afro
Hair04 - Commander Spice specific

Mask01 - Standard balaclava

Hat01 - A hat.
Hat02 - Take a guess...
Baret - Red baret, signature element of The Prince’s Army
Cap - Green baseball cap
Radio - A radio headset for communication

Beard01 - Commander Spice specific
Moustache01 - That hair you grow above your mouth and underneath your nose...

Apron - An apron fitting for bartenders and butchers
ArmPatch - Army insignia, signature element of The Prince’s Army

Available parts, Female characters:
UpperBody01 - Sleeveless shirt
UpperBody02 - T-Shirt

LowerBody01 - Army pants + Boots
LowerBody02 - Shorts + shoes

Hair01 - Short hair
Hair02 - Long hair

Note that these lists are to be changed as we progress further.
46 Comments
< >
AG!!! Feb 23 @ 8:21pm 
U can use free unity with JAF Public Editor v0.6, they have JAF Assets.
But if u wont to add new assets, u need Pro version of Unity.
Yes it is.
U can ask QAs here, but you cant have answer from forum moderators and JAF game creators..

pip010 Feb 23 @ 10:59am 
few quick questions:

can I use the free unirty if not planning on adding assets and only use whats in the game?
I'm coder and that will work just fine for me!

is it feasible to use the free unity at all?

there seems to be alot of QAs here, is that the best place to ask for help on modding?

AG!!! Jan 25 @ 1:11am 
Hello.
@Zuggi
I want to add new asset, add to unity, worked. Then export to assetsbuddle worked. then add to game sector. but in the game didnt show asset...
Maybe need to do anything else to my mod is working???
Django Jan 21 @ 2:15pm 
Thank you, i will try that out. I have some ideas ... but so little time.
Zuggi  [author] Jan 21 @ 1:48pm 
@sx
Thanks for clearing that up. Haven't been able to get an answer from the coders.
sxdemon1988 Jan 21 @ 11:37am 
google translite:
Django , ctrl+D clone objects .

Q:And btw is it possible to clone more than one object/asset in one go? Im looking for shortcuts to create bigger structures.

A:hierarchy view select objects shift .... then ctrl+D and move
Django Jan 19 @ 3:46am 
I want to clone objects but pressing ctrl does not do the trick. What should i do?

And btw is it possible to clone more than one object/asset in one go? Im looking for shortcuts to create bigger structures.
Zuggi  [author] Jan 12 @ 4:14am 
Can't get a clear answer right now...try asking shaga as I think he's fiddled with that code as well
AG!!! Jan 12 @ 1:03am 
I tried to coppy quest and renname it to quest "2", create triggers and needed scripts, but it's not work.
When change to original quest its work.
Zuggi  [author] Jan 12 @ 12:51am 
You need chatmapper to do that. Otherwise you have to change what's there into your quest.