This is a tutorial created with new modders in mind. It's not optimal; it's slow, tedious, and redundant. However, it was the only way I could understand how to make YAML tweaks.
This is a tutorial created with new modders in mind. Some terms may not be correct, but you will be able to create a functional tweak with this method. It's not optimal; it's slow, tedious, and redundant. However, it was the only way I could understand how to make YAML tweaks.
Take into consideration that I'm not an expert, but I've helped a lot of people to start on tweaks and this knowledge will allow you to, at least, navigate more easily at first.
For this tutorial, you need:
Visual Studio Code (or Notepad++, but the tutorial will show you VSCode)
A bookmark for YAMLlint (you can check your YAML files for indentation errors)
Patience, lots of patience. Please, read this guide completely and re-read if needed.
After downloading and installing all the requirements (and yes, SAVE that bookmark, trust me), let's start with the basics.
YAML tweaks are like a decompiled
version of the .tweaks files that you can find inside the REDmod folder. YAML format is easier to read and understand, but have some differences with REDmod syntax. You can also try and make tweaks using the REDmod syntax inside TweakXL, but personally I have no experience with that yet.
There are some concepts you need to understand before starting:
Indentation organizes code using blank spaces, as shown below:
In the past, using indentation wasn't mandatory and mostly used by pro coders to order their files as a good practice. However, for YAML files, indentation is MANDATORY. If you indent wrong, your mod won't work, simple as.
The best way to indent, in my opinion, is using 2 blank spaces (pressing space bar
twice) to make indentations.
"But what about just using tab?" you may think. DON'T. DON'T USE TAB FOR INDENTATION. Using tab for indentation could cause issues, because not all text editors interpret tab in the same way.
Using double space will guarantee your file will keep the same structure everywhere. It even feels natural and VSCode will put nice and useful lines to show your indentation.
Think of records as unique containers grouping multiple properties — which can be other records, or #flats.
Record names must be unique!
You can't create two records with the same name — they will overwrite each other!
You can learn more on psiberx's github readme, or head over to Types of tweak records
Flats are values. They can be numbers (integers <like 1 or 2> or floats <like 1.5 or 2.3>), characters (even entire words) or boolean (True or False). They can be more complex things, for that I suggest you to read what Psiberx has to say about this.
This is where most new modders make mistakes.
Inline is a way to create records without nesting them under a record name, but coded and nested directly in the property of another record. Yeah, I know, it's hard to understand. Let's do some examples.
This example is a named record with other named records nested on it:
This is the same as above but with inline coding:
When to use inlines or whole named records? That depends on your project. Sometimes creating a record with a UNIQUE name will save you more space and work than creating it on inlines every single time. Sometimes it's the other way around. It's ok to even not using inlines at all if you aren't comfortable with them.
Later in this tutorial, you'll see that some records are named to something like this RecordName_inline0
, RecordName_inline1
, etc. Those inlineX
names are created automatically for easier reading and the number can change without ANY warning on every single game update. The number generated will be dependent on the position of the inline record inside another record. Inline means literally "this is IN LINE X".
NEVER useinlineX
records as base in your items, that will only create headaches for the future you. Using inlineX
records as base for your items is a BAD PRACTICE and could prevent your mod from working on ANY update.
Please, DON'T USE inlineX
RECORDS AS BASE FOR YOUR OWN RECORDS.
Let me explain it better with more examples:
In this example, this a record using inlines in update 2.1
In this example, is the same record, but on update 2.2
In this example, MyBigRecord_inline0
will have a completely different value depending on the update.
In update 2.1 the value1
and related to BaseStats.ExampleBaseStat1
, but then in update 2.2 the value will be 8
and related to BaseStats.ExampleBaseStat3
.
If you used MyBigRecord_inline0
in your item code, your item would stop working as intended. It doesn't matter that popular modders do this, DON'T USE INLINES AS BASE FOR YOUR RECORDS.
Check psiberx's YAML bible about inline records.
You'll see this word a lot inside TweakDB. Prereqs means Prerequisites
and, as the name states, is used to check that certain conditions are met to start, for example, something like an Effector
.
You can find more about this under Types of tweak records -> #prereq, or find a full list under Cheat Sheet: Prereqs.
Those are records that are used to be activated under certain conditions depending on their Prereqs. So Effector means "Something that activates some Effect". That effect could be almost anything, from stats to visual effects.
You can find more about this under Types of tweak records -> #effector
Tweaks and Scripts are 2 sides of the same coin.
On its own, a tweak does nothing — the engine makes use of the records via scripts.
Think of a script as the instruction, and a tweak as the definition. That way, a script doesn't actually need to understand what it's doing, and all the logic is neatly encapsulated.
For example: Take 500g (the instruction) of Items.Flour
(the definition).
In this tutorial we will use Wolvenkit Tweak Browser. There are many ways of Browsing the tweak database, but you can save them for later, when you are more advanced (or feeling bold).
Having clarified some very basic concepts, let's start this guide:
Let's say you want to do a new item that have the Thrusters mechanics from Rogue Boots that you use in certain endings.
What's the best approach to this? Using those Thrusters boots logic in your item.
Unfortunately, most items don't share the same internal name as the name you can see in the description. The best way I've found to deal with this, is going to the community Cyberpunk wiki and looking for your specific item, in this case, those cool Boots.
Internally, that item is called q115_thrusters
. Now that we know that, we can search the item in Wolvenkit Tweak Broswer.
Read Spawn Codes (BaseIDs/Hashes) for how to find an item's unique ID.
Open the Tweak Browser tab and pin it. It should look like this:
Paste q115_thrusters
into the search bar and click on Filter...
and activate Show inline records
. This should look like this:
Do a right click into the first item and select Add TweakXL Override
. Do the same for the inline0
and inline1
, but ignore the rogue
and weyland
versions, we don't need that, just the first 3 results shown in this image:
Those tweaks should be stored in the left panel inside these folders in the image:
Put the cursor above the YAML files and click on the yellow folder to open the folder containing those tweaks in Windows Explorer:
Open the 3 YAML files in VSCode:
Now, from the latest inline (inline1
in this example), copy the whole contents and paste it below the anterior record (in this case, inline0
):
Now, copy the mixed contents and paste them into the base record (the item on this case). This is how it should look:
Those records below the main item record (inline0
and inline1
) are the ones that manages the Thrusters logic/mechanics.
You can add them to almost any item, but you'll have to research on your own how to do it on each case. Not all items needs the effects nested in the same places, and not all effects needs to be nested like this.
ALWAYS FIND A WORKING EXAMPLE IN THE BASE GAME IF YOU ARE NEW ON THIS AND IF YOU WANT TO KEEP YOUR SANITY. Trust me.
Now, the importance of VSCode in this tutorial. VSCode has an incredibly powerful and useful highlighting system for text by just doing double click
on ANY WORD. With this system, you'll understand how things are nested on ANY item you find. Look at this example:
If you pay attention to the miniature code on the right side and the scroll bar, there is a highlight that will point you exactly where things are nested:
If you move over that highlight, you will finally have your answer.
This tutorial logic can be applied to ANYTHING that can be found in TweaksDB, how many inline records you are going to find will depend on each particular case. I picked a simple example to not extend this too much, but some items have more than 30 inlines... You are warned.
I've tested this method with many users, and all of them have been able to create their mods. This is not a way to do all items you have in mind, because is extremely inefficient, but once you understand how things are nested and how records are structured, you'll have a better time creating items afterwards.
I hope this will be helpful for you.
Thank you for reading, and good luck in your projects!
REMEMBER TO BOOKMARK THE PSIBERX YAML TWEAK BIBLE
You can also use this online tool to see if your YAML file has errors
Open Wolvenkit and (for example, I have one project dedicated to research called TEST, which I use every time I need to search something on Wolvenkit), then open it.
Changing NPC's info on scan and its archetype.
Created & Published: October 19 2023 by Game Version 2.01
This tutorial will show you how to use REDmod to edit an NPC's TweakDB record, changing their info when scanning them with your Kiroshis. In this tutorial we will edit Panam
If you want to learn more about the Tweak database, check TweakDB: Game database.
the free REDMod DLC (you can get it here)
An IDE to edit .json files. I prefer Visual Studio Code, but you can also use Notepad++
Since we are using REDmod, we need to structure our project accordingly.
Open your in the Windows Explorer.
Find the folder mods
. If it doesn't exist, create it.
Inside mods
, create a folder for your custom mod — call it however you want. For this tutorial, we will name ours "example mod"
Inside your mod folder, create an empty text file with the name of info.json
. This file will tell Cyberpunk how to load your mod.
Copy the following template and paste it into your empty file:
Inside your mod folder, create the following nested folders:
tweaks\base\gameplay\static_data\database\characters\npcs\records\quest\main_characters
Copy the following file to the folder main_characters
inside your mod directory:
Cyberpunk 2077\tools\redmod\tweaks\base\gameplay\static_data\database\characters\npcs\records\quest\main_characters\primarycharacters.tweak
Your mod folder should now look like this:
To make changes inside, find an NPC with the properties that you want, and copy/paste the values into the record that you want to edit.
Open primarycharacters.tweak in your IDE and search for "Panam
". You will find the following record:
We will take a look at some of the properties.
All existing factions are defined in the following file:
To change an NPC's affiliation, you will need to add the following line to their template:
That's, save your work, deploy your mod and hop in the game to see the results.
If you have any questions, you're welcome to join us on discord.
property name | value in Panam's template | explanation |
---|---|---|
fullDisplayName
Which text is displayed in scan tab?
displayName
Which text is displayed in dialogues and choices?
archetypeData
ArchetypeData.SniperT2
base template (how she fights)
A tutorial on creating a custom blueprint to add additional attachmentSlots to an item
Created: Aug 01 2024 by Berdagon Last documented edit: Aug 01 2024 by Berdagon
This guide will teach you how to create your own blueprint by extending a base game record. At the end, you will have an assault rifle with muzzle, scope, and four mod slots.
A text editor like Notepad++
To learn more about records and flats, check How to YAML: Tweak modding basics -> #records and -> #flats. For the purpose of this guide, it's enough to say that Records can contain other records and flats, whereas flats can only contain values.
A Blueprint is a record of type gamedataItemBlueprint_Record
with the following flat:
rootElement
is a record of type gamedataItemBlueprintElement_Record
.
It has the following flats (properties):
slot
is a record of type gamedataAttachmentSlot_Record.
They have the following properties:
childElements
is an array of records of type gamedataItemBlueprintElement_Record
prereqID
is a record of type gamedataStatPrereq_Record
A blueprint can have 1 rootElement
and each of the gamedataItemBlueprintElement_Record
can have multiple other gamedataItemBlueprintElement_Record
as children
In order for a slot to be usable in the game its parent slot has to already be filled.
We are going to make a custom blueprint that has 4 weapon mod slots for the Power Assault Rifles
At first make a new .yaml
file and name it Items.Base_Power_AR_SMG_LMG_4Mod_Blueprint
(the naming is not important and you can name it whatever you want).
Inside the yaml file, put the following content:
Now we need to define Items.Base_Power_AR_SMG_LMG_4Mod_Blueprint_rootElement
we are going to use Items.Base_Power_AR_SMG_LMG_Blueprint_inline0
as a base for our rootElement
and append two records for our 2 new Mod slots
The 2 new Weapon Mod Element records should be of type gamedataItemBlueprintElement_Record
Here we have to create 2 new prereqIDs
And we will need to create our custom AttachmentSlots
You can check the Cheat Sheet: Attachment Slots, or look up Creating custom AttachmentSlots to make your own.
We are going to create 2 attachmentSlots named
AttachmentSlots.Power_AR_SMG_LMG_WeaponMod3
AttachmentSlots.Power_AR_SMG_LMG_WeaponMod4
Now that all the necessary records are defined, we are going to add this Blueprint to the Weapon record
Items.Base_Power_Assault_Rifle
as its name suggest is the base for power assault rifles so by doing this all the power assault rifles should now have this blueprint
The tweak part of making the blueprint is now over and we can jump in the game and check the records
We are going to use Preset_Ajax_Pimp
as you can see the modSlots are not being shown in the game
For this, we are going to need to do some scripting lets create a new .reds
file in the script folder and name it AR_SMG_LMG_4Slot.reds
We need to wrap multiple functions to make this work, so at first we are going to add a function that has our AttachmentSlots in it
And another function that checks for these slots
Now we wrap these 3 functions and add our slots to their return value
If we check the game now we can see that our slots are added but they are not shown correctly
We need to fix the slot Icons the tooltip names and the slot name
For the icons we wrap these 2 methods you can also use custom icon paths
For the tooltip names we are going to wrap this method
And for slot name
Now the UI is almost complete now we have to register these 2 slots to all the mods that can be equipped on the other 2
And now its done all of our power assault rifles now have 4 mod slots
How to manipulate vendor inventories
Published: ??? by Last documented update: Jan 28 2024 by
To find a list of all vendor IDs, check Cheat Sheet: Vendor IDs
Your mod will be one or multiple .yaml
files under r6/tweaks
. If you want to release your mod on Nexus, we recommend using WolvenKit Projects and creating the files under the #resources folder.
Courtesy of Neurolinked and psiberx. For more context, read up on Discord.
Create the following tweak file (a yaml in r6/tweaks/your_optional_subfolder
:
How to change item stats with TweakXL
Last documented edit: Feb 09 2024 by
Changing item stats happens by making changes via TweakXL or REDmod in the TweakDB: Game database.
You can find more information about this on the TweakXL github's wiki page.
You can change tweaks with
REDMod (see Changing NPCs - Tweak edit (REDMod))
Cyber Engine Tweaks (see Scissor's tutorial (Google Doc))
TweakXL (see Changing vendor inventory)
If possible, you should stick to TweakXL for editing tweaks.
If you want to safely delete a record property, set its value to None.