Last documented update: Mar 26 by mana vortex
This page will tell you what the game's weak database is, and how you can use it to change or create game items.
For the beginners' guide, check How to YAML: Tweak modding basics
For another example, see How to change an NPC's record with Redscript: TweakXL: Changing game records
Or check the second half of New Iconic Weapon: Step by Step for explanations of weapon properties
Cyberpunk 2077 uses a single static database file, which registers and defines gameplay elements.
You can find it under \r6\cache\tweakdb.bin
To create a new gameplay item, mod developers must add to the Tweak DB.
See the child page Browsing the tweak database
TweakDB is only a huge list of records - entries defining everything that you can interact with in the game, from NPCs over weapons to (perhaps most familiar to most) clothing items.
You can see existing entries by browsing the .tweak under Cyberpunk 2077tools\redmod\tweaks
(use a text editor such as Notepad++).
A record is a collection of key-value pairs. Its nature is defined by the property $type. You can browse existing records in Wolvenkit's Tweak Browser, or use CET's Tweak Editor to look at the values in-game.
A flat is a key-value pair used by records.
characterType: NPCType.Human
characterType
is the name of the property, wheras NPCType.Human
is the assigned value.
In this case, the syntax indicates an enum.
The Tweak DB can be interacted with using Cyberpunk's official REDmod, or numerous community solutions such as TweakXL, CET, and redscript.
Via tweak file: TweakXL
Via script: Cyber Engine Tweaks / redscript / Cyberpunk's official REDmod
The following is a diagram which maps the relationship between game files for use with TweakXL and Archive XL:
Check the tutorials linked under Wait, that's not what I want!
How to read the game's tweak database
Published: Jan 13 2024 by mana vortex Last documented edit: Jan 13 2024 by mana vortex
This page tells you how to browse the TweakDB. If you don't know what that is, you might want to read TweakDB: Game database first.
By browsing the TweakDB, you can inspect the game's database and change properties in real time.
To inspect the TweakDB, you have three options. This page will document each of them.
To explore the game's existing records, check Browsing the .tweak files (requires the REDmod DLC)
To fuck around and find out, check Editing values with Cyber Engine Tweaks
To create new tweak files, read The Wolvenkit Tweak Browser
You can do this directly in your game. Changes will not persist if you restart, and sometimes you may have to reload for them to become active, but this is the fastest and most comfortable way to fuck around and find out.
The easiest way to create tweaks is to use the Wolvenkit Tweak Browser. This will generate tweak files for you which contain the current record's properties, whether they're directly defined or inherited from other records.
If you search for WilsonWeaponModAbility
in the Wolvenkit Tweak Browser, you will find something like this:
Items.WilsonWeaponModAbility:
$type: gamedataGameplayLogicPackage_Record
stackable: False
UIData: Items.WilsonWeaponModAbility_inline0
animationWrapperOverrides: []
effectors:
- Items.WilsonWeaponModAbility_inline1
- Items.WilsonWeaponModAbility_inline2
items: []
statPools: []
stats: []
As it's next to impossible to understand the item's structure like this, check the next section about Browsing the .tweak files and Example: browsing .tweak files.
.tweak
filesIn your game directory , find the subfolder tools\redmod\tweaks
("tweak folder"):
These folders contain a bunch of .tweak
files, which you can open with a text editor of your choice. If you don't have one yet, here are your options:
Notepad++ (free)
This is fastest, and you can use this text editor for a lot of Cyberpunk modding. Press the hotkey Ctrl+Shift+F
(Edit -> Find in Files) and search under the tweak folder.
An IDE (e.g. Visual Studio Code (free), IntelliJ):
This is the most comfortable. Simply open the tweak folder and use the built-in search (hotkey for VSCode: Ctrl+Shift+F
) to find your way along the files.
Agent Ransack (free) A command line search interface
If you're just looking for occurrences of a certain string (e.g. all vendors), you can run the following powershell script from the tweaks directory:
# Which file should your findings be written to?
$outfile = "Output.txt"
# adjust this too - what you're looking for. Treated as regular expression
$searchString = '"BaseStats\.'
Clear-Content -Path $outfile
$UniqueFindList = [Collections.Generic.HashSet[string]]::new( [StringComparer]::InvariantCultureIgnoreCase )
Get-ChildItem -Recurse -Filter *.tweak | ForEach-Object {
Get-Content $_.FullName | Select-String "$searchString" | ForEach-Object {
$_.Line.Trim() -replace '^[^"]+"' -replace '^"' -replace '";?$' -replace '",.*$'
} | Where-Object { $UniqueFindList.Add($_) }
} | Sort-Object | Out-File -FilePath "$outfile"
In this example, we want to learn about Wilson's iconic gun and the effects of its WeaponMod. Check Wilson's iconic iron for the integrated version, or start searching:
Press Ctrl + Shift + F
to open up the search dialog box and search for Preset_Lexington_Wilson
.
You will find it in the following path:
tweaks/base/gameplay/static_data/database/items/weapons/ranged/handguns/lexington/preset_base_lexington.tweak
Preset_Lexington_Wilson
, but in .tweak format.This is the same tweak you'd find in the Tweak Browser, but it's much easier to read and understand.
To follow this weapon's iconic weapon mod, find the section where it is defined:
{
slot = "AttachmentSlots.IconicWeaponModLegendary";
itemPartPreset = "Items.WilsonWeaponMod";
}
This will take us to iconic_mods.tweak
.
The file holds WilsonWeaponModAbility
with a bunch of statModifiers
:
… which aren't too different from the weapon modifiers. Let's ignore them for now and focus on the interesting part:
OnAttach =
[
"Items.WilsonWeaponModAbility"
];
Searching for this will take us to mods_abilities.tweak
, which holds the information we care about.
For an explanation of these properties, refer to Types of tweak records -> Effector.
To see how this file would look in the Tweak Browser (and why browsing the .tweak files is superior), check Example: Using the Wolvenkit Tweak browser.
Which kinds of tweak records exist? How are they defined? What do they mean?
Created: Jan 13 2024 by mana vortex Last documented update: Jan 13 2024 by mana vortex
This page lists types of tweak records with their properties and lists of occurrences in the wild. They are grouped by type. If this wiki has more information, there will be a link at the start of the block.
This is a work in progress, as the tweak database is huge and barely-documented. If you have any information that needs to be in here, please don't hesitate to sign up as an editor and start contributing!
If you just want a quick overview of a certain type of tweak, you can check Cheat Sheet: Tweaks instead.
If you want to learn how to make tweaks instead, check How to YAML: Tweak modding basics
Please keep entries in the following format (you can copy e.g. Effector below):
Heading 1: Section - Group records by type(s)
Heading 2: Name of tweak type
A brief description of what it does, and a .tweak snippet (syntax: swift).
If you know any guides or resources using this kind of tweak, add an info box with links.
Heading 3: Properties
A table: propertyName => explanation
Heading 3: Existing <name of tweak type>
A table with name of tweak type and a brief description of what it does
A wrapper of Prereq with additional finetuning.
# Condition to check if attack type is ranged
Conditions.Is_Attack_Ranged:
$type: gamedataHitPrereqCondition_Record
invert: False
onlyOncePerShot: True
type: Prereqs.AttackType
attackType: Ranged
invert
trigger when the condition is not met?
onlyOncePerShot
Limit this to one procc per bullet?
type
A Prereq — not the same as $type
!
attackType
finetuning of type
Perks.IsHitTargetAlive_inline2
Is the current target alive?
Perks.HitIsBodyPartHead_inline0
Is the current hit a headshot?
An effector is the tweak version of an if-condition
: it is using Conditions or Prereqs before triggering its effect.
{
prereqRecord = "Prereqs.ProcessHitTriggered";
percentMult = 0.25f;
unitThreshold = 10f;
} : MultiplyDamageWithVelocity,
{
prereqRecord = "Perks.IsHitQuickMelee";
value = 1.5f;
} : MultiplyDamage
prereqRecord
a Prereq to check if the effector should become active
unitThreshold
a lower bound for the condition
percentMult
for a multiplier: multiply by percentage (0.25 => 125%)
value
the numeric value (1.5 => 150%)
MultiplyDamageWithVelocity
Will multiply damage by percentMult
(if the velocity is > unitThreshold
)
MultiplyDamage
Will multiply damage by value
The prerequisite for e.g. an Effector.
This type of record adds a quality to an item, modifying its stats.
Set an item's quality via statModifier. To
Quality.Random
Qualities in descending order:
Quality.IconicItem
Quality.LegendaryPlus
Quality.Legendary
Quality.EpicPlus
Quality.Epic
Quality.RarePlus
Quality.Rare
Quality.UncommonPlus
Quality.Uncommon
Quality.CommonPlus
Quality.Common
These entries will start with BaseStats., e.g. BaseStats.ReloadTimeBonus
.
Unless specified otherwise, these are numeric (multipliers/additions).
You can find a full list under Cheat Sheet: Base Stats, and a list of weapon stats with explanations under Cheat Sheet: Weapon BaseStats