๐Ÿ‘ชChanging NPCs - Tweak edit (REDMod)

Changing NPC's info on scan and its archetype.

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.

Prerequisites

Preparation

Since we are using REDmod, we need to structure our project accordingly.

  1. Open your in the Windows Explorer.

  2. Find the folder mods. If it doesn't exist, create it.

  3. Inside mods, create a folder for your custom mod โ€” call it however you want. For this tutorial, we will name ours "example mod"

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

  5. Copy the following template and paste it into your empty file:

{
  "name": "YOURMODNAME",
  "version": "1.0",
  "customSounds": []
}
  1. Inside your mod folder, create the following nested folders: tweaks\base\gameplay\static_data\database\characters\npcs\records\quest\main_characters

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

- example mod
    info.json
  - tweaks
    - base
      - gameplay
        - static_data
          - database
            - characters
              - npcs
                - records
                  - quest
                    - main_characters
                        primarycharacters.tweak

Editing the .tweak file

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:

Panam's full character record (as of 2.02

Panam : aldecaldos_grunt2_sniper2_sor22_wa_elite
{
	priority = "SpawnableObjectPriority.Quest";
	tags += 
	[
		"Invulnerable"
	];
	entityTemplatePath = "base\quest\primary_characters\panam.ent";
	reactionPreset = "ReactionPresets.NoReaction";
	isBumpable = false;
	displayName = "LocKey#34412";
	fullDisplayName = "LocKey#34413";
	CName voiceTag = "panam";
	baseAttitudeGroup = "panam";
	archetypeData = "ArchetypeData.SniperT2";
	sensePreset = "Senses.panam_sniper_relaxed";
	relaxedSensesPreset = "panam_sniper_relaxed";
	alertedSensesPreset = "panam_sniper_alerted";
	combatSensesPreset = "panam_sniper_combat";
	skipDisplayArchetype = true;
	fk< StatModifier >[] statModifiers = 
	[
		{
			statType = "BaseStats.BurningImmunity";
			modifierType = "Additive";
			value = 1;
		} : ConstantStatModifier
	];
	primaryEquipment = 
	{
		equipmentItems = 
		[
			{
				item = "Items.Preset_Grad_Panam";
				equipSlot = "AttachmentSlots.WeaponRight";
				onBodySlot = "AttachmentSlots.ItemSlotGenericRanged";
				equipCondition = 
				[
					"WeaponConditions.SniperPrimaryWeaponSniperEquipCondition"
				];
				unequipCondition = 
				[
					"WeaponConditions.SniperPrimaryWeaponSniperUnequipCondition"
				];
			} : NPCEquipmentItem, 
			{
				item = "Items.Preset_Base_Copperhead";
				equipSlot = "AttachmentSlots.WeaponRight";
				onBodySlot = "AttachmentSlots.ItemSlotGenericRanged";
				equipCondition = 
				[
					"WeaponConditions.SniperPrimaryWeaponRangedEquipCondition"
				];
				unequipCondition = 
				[
					"WeaponConditions.SniperPrimaryWeaponRangedUnequipCondition"
				];
			} : NPCEquipmentItem
		];
	};
	statModifierGroups += 
	[
		"NPCStatPreset.VeryHighHealth", "NPCStatPreset.PanamSniperDamage", "NPCStatPreset.FollowerDamageAgainstBosses"
	];
	savable = true;
	bountyDrawTable = 
	{
		bountyChoices = 
		[
			{
				bountySetter = "Factions.NCPD";
				transgressions = 
				[
					{
						localizedDescription = "LocKey#48952";
					}
				];
				reward = "BountyReward.bounty_panam";
			}
		];
	};
}

Properties

We will take a look at some of the properties.

property namevalue in Panam's templateexplanation

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)

Changing an NPC's faction

All existing factions are defined in the following file:

Cyberpunk 2077\tools\redmod\tweaks\base\gameplay\static_data\database\factions\factions.tweak

To change an NPC's affiliation, you will need to add the following line to their template:

fk< Affiliation > affiliation = "Factions.FACTION_NAME_HERE"

Results

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.

Last updated