Browsing the tweak database

How to read the game's tweak database

Summary

Published: Jan 13 2024 by manavortex Last documented edit: Jan 13 2024 by manavortex

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.

If you're looking for all tweak database entries of the type XYZ, you might be lucky to find a list under Cheat Sheet: Tweaks. If there isn't one, please make one once you have found what you're looking for!

Introduction

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.

A big part of tweak modding is exploration — poking through tweaks until you find just the right thing to copy or change, or looking for something specific in hundreds of files.

Editing values with Cyber Engine Tweaks

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 Wolvenkit Tweak Browser

Example: Using the Wolvenkit Tweak browser

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.

Browsing the .tweak files

You need the REDmod DLC for this.

In 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:

  1. 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.

  2. 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.

  3. Agent Ransack (free) A command line search interface

Searching .tweak files with powershell

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"

Example: browsing .tweak files

The example uses IntelliJ to look up a weapon record — Visual Studio Code is functionally identical.

This was initially a part of New Iconic Weapon: Step by Step, where you can also find explanations of various weapon properties.

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

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:

iconic_mods.tweak -> WilsonWeaponMod
WilsonWeaponMod : IconicWeaponModBase
{
    OnAttach = 
    [
       "Items.WilsonWeaponModAbility"
    ];
    statModifiers += 
    [
       {
          statType = "BaseStats.ReloadTimeBonus";
          modifierType = "Additive";
          value = -0.1f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.RecoilKickMin";
          modifierType = "Multiplier";
          value = 0.8f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.RecoilKickMax";
          modifierType = "Multiplier";
          value = 0.8f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.SpreadDefaultX";
          modifierType = "Multiplier";
          value = 0.66f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.SpreadMaxX";
          modifierType = "Multiplier";
          value = 0.66f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.HitDismembermentFactor";
          modifierType = "Multiplier";
          value = 3f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.HitWoundsFactor";
          modifierType = "Multiplier";
          value = 3.f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.EffectiveRange";
          modifierType = "Multiplier";
          value = 0.75;
       } : ConstantStatModifier
    ];
    buyPrice = [];
    sellPrice = [];
}

… 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.

mods_abilities.tweak
WilsonWeaponModAbility : IconicWeaponModAbilityBase
{
    UIData = 
    {
       iconPath = "ability_offensive";
       localizedDescription = "LocKey#50743";
    };
    effectors = 
    [
       {
          prereqRecord = "Prereqs.ProcessHitTriggered";
          percentMult = 0.25f;
          unitThreshold = 10f;
       } : MultiplyDamageWithVelocity, 
       {
          prereqRecord = "Perks.IsHitQuickMelee";
          value = 1.5f;
       } : MultiplyDamage
    ];
}

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.

Last updated