Cyberpunk 2077 Modding Tutorial – Beginner Level

Cyberpunk 2077 is undoubtedly better with mods. That’s why I’m here to assist you in creating your own mod.

Before we proceed, it’s important to note that I’m not an expert in coding or modding. Therefore, I can only teach at a very beginner level of modding.

However, this also means that if I can do it, so can you.

The Tools

Firstly, we’ll need some tools for modding the game.

The primary tool is the Cyber Engine Tweak, commonly known as CET, available for download from Nexus Mods or its GitHub page. CET is the core tool enabling game modification.

Moving on to the second tool, or more of a reference: the Categorized All-in-One Command List. This resource is essential for checking the game engine’s IDs, which might differ from the names seen in the game’s user interface.

As for the third tool, it’s optional but could be beneficial. While you can use the basic Notepad from Windows, I recommend using Notepad++ for improved visualization of lines/codes.”

Check out my other tutorial: Step-by-Step Deadfire Modding Tutorial and Tools

 

Installing CET for Cyberpunk 2077

Before diving into modding, installing CET and setting up a hotkey are essential steps.

To install CET, simply place the ‘bin’ folder into your Cyberpunk 2077 game directory. For instance, in my case, the path is: ‘C:\Program Files (x86)\Steam\steamapps\common\Cyberpunk 2077\bin\x64\plugins\cyber_engine_tweaks‘.

Once installed, launch the game. A prompt will appear, allowing you to assign a hotkey to access CET within the game. For instance, I use the ‘~‘ key to open CET.

 

The Numbers

If you already have the tools and set the CET up, let’s get started.

We will start with the easiest first. Meaning, we will just simply change the numbers on some stats.

Let’s say, we want to eliminate recoil and bullet spread when shooting guns. This could easily be achieved by editing the numbers on Immovable Force Cyberware. This is a new Cyberware added in Phantom Liberty that, originally, has two stats: -22 to -35% recoil and -25% bullet spread. To eliminate recoil and bullet spread, we want to change all that stats into 100%.

Let’s streamline the process. Visit the Nexus Mods site for Cyberpunk 2077 and download my mod titled ‘Enhanced Killer Instinct.’ This serves as a helpful template for a quicker and easier setup.

Once downloaded, extract the files and navigate through the folders until you find the ‘init.lua‘ file. Open this file using any text editor or Notepad++.

Inside, you’ll encounter this code snippet:

registerForEvent(‘onInit’, function()
TweakDB:SetFlat(“NewPerks.Cool_Right_Milestone_1_inline5.value”, 0.75)
TweakDB:SetFlat(“NewPerks.Cool_Right_Milestone_1_inline0.floatValues”, {75})

print(‘Enhanced Killer Instinct’)
end)

Keep this file open for now; we’ll return to it shortly.

Next, open the previously downloaded ‘Categorized All-in-One Command List‘ and navigate to the ‘Cyberware‘ tab. Locate the Immovable Force command, which lists different rarities for this Cyberware.

Let’s say you want to edit the highest rarity for this Cyberware. So, choose the last entry for the Immovable force, and you can find this in the command column: ‘Game.AddToInventory(“Items.IconicGunStabilizerLegendaryPlusPlus”, 1)’.

Copy only the ID, which in this case is ‘IconicGunStabilizerLegendaryPlusPlus‘. Launch the game, access CET within the game, and navigate to the ‘TweakDB Editor’ tab.

Paste the copied ID into the Search field of the TweakDB Editor. The search results will display several categories. Expand the ‘gamedataConstantStatModifier_Record‘ category, revealing six entries:

  • Items.IconicGunStabilizerLegendaryPlusPlus_inline3
  • Items.IconicGunStabilizerLegendaryPlusPlus_inline4
  • Items.IconicGunStabilizerLegendaryPlusPlus_inline5
  • Items.IconicGunStabilizerLegendaryPlusPlus_inline6
  • Items.IconicGunStabilizerLegendaryPlusPlus_inline7
  • Items.IconicGunStabilizerLegendaryPlusPlus_inline8

Let’s focus on the first entry, ‘Items.IconicGunStabilizerLegendaryPlusPlus_inline3‘. Click on it to reveal its effect in the game, located under the ‘Items.IconicGunStabilizerLegendaryPlusPlus_inline3.statType‘ line, impacting ‘RecoilKickMin‘.

Below, find the ‘Items.IconicGunStabilizerLegendaryPlusPlus_inline3.value‘ line. Copy this line (CTRL+C), as we’ll need it.

Return to the ‘init.lua‘ file you opened previously. Replace ‘NewPerks.Cool_Right_Milestone_1_inline5.value.value‘ with the line you copied, ensuring the quotation marks remain intact to preserve the code. It should now appear as follows:

registerForEvent(‘onInit’, function()
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline3.value“, 0.75)
TweakDB:SetFlat(“NewPerks.Cool_Right_Milestone_1_inline0.floatValues”, {75})

print(‘Enhanced Killer Instinct’)
end)

To alter the numbers, the original value for that line is ‘-0.35’, representing ‘-35% recoil.’ To eliminate recoil entirely, we’ll change the number to ‘-1,’ which equates to ‘-100%’.

Considering the six lines we previously identified, we’ll replicate this adjustment for the remaining five lines to eliminate bullet spread as well. The final script will resemble this:

registerForEvent(‘onInit’, function()
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline3.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline4.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline5.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline6.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline7.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline8.value”, -1)

TweakDB:SetFlat(“NewPerks.Cool_Right_Milestone_1_inline0.floatValues”, {75})

print(‘Enhanced Killer Instinct’)
end)

Why the numerous lines? That’s because recoil and bullet spread in Cyberpunk 2077 are controlled by various parameters. Recoil is, at least, managed by RecoilKickMin and RecoilKickMax, while bullet spread involves SpreadDefaultX, SpreadMaxX, SpreadAdsDefaultX, and SpreadAdsMaxX. Other stats might not require as many modifications.

 

Installing the Mods

Technically, we’ve already eliminated the recoil and bullet spread, allowing us to move the folder into the game directory. However, some housekeeping tasks remain.

Firstly, remember the folders containing the files? You can rename the ‘EnhancedKillerInstinct‘ folder to anything you prefer, such as ‘NoRecoil‘. This prevents it from being replaced by a mod with the same folder name.

Next, in the 2nd last line of our ‘init.lua‘, we still see ‘print(‘Enhanced Killer Instinct’)‘. Change it to ‘print(‘No Recoil’)‘ to easily identify this mod in the Console Command when multiple mods are installed.

Once done, install it into the game by copying and pasting the ‘bin‘ folder, containing our ‘NoRecoil‘ folder, into the game directory. For instance, the mod’s directory should resemble: ‘C:\Program Files (x86)\Steam\steamapps\common\Cyberpunk 2077\bin\x64\plugins\cyber_engine_tweaks\mods\NoRecoil‘.

Remember, while the effect is implemented, the UI won’t reflect these changes. We’ll tackle that in the next step.

Check out my other tutorial: Dying Light 2 Modding Tutorial

 

The UI

To alter the UI, access the ‘IconicGunStabilizerLegendaryPlusPlus‘ in the TweakDB Editor search box. Navigate to ‘gamedataGameplayLogicPackageUIData_Record.’

Under this category, locate ‘Items.IconicGunStabilizerLegendaryPlusPlus_inline9‘ and expand it to reveal ‘Items.IconicGunStabilizerLegendaryPlusPlus_inline9.floatValues.’ Within this entry, there will be two items that require modification.

Returning to our ‘init.lua‘ file, focus on this line:

TweakDB:SetFlat(“NewPerks.Cool_Right_Milestone_1_inline0.floatValues”, {75})

Change it into this:

TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline9.floatValues”, {100,100})

Note the distinction from previous lines: the values are enclosed within curly brackets. This formatting is crucial for the UI changes to take effect. Omitting the curly brackets will result in the UI remaining unchanged.

Ultimately, the updated ‘init.lua‘ file will resemble this:

registerForEvent(‘onInit’, function()
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline3.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline4.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline5.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline6.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline7.value”, -1)
TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline8.value”, -1)

TweakDB:SetFlat(“Items.IconicGunStabilizerLegendaryPlusPlus_inline9.floatValues”, {100,100})
print(‘No Recoil Loaded’)
end)

 

Let’s Get a Bit More Complicated

After we’ve mastered altering simple numbers and the UI, what if we aim to modify certain aspects without numerical values?

Consider the Onslaught perk. By default, it’s limited to LMG weapons only. But what if we want it to function with every type of gun?

To tackle this in a separate mod, we’ll create different folders mimicking the same structure as before, each containing an ‘init.lua‘ file. I usually just copy another CET mod and rename the relevant folder to make it easier and faster. For example, I copy and paste the “NoRecoil” folder from earlier in the same directory to create the “NoRecoil-Copy” folder, then change the file name to “Onslaught All Weapons.”

Once the new folder with its ‘init.lua’ file is set up, we revisit the Categorized All-in-One Command List. This time, we navigate to the Progress tab and search for ‘Onslaught.’

Similar to our previous approach, we extract the ID for this perk—’Body_Master_Perk_2‘—and paste it into the TweakDB Editor in-game.

Here comes the complexity: we need to analyze each entry and make some deductions. Luckily, the option we seek isn’t too far from the top, located within the ‘gamedataApplyEffectorEffector_Record‘ category.

Examining ‘NewPerks.Body_Master_Perk_2_inline3.prereqRecord,’ we find the condition ‘Prereqs.LMGHeldPrereq,’ indicating that the perk is activated by holding an LMG weapon.

Our goal? To make this perk universally active, irrespective of the held weapon. To achieve this, click the downward arrow beside the value, search for ‘prereqs,’ and select ‘Prereqs.AlwaysTruePrereq‘ since we want it permanently active.

In our new ‘init.lua‘ file, we adopt the same approach as in the previous mod. However, because the value isn’t numerical, we encase the new value in quotation marks. In this case, it appears as follows:

registerForEvent(‘onInit’, function()
TweakDB:SetFlat(“NewPerks.Body_Master_Perk_2_inline3.prereqRecord”, “Prereqs.AlwaysTruePrereq”)

print(‘Onslaught All Weapons’)
end)

It’s important to note that not all conditions and stats are accessible in the TweakDB.

To address these scenarios, you’d need a deeper understanding of modding, which exceeds what I can teach. As mentioned, I’m not an expert in this field.

Nevertheless, many values and conditions can be modified using this method to enhance the game.

A helpful tip is to experiment by changing values directly in the TweakDB Editor within the game itself before creating folders and ‘init.lua‘ files. However, remember to reload the game after making changes to verify if they are effective.”

 

Setup CET Commands and Hotkeys

As a bonus, in the last section of this tutorial, I could also teach you how to make a hotkey for CET commands. Let’s say we want to slow the game, every time we press the right-click button.

Begin by crafting a new mod folder that houses another ‘init.lua‘ file. Rename this folder ‘SlowMo.’

Now, open the new ‘init.lua‘ and copy and paste the entire section below:

function slowmoKeybind()
TS = Game.GetTimeSystem() TDA = TS:IsTimeDilationActive() if TDA == false then TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:SetTimeDilation(CName.new(), 0.2) print(” – SLOW THE WORLD AROUND YOU: ON”) else TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:UnsetTimeDilation(CName.new()) print(” – SLOW THE WORLD AROUND YOU: OFF”) end
end

registerInput(“Slowmo”, “Slow the World Around You”, function()
slowmoKeybind()
end)

function SlowmoToggleKeybind()
TS = Game.GetTimeSystem() TDA = TS:IsTimeDilationActive() if TDA == false then TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:SetTimeDilation(CName.new(), 0.2) print(” – SLOW THE WORLD AROUND YOU: ON”) else TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:UnsetTimeDilation(CName.new()) print(” – SLOW THE WORLD AROUND YOU: OFF”) end
end

registerHotkey(“SlowmoToggle”, “SlowMo Toggle”, function()
SlowmoToggleKeybind()
end)

Now, once you’ve placed the ‘SlowMo‘ folder inside the game directory alongside other mods we created earlier, run the game. If not, move the folder there first.

Upon opening the game, access CET and navigate to the ‘Bindings’ tab. Here, you’ll find two entries: ‘Slow the World Around You‘ and ‘SlowmoToggle.’

Select the box next to ‘Slow the World Around You‘ and press the right-click button on your mouse. The box should display ‘Mouse RB.’ Click ‘Save‘ at the bottom and close CET.

Test this by pressing the right-click button in the game, not in the menu. If you’re holding a gun and aiming (since right-click is the aiming button), the world will slow down. You can choose a different key if you prefer.

Now, what’s the purpose of ‘SlowmoToggle’? It serves two functions. Firstly, the previous method only slows time while the button is pressed. ‘SlowmoToggle’ makes it toggleable.

Set this up by accessing CET, assigning ‘SlowmoToggle’ to a key like ‘F1,’ and test it in the game. Pressing ‘F1’ will slow down time, and it remains slowed until you press ‘F1’ again.

The second function of ‘SlowmoToggle’ acts as a failsafe. If, by closing a message with the right-click, you’re stuck in slow motion, press ‘SlowmoToggle’ to revert to normal speed. This command detects the time condition: pressing it during normal speed slows time, and during slowed time, it reverts it back.

But why use both methods? The ‘Hotkey‘ caveat requires pressing the exact button(s). You can’t press any other button while using the ‘Hotkey’ method, making it less intuitive during combat. That’s why I use two methods.

Interested in assigning other commands/functions to hotkeys? Open the ‘Categorized All-in-One Command List‘ and copy exact codes, replacing the time-slowing lines with other commands and changing some words.

For instance, if you want to create an ‘Open Fast Travel Menu Everywhere‘ command, follow this example:

Replace:

function slowmoKeybind()
TS = Game.GetTimeSystem() TDA = TS:IsTimeDilationActive() if TDA == false then TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:SetTimeDilation(CName.new(), 0.2) print(” – SLOW THE WORLD AROUND YOU: ON”) else TS:SetIgnoreTimeDilationOnLocalPlayerZero(true) TS:UnsetTimeDilation(CName.new()) print(” – SLOW THE WORLD AROUND YOU: OFF”) end
end

registerInput(“Slowmo“, “Slow the World Around You“, function()
slowmoKeybind()
end)

With:

function FastTravelKeybind()
UIS = Game.GetUISystem() UIS:RequestFastTravelMenu()
end

registerInput(“FastTravel“, “Fast Travel from Anywhere“, function()
FastTravelKeybind()
end)

Change the red text with your preferred wording and the green text with the new command.

 

Closing

Finally, I hope this tutorial is detailed enough to assist any beginner in modding Cyberpunk 2077. If you’re aiming for the more complicated mods or ones that CET can’t handle, unfortunately, I can’t offer guidance on those right now. Maybe, if I’m not that stupid and lazy, I could make another tutorial for the more difficult ones. Happy modding!

Yabes Elia

Yabes Elia

An empath, a jolly writer, a patient reader & listener, a data observer, and a stoic mentor

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.