On this page 10 sections
This guide is for people who have never made a mod. You need no programming: everything here is done by copying folders and editing text files. At the end you will have a mod that changes a weapon's price and adds a brand-new sword that a merchant sells.
If BLSE is not installed yet, follow Installing first.
What you need#
- The game with the Unofficial Patch and BLSE installed.
- A text editor. Notepad works; Notepad++ is easier, because it shows line numbers and colours.
- The game's console, to test. Press
~in the game. Typeblseand press Enter: if BLSE answers with its version, everything is ready.
How BLSE mods work#
The game reads its data from text files: what an item costs and what it is called, what merchants sell, what characters say. Without BLSE you change these by replacing the game's files, and two mods that change the same file break each other.
With BLSE a mod is one folder. You put the folder in Bin/loader/blse/mods/, and the game sees the files inside it as if they were its own. You never touch the game's own files. To remove the mod, delete its folder.
A few words used in this guide:
| Word | Means |
|---|---|
| Game folder | Where the game is installed, e.g. C:\Games\Vampire The Masquerade - Bloodlines. All paths below start there |
| Mod folder | Your mod: Bin/loader/blse/mods/<your mod's name>/ |
| Game path | Where a file lives inside the game, e.g. vdata/items/item_w_katana.txt. Inside your mod folder you use the same path |
| Class name | The game's internal name of an item, e.g. item_w_katana (the Katana). It is also the item file's name |
| Merge file | A small file that holds only your changes to one of the game's files, so several mods can change the same file |
Where to find the game's files#
The Unofficial Patch keeps readable copies of most data files in the game folder's Unofficial_Patch folder. Good places to look:
| Folder | Holds |
|---|---|
Unofficial_Patch/vdata/items/ |
One file per item: names, descriptions, prices, weight, damage, models |
Unofficial_Patch/vdata/system/vendors.txt |
What each merchant sells |
Unofficial_Patch/dlg/ |
The conversations, one file per character |
Only read and copy these files. Never edit them: your changes go in your mod folder.
Step 1: make the mod folder#
Create this folder (use your own name instead of my_first_mod: letters, digits and _):
Bin/loader/blse/mods/my_first_mod/Optionally add a file mod.ini in it, so players see who made it:
[mod]
name = My First Mod
version = 1.0
author = Your name
description = A cheaper katana and a new sword at Mercurio's.Start the game once. BLSE adds your folder to the list of mods in Bin/loader/blse/config/loadorder.txt. Type blse in the console: your mod is in the list.
Step 2: change an existing item (a cheaper katana)#
The katana's file is vdata/items/item_w_katana.txt. Open the copy in Unofficial_Patch/vdata/items/ to read it. Near the top you will find:
WeaponData
{
"printname" "Katana"
...
"item_worth" "215"
"player_sell" "20"item_worth is what a merchant asks, player_sell what a merchant pays you for it.
You could copy the whole file into your mod and change it, but then any other mod that changes the katana would fight with yours. Write a merge file instead: only the lines you change, in the same blocks. Create:
my_first_mod/blse/merge/vdata/items/item_w_katana.txtwith this text:
WeaponData
{
"item_worth" "100"
}That is the whole file. BLSE takes the game's katana file, puts your value over the old one and gives the result to the game. Everything else about the katana stays as it was.
The rules for merge files in short:
- Use the same path as the game's file, but under
blse/merge/. - Repeat the block names (
WeaponData { ... }) down to the value you change. - A line
"key" "value"sets that value. More you can do (add entries, remove them, pick one of several blocks with the same name) is in Mod folders.
Test it: start the game, load a save and visit a merchant who sells katanas. Merchants read prices when their trade screen opens; what you see also includes the game's haggling (your Persuasion), so it may be a little off 100.
Step 3: add a new item (a sword of your own)#
A new item needs three things: a name for it, an item file that describes it, and one line that tells BLSE which of the game's items it behaves like.
3a. Pick a class name. It must start with item_, use only lowercase letters, digits and _, and should contain your mod's name so it never clashes with someone else's: item_w_myfirstmod_sword. (w stands for weapon, as in the game's own names.)
3b. Tell BLSE what it behaves like. Create my_first_mod/blse/items.txt:
# <new item> <behaves like this item of the game's>
item_w_myfirstmod_sword item_w_katanaThe second name is the template. Your sword fights the way a katana does: a melee weapon with its slashing attacks. Everything you can write in an item file (name, price, damage, models, sounds) comes from your own file.
3c. Write the item file. Copy Unofficial_Patch/vdata/items/item_w_katana.txt to
my_first_mod/vdata/items/item_w_myfirstmod_sword.txtThe file name must be the class name plus .txt. Then change what you like. The lines you will want first:
| Line | What it is |
|---|---|
"printname" |
The name players see |
"description" |
The text in the inventory |
"item_worth" |
Price at a merchant |
"player_sell" |
What merchants pay for it |
"weight" |
Its weight in the inventory |
"BaseLethality" and "Dmg" (inside each Activation block) |
How hard it hits. Dmg is "<amount> <damage kind> <skill> <damage type>": change only the first number. Change both Activation blocks (Primary and Secondary attack) |
"playermodel", "wieldmodel_f", "wieldmodel_m", "infomodel" |
The models: lying on the ground, in a woman's and a man's hand, and in the inventory. Keep the katana's, or point them at models your mod ships |
Lines starting with // are comments: the game ignores them.
3d. Try it. Start the game, load a save, open the console and type:
give item_w_myfirstmod_swordThe sword is in your inventory. If nothing happens, see When something does not work.
Step 4: sell it at a merchant#
What each merchant sells is in vdata/system/vendors.txt. Again you do not copy that file: you add your item with a merge file. Create
my_first_mod/blse/merge/vdata/system/vendors.txtwith this text:
VendorData
{
Vendor
{
"@match" "Name=Mercurio"
+VendorItem
{
"Name" "item_w_myfirstmod_sword"
"InternalName" "item_w_myfirstmod_sword"
"AmmoOnly" "0"
"MinStage" "0"
}
}
}What each part means:
| Part | Means |
|---|---|
Vendor with "@match" "Name=Mercurio" |
"In the merchant whose Name is Mercurio". The file has many Vendor blocks, one per merchant; @match picks one. Other merchants' names are in the game's vendors.txt (for example Larry, Vandal, Tseng, Trip) |
+VendorItem |
Add a new item to his list. The + means "add", without it you would change his first item instead |
"Name", "InternalName" |
Your item's class name, both times |
"AmmoOnly" |
0: he sells the item. 1: he sells only ammunition for it (for guns) |
"MinStage" |
From which point in the story he sells it. 0: from the start. The game's own list uses higher numbers for items that appear later |
Test it: load a save, walk to Mercurio (Santa Monica) and open the trade screen. Your sword is in his list.
That's it: a complete mod with a changed item, a new item and a merchant selling it, without replacing a single game file.
When something does not work#
- The log:
Bin/loader/blse/blse.loglists every mod BLSE loaded and every problem it found, with the file and the mod's name: a merge it could not read, an item whose file is missing, two mods changing the same thing. Search it for your mod's name. - See what the game got: BLSE writes every merged file to
Bin/loader/blse/cache/files/. Open, for example,cache/files/vdata/system/vendors.txtto check that your item is in Mercurio's list. - Typing errors cause most problems: a missing
"or}, a class name spelled differently initems.txt, the item file's name and the merge. Copy and paste names rather than retyping them. - The console's
blsecommand lists your mod and says why it is switched off, if it is.
Before you share your mod#
- Zip it starting with
Bin(Bin/loader/blse/mods/my_first_mod/...), so players extract it into the game folder and are done. See packing your mod. - Tell players to keep it installed while they play a game they started with it. A save that holds an item your mod added cannot be loaded without the mod: the game crashes when it tries. Say this on your mod's page.
- Keep your class names once you have released the mod: renaming an item, or changing its template in
items.txt, breaks players' saves that hold it. - Need another mod? Name it in
mod.ini(requires = other_mod_folder), and BLSE switches your mod off with a clear message if it is missing. See mod.ini.
What next#
You can do much more with folders and text files alone:
| To | Read |
|---|---|
| Replace a model, texture or sound (put the file at the game's path in your mod folder) | Mod folders |
| Change or add quests and other data | Merges |
| Change what a character says | Dialogue lines (.dlg merges) |
| Add, remove or change things in a map (an NPC, a door, a prop) | Changing a map's entities |
| New guns, blood packs and other items | New items and weapons |
When you want things to happen (react when the player enters a level, kills someone, picks something up; show text on screen; add console commands), you need a small Python script. Getting started with Python mods starts from zero.
A complete example mod folder is examples/mods/blse_sample (in the release zip: SDK/examples/mods/blse_sample).