EDGEMODDERS / ANYONE CAN MOD
Wiki / REDcode

TweakDB and tweaks

TweakDB is the game’s database: every item, weapon, vehicle, character and many settings is a record, such as Items.Preset_Dian_Yinglong, made of named values called flats: its price, its damage, its display name, the records it points to. Mods change TweakDB with TweakXL tweak files, small text files in YAML or the game’s own .tweak format.

REDcode lets you look up any record, follow its links, and start a tweak from it in one click.

On this page  
The TweakDB view Browse and find records
The record page Every value of a record, with links
New Tweak from This Record REDcode writes the file for you, and what it looks like
Try it: change a price A three-line tweak, into the game
Hover in tweak files, Writing .tweak files Help while you type

The TweakDB view

The TweakDB view in the REDcode sidebar lists the record types, such as Clothing, with how many records each has. Open a type to see its records, grouped by the first part of their path when there are many.

  • The first use loads TweakDB, which takes about 12 seconds. The view says so while it loads. After that, lookups are quick.
  • Filter TweakDB, the funnel, finds records by words of their path, for example quadra type66. Clear TweakDB Filter goes back to the types.
  • Open TweakDB Record…, the magnifier, searches as you type and opens the record you pick. It’s in the command palette too.
  • Click a record to open its record page. Hover buttons on a record: Copy Record Path and New Tweak from This Record….

Records are found by their path, not by the name you see in the game. Finding what you want to change has tips.

Another EDGE tool can claim the records it is made for, as EDGEhack does for quickhacks: a click on such a record then opens it in that tool. Open TweakDB Record… in the right-click menu still opens REDcode’s own page, and Open In… lists every tool that can open the record.

REDcode reads TweakDB as the game ships it, from the game’s files, without any mods. To see what a mod changes in the running game, use REDnode’s live TweakDB reads, from a REDnode app or an assistant connected to REDnode. They aren’t part of REDcode.

The TweakDB view filtered to yinglong, 43 records: record types with their counts and the records under each, one record hovered with its buttons. The record page for Items.Preset_Dian_Yinglong is open beside it.
The TweakDB view

The record page

The record page shows every flat of a record, with its type and value.

  • Record links open the record they name. Back and Forward (Alt+Left, Alt+Right) step through the records you opened.
  • LocKeys (references to the game’s text, LocKey#...) show the text they stand for.
  • Resource paths open the game file they point to.
  • Click a flat’s name to copy its full path, such as Items.money.quality.
  • The filter box narrows the flats by name or value.
  • When another tool claims the record, the page has an Open in button with that tool’s name, such as EDGEhack for a quickhack.
The record page for the weapon Items.Preset_Dian_Yinglong with name typed in its filter box, 29 of 141 flats: each flat with its type and value, and displayName showing LocKey#40613 with its text, Yinglong.
The record page

New Tweak from This Record

New Tweak from This Record…, on the record page or on a record in the view, writes a TweakXL YAML file into your project. It needs a project open. It asks how:

Choice Means Then
Change this record Changes the record itself. Everything in the game that uses it sees the change Writes the file
Clone as a new record A new record that starts as a copy of this one, for a new item. The original is untouched Asks for the new record’s path, and suggests one with your mod’s name in it, such as Items.my_jacket_Preset_Dian_Yinglong

The file goes under your project’s source/resources/r6/tweaks/<mod name>/, opens in the editor, and is selected in the Project view under Resources. When you pack, it goes to the game’s r6/tweaks folder, where TweakXL loads it when the game starts.

Your mod needs TweakXL installed in the game, like any tweak mod; EDGEdeck manages it as a framework.

What the file looks like

This is the file REDcode writes for Change this record on Price.CasualShoes, a small record that multiplies the price of casual shoes:

# Changes to Price.CasualShoes (ConstantStatModifier), written by REDcode.
# Uncomment the flats to change. TweakXL loads this file from r6/tweaks when the game starts.

Price.CasualShoes:
  # value: 1
  # modifierType: Multiplier
  # statType: BaseStats.Price

A line that starts with # is a comment: a note for people, which TweakXL skips. REDcode lists every flat with its current value, but as comments (“commented out”), so the file changes nothing until you choose what to change.

To change a flat, remove the # and the space after it from its line, and type the new value. Keep the two spaces at the start of the line: YAML uses them to know the line belongs to the record. Ctrl+/ adds or removes the # for you.

Price.CasualShoes:
  value: 3
  # modifierType: Multiplier
  # statType: BaseStats.Price

Leave the other lines as comments, or delete them. For Clone as a new record, the file starts with the new record’s path and a line $base: naming the original, then the same commented list.

To try a cloned item in the game, give it to V by its record path: with REDnode, type addItem("Items.my_jacket_Preset_Dian_Yinglong") in REDnode’s Console.

The file Preset_Dian_Yinglong.yaml open in the editor: two comment lines, the record path, then every flat as a comment. The file is selected under Resources, r6, tweaks, my_first_mod in the Project view.
A new tweak

Try it: change a price

This makes every pair of casual shoes three times as expensive. You need a project open, and TweakXL in the game.

  1. In the TweakDB view, press Open TweakDB Record… (the magnifier), type price casualshoes and pick Price.CasualShoes.
  2. On the record page, press New Tweak from This Record… and choose Change this record.
  3. In the file that opens, change ` # value: 1 to value: 3, as shown above. Save with Ctrl+S`.
  4. Close the game if it’s running, and press Pack and Install (the rocket) in the Project view.
  5. Press Run Game, load a save, and look at the price of casual shoes: at a clothing shop, or on a pair V owns, such as the Sunny Ammo synthetic high-tops.
After You should see
Step 1 The record page with three flats: value, modifierType and statType
Step 2 CasualShoes.yaml open in the editor, and selected under Resources in the Project view
Step 4 Under Packed, r6\tweaks\<mod name>\CasualShoes.yaml. The mod installed
Step 5 Casual shoes cost three times as much

Steps 1 to 4 are tested. The price in the game was not checked in REDcode’s own tests: if it doesn’t change, see My mod doesn’t show in the game, and tell us. To undo it, Uninstall from the Project view’s ... menu.

Hover in tweak files

In a .yaml or .tweak file, hover over a record path to see its type and main flats, with a link to its record page. It works once TweakDB is loaded: open the TweakDB view once in a session. Hovering never starts the 12-second load by itself.

Writing .tweak files

TweakXL reads two formats. YAML is what New Tweak writes, and the one to start with. The .tweak format is the game’s own, for people who prefer it. REDcode knows it:

  • syntax colours, bracket matching, and Ctrl+/ to comment lines in and out;
  • snippets for the common blocks: package, record, clone, edit, flat, fk (a link to another record), append, remove, inline and lockey. Type one and press Tab.

The format follows the RED format on the TweakXL wiki. YAML tweaks use VS Code’s built-in YAML support.

Tweak files must sit under r6/tweaks in your project’s Resources, or TweakXL won’t read them. Pack warns about one that sits anywhere else. REDcode packs .tweak files there too, which WolvenKit leaves out: see WolvenKit.

For assistants

An AI assistant connected through redcode-mcp can read TweakDB too: list types and records, read a record or a single flat, and search by words. See Assistants and MCP.

Last reviewed 2026-11-29. Something wrong or missing? Tell us on Discord or open an issue.