Reskin the game
A reskin changes how the game looks, sounds or reads without changing how it
plays. It is the quickest kind of mod to make, and it needs very little Lua.
This guide covers four jobs: adding your own pictures, replacing the game’s,
swapping sounds, and changing text. All examples assume your script starts with
local sf2 = require("sf2") and that your mod.toml depends on core (see
How mods work).
Add your own pictures
Section titled “Add your own pictures”A texture is a PNG picture. A sprite is a named piece of a texture (the whole picture or a crop) with a pivot point and other settings. Keep the pixels and the sprite settings in separate files:
assets/ sprites/weapon.asset the sprite file (a small text file) textures/weapon.png the pictureThe sprite file is plain UTF-8 text with one setting per line. It is not a Unity file:
type=spritetexture=textures/weapon.pngpixels_per_unit=100type and texture are required. texture is the PNG’s path inside assets/,
including .png. Everything else is optional; the defaults are shown:
# Leave rect out to use the whole picture. Pixels, measured from the bottom left.# rect=[0, 0, 128, 128]pivot=[0.5, 0.5]border=[0, 0, 0, 0]pixels_per_unit=100filter="bilinear"wrap="clamp"mipmaps=false| Setting | What it does |
|---|---|
rect |
The crop [x, y, width, height]. It must fit inside the picture. |
pivot |
The anchor point as a fraction of the sprite ([0.5, 0.5] is the centre). |
border |
Left, bottom, right and top borders for stretchable sprites. |
pixels_per_unit |
How many picture pixels make one world unit. Raise it to draw the sprite smaller. |
filter |
point (crisp pixels), bilinear or trilinear. |
wrap |
clamp, repeat, mirror or mirror_once. |
mipmaps |
true or false. Smaller copies for shrunken drawing. |
Write # for comments. A repeated or unknown setting is an error. Several sprite
files can crop the same PNG differently, which is how one image becomes several
icons.
In Lua, find a sprite by its asset ID, which is its path inside assets/
without the extension:
local icon = sf2.assets.sprite("sprites/weapon")A texture ID such as textures/weapon is not a sprite ID. Models, sounds and
animations work the same way with
sf2.assets.model,
sf2.assets.audio and
sf2.assets.binary. To test whether
an optional file exists, use
sf2.assets.exists.
Sounds and models
Section titled “Sounds and models”Put audio in assets/audio/. Use Ogg Vorbis (.ogg, recommended, and long
clips stream) or 16-bit WAV (.wav). MP3, M4A and FLAC are not supported.
To convert with FFmpeg:
ffmpeg -i arena.wav -c:a libvorbis -q:a 6 arena.oggA model file goes in assets/models/ as .xml (or the gzipped .modelz). The
easiest way to start is to borrow a core model, as the first-mod tutorial does.
Making a character body is covered in Characters.
Replace the game’s art
Section titled “Replace the game’s art”A replacement says: “wherever the game would load this existing asset, load
mine instead.” The original files are never changed, and turning the mod off
restores them. Use
sf2.assets.replace:
sf2.assets.replace { target = "core:ui/skills/skillsench02.enchantmentfrenzy", replacement = "sprites/my_frenzy",}target is the existing asset, replacement is your own, and both must be the
same kind of asset (sprite, texture, model or audio). You can pass handles
instead of strings. Replacements apply wherever the game loads art through its
normal loaders, including entries inside the core atlases. The IDs of the game’s art are listed in the
Art catalog.
Two mods cannot replace the same target; the second one fails to load. Replacing does not add new states to a button or change anything the game reads from somewhere else.
Loading and versus screens
Section titled “Loading and versus screens”Loading screens and the versus screen are made of two full-screen panels, a left and a right one, and you replace each separately.
| Targets | Where they show |
|---|---|
core:ui/fullscreen/loading_left.img, loading_right.img |
The map’s entry screen after Fight, and the loader into and out of fights. |
core:ui/fullscreen/menu_loading_left.img, menu_loading_right.img |
The loader between the dojo, shop, profile and map. Without a replacement it reuses loading_*. |
core:ui/fullscreen/startLoading_left.img, startLoading_right.img |
The loader when a save is first entered. |
core:ui/fullscreen/act_left.img, act_right.img |
The chapter title cards between story acts. |
core:ui/fullscreen/VS_Fon_left.img, VS_Fon_right.img |
The two versus-screen background panels. |
One wide picture can supply both panels. Make two sprite files with complementary crops of the same PNG:
# assets/sprites/menu_loading_left.asset (picture is 2560 x 1080)type=spritetexture=textures/loading.pngrect=[0, 0, 1280, 1080]
# assets/sprites/menu_loading_right.assettype=spritetexture=textures/loading.pngrect=[1280, 0, 1280, 1080]sf2.assets.replace { target = "core:ui/fullscreen/menu_loading_left.img", replacement = "sprites/menu_loading_left" }sf2.assets.replace { target = "core:ui/fullscreen/menu_loading_right.img", replacement = "sprites/menu_loading_right" }The game keeps your picture’s proportions, scales it until it covers the screen,
centres it and crops what does not fit. It never stretches. Keep anything
important near the middle. The base game draws a logo on top of the loading
panels (core:textures/logos/logo.left and logo.right). If your artwork
already has a logo, replace those two sprites with a transparent one.
Upscaled buttons
Section titled “Upscaled buttons”If you replace a sprite with a larger picture, raise its pixels_per_unit by the
same factor so it keeps its on-screen size. A 300 x 300 button at 100 pixels per
unit, replaced by a 600 x 600 image, needs 200. Keep the original pivot.
Swap a sound
Section titled “Swap a sound”Sounds that moves play are replaced by name rather than by asset. Give sound
instead of target:
local old_knives = sf2.settings.toggle { id = "old_knife_sounds", label = "Old knife sounds", default = false,}
for number = 1, 3 do sf2.assets.replace { sound = "snd_swish_sword" .. number, replacement = sf2.assets.audio("core:gamedata/sounds/swish_sword" .. number), subtypes = { "Knives", "Daggers" }, setting = old_knives, }end| Field | Required? | Meaning |
|---|---|---|
sound |
Yes | The sound name a move plays. |
replacement |
Yes | An audio handle (yours, or a core sound), or another sound name. |
subtypes |
No (default: everyone) | Only fighters whose equipped weapon has one of these subtypes. Names match exactly, so "Knives" does not match "ButcherKnives". |
setting |
No (default: always on) | A switch from sf2.settings.toggle, or a choice from sf2.settings.choice with choice set to the id the swap applies to. The swap follows it live, with no restart. |
This changes what is heard for the one-shot sounds that moves play. It does not affect music, the interface or sounds your scripts play. A sound cannot be swapped for itself, and two mods swapping the same sound for the same weapons conflict. See Sound and music for playing your own audio.
Change text
Section titled “Change text”Text is stored under keys in localizations/<language>.toml. The language
code is the file name (eng, pol, …):
weapon.training_blade = "Training Blade"perk.opening_charge = "Opening Charge"perk.opening_charge.description = "Start with extra magic charge."Rules for these files:
- Keep one entry per line, with the value in double quotes.
- Use the same keys in every language file, with the same capitalisation.
- Write
\nor{br}for a line break. - Chinese and Japanese text wraps between characters by itself, and closing
punctuation such as
。or」stays at the end of the line before. You do not need to add spaces or zero-width spaces. - A missing translation falls back to English.
In Lua, sf2.text.get returns the text
handle for a key, which is what fields like display_name expect:
local name = sf2.text.get("weapon.training_blade")Use the game’s own text
Section titled “Use the game’s own text”The game’s English text is one file, localizations/eng.toml, in the game’s data
folder (in a desktop developer build, GameplayXml/localizations/eng.toml beside the
game). Each line has the same key = "text" form as yours. Any of its keys can be
named from a mod as core:localization/<key>, so a mod that reuses a base-game name
or line does not need its own copy:
local name = sf2.text.get("core:localization/WEAPON_KATANA")Fields that take a plain text key, such as a battle’s title or a forge recipe’s
alias, also accept the game’s key itself ("WEAPON_KATANA"). An item’s or perk’s
name and description must be text your mod owns, so copy the game’s words into your
own key while loading:
local name = sf2.text.register { id = "item.old_katana", language = "eng", value = sf2.text.read(sf2.text.get("core:localization/WEAPON_KATANA")) }Only English is
offered for now; a mod can still add languages with
sf2.locales.register.
Register text from Lua
Section titled “Register text from Lua”For small mods you can skip the files and register text from Lua with
sf2.text.register, once per language:
local name = sf2.text.register { id = "weapon.desolator", language = "eng", value = "Desolator" }sf2.text.register { id = "weapon.desolator", language = "pol", value = "Desolator" }A key may be defined only once per language, whether in a file or in Lua. To
change text the base game (or another mod) already defines, use
sf2.text.patch:
sf2.text.patch { target = "core:localization/weapon_nunchaku", language = "eng", value = "Nunchaku",}Two mods patching the same text in the same language conflict; different
languages are fine. If you need the words themselves, for example to show them in
a menu, sf2.text.read turns a handle into a
string for the current language. Read it again when you refresh your menu, since
the result does not follow a language change by itself.
Find core content
Section titled “Find core content”Core content is everything the base game ships: weapons, perks, fights, opponents, arenas, sounds, models and icons. Your mod can reuse any of it without copying files, if you know its ID. The sidebar’s Core IDs pages list every ID, generated from the game’s data. Search, click an ID to copy it, and paste it into your script.
| Content | Looks like | Use it with |
|---|---|---|
| Equipment | core:items/weapon/weapon_katana |
sf2.items.get |
| Perks | core:perks/perk_cobra |
sf2.perks.get |
| Story fights | core:fights/zone_1/tournament/3 |
sf2.battles.patch |
| Opponent blueprints | core:warrior-templates/shogun_katana |
sf2.fighters.get |
| Arenas and dojos | core:locations/dojo |
a location field |
| Sounds and music | core:gamedata/sounds/snd_gong |
sf2.assets.audio |
| 3D models | core:gamedata/models/mdl_weapon_katana_ritual |
sf2.assets.model |
| Icons | core:ui/items/armor12.img_armor_mantle_of_night |
sf2.assets.sprite |
Always write the core: prefix and use lowercase. The handles are not
interchangeable: an item is a complete piece of equipment, while a model is only
its look. To make a new weapon that looks like the katana, register your own
weapon with the katana’s model. When you pair a new weapon with a core model,
pick one used by core weapons of the same subtype so it fights with a matching
moveset. A few legacy items share a name and carry a suffix in their ID; copy
those from the catalog.
Using an ID like this reuses core content and changes nothing in the base game.
To change the original itself, use sf2.assets.replace or sf2.text.patch
above, or a patch function for content (see Weapons).
Icons inside shared atlases are only partly known: the Art catalog lists the icons the game’s own data refers to, which covers equipment, perk and portrait icons.
On-screen control packs
Section titled “On-screen control packs”Players can also swap the joystick and fight buttons with a local control pack. This is separate from mods: it is a folder of PNG images the player chooses in Options > Accessibility, and it has no manifest or script.
Create ControlPacks/My Pack/ beside the game’s data folder (or in the game’s
persistent data folder) and put the layer images inside. The game builds each
control from layers with fixed file names, drawn as white shapes on a transparent
background.
| File | Size used by DE128 | Used for |
|---|---|---|
fight_bg_normal.png |
200 x 200 | Button and joystick-knob background when idle. |
fight_bg_active.png |
200 x 200 | The same while pressed. |
fight_bg_frame.png |
200 x 200 | The ring over every button and the knob. |
fight_bg_frame_big.png |
466 x 466 | The outer ring of the joystick area. |
stick_arrows.png |
406 x 407 | Direction arrows and centre of the joystick area. |
icon_Punch.png, icon_Kick.png, icon_Magic.png, ranged_attack.png |
various | The button icons. |
icon_Charge.png |
128 x 116 | The raid charge button icon. |
icon_Stroke.png, icon_Magic_Full.png, icon_Range_Full.png |
various | The magic recharge ring and the ready icons. |
icon_HighlightStick.png, icon_KickHighlight.png, icon_ChargeHighlight.png |
various | Tutorial highlights. |
A control keeps the built-in artwork if any layer it needs is missing. Restart the game after editing a pack. A mod’s explicit sprite replacement takes priority over the player’s chosen pack.
Next steps
Section titled “Next steps”- Make a weapon with your own icon: Weapons.
- Add effects and lighting: Visual effects.
- Play your own music: Sound and music.