Old Copycat swap speed, mod try fail...
Avatar

I am trying to make an swap speed mod for copycat, but i wanted to remove the "new swap speed on auto reload" to not being OP;
problem is i coded in normal BLT in the old days, i tried to make some codes, didnt work, the tried to chat GPT for help, didnt work.
could somone help/ make this mod?

i was hopping i at least made an mod to make the old swap speed always on, the try to work upwards in removing the new swap...
but could not do nothing

Info
Avatar
  • All BLT mods are compatible with SuperBLT. If something broke, it is not likely to be caused by the change to SuperBLT. Your skills will carry over to SuperBLT just fine.

  • Don't use ChatGPT for code. It is a complete waste of time and energy and produces junk for any remotely complex task.

  • If you want to remove an upgrade, remove its definition id from the upgrades table in the perk deck's definition in skilltreetweakdata. If you want to add an upgrade, then insert its definition id into the upgrades table instead.

  • If you want to tweak the numbers of an upgrade (like to buff or nerf something), then chances are, you can just change the numbers for that upgrade in upgradestweakdata. There are only a few specific upgrades that place relevant variables outside of this file, and I'm pretty sure this is not one of them.

Avatar

I made one from Scratch too, using an Idea from the time that i've done an mod that added 20% health more on Grinder If you have the time i Will place It here, showing It , i can sendo tô you in another way, and i Will try again this night

Avatar

But basically what i did in the mod that i did yesterday It
I changed upgrades to 3.2 "weapons_passive...

It haves weapons_passive_swap speed 1 ( rougue uses It, and 2 that i dindnt find anything that used It.

It dindnt change rougue, and the Hook was the same used in a mod , that as i said on top, that added life in Grinder

I tried to add more skills, like the passives swaps, life, Dodge, armor, health. But none did work

Avatar

Mod.Txt

{
"name" : "Old Copycat Swap Speed ",
"description" : "faster swap.",
"author" : "Ash",
"version" : "1.0",
"blt_version" : 2,
"hooks": [
{
"hook_id": "lib/tweak_data/upgradestweakdata",
"script_path": "skills.lua"
},
{
"hook_id": "lib/tweak_data/skilltreetweakdata",
"script_path" : "tree.lua"
}
]
}

Avatar

skills.lua, (dont mind the numbers, i was testing to feel diference.... but nothing) first one is rougue(values.weapon.passive_swap_speed_multiplier_1) second one is values.weapon.passive_swap_speed_multiplier_2

local data = UpgradesTweakData._init_pd2_values
function UpgradesTweakData:_init_pd2_values()
data(self, tweak_data)

--Copycat--
    self.values.weapon.passive_swap_speed_multiplier = {
	12.2,
	3.2
	}
}

end

Avatar

tree.lua

local skill_data = SkillTreeTweakData.init

function SkillTreeTweakData:init(tweak_data)
skill_data(self, tweak_data)

--Workaround
local mrwi_specialization = {
{
cost = 200,
texture_bundle_folder = "mrwi",
desc_id = "menu_deck23_1_desc",
short_id = "menu_deck23_1_short",
icon_atlas = "icons_atlas",
name_id = "menu_deck23_1",
upgrades = {
"player_primary_reload_secondary_1",
"player_secondary_reload_primary_1",
"weapon_passive_swap_speed_multiplier_2"
},
icon_xy = {
0,
0
},
multi_choice = deck1_multi_choice
},
deck2,
{
cost = 400,
texture_bundle_folder = "mrwi",
desc_id = "menu_deck23_3_desc",
short_id = "menu_deck23_3_short",
icon_atlas = "icons_atlas",
name_id = "menu_deck23_3",
upgrades = {
"player_headshot_regen_health_bonus_1"
},
icon_xy = {
1,
0
},
multi_choice = deck3_multi_choice
},
deck4,
{
cost = 1000,
texture_bundle_folder = "mrwi",
desc_id = "menu_deck23_5_desc",
short_id = "menu_deck23_5_short",
icon_atlas = "icons_atlas",
name_id = "menu_deck23_5",
upgrades = {
"player_dodge_ricochet_bullets"
},
icon_xy = {
2,
0
},
multi_choice = deck5_multi_choice
},
deck6,
{
cost = 2400,
texture_bundle_folder = "mrwi",
desc_id = "menu_deck23_7_desc",
short_id = "menu_deck23_7_short",
icon_atlas = "icons_atlas",
name_id = "menu_deck23_7",
upgrades = {
"temporary_mrwi_health_invulnerable_1"
},
icon_xy = {
3,
0
},
multi_choice = deck7_multi_choice
},
deck8,
{
cost = 4000,
texture_bundle_folder = "mrwi",
desc_id = "menu_deck23_9_desc",
short_id = "menu_deck23_9_short",
icon_atlas = "icons_atlas",
name_id = "menu_deck23_9",
upgrades = {
"player_passive_loot_drop_multiplier"
},
icon_xy = {
0,
1
},
multi_choice = deck9_multi_choice
},
name_id = "menu_st_spec_23",
dlc = "mrwi_deck",
desc_id = "menu_st_spec_23_desc",
category = "versatile"
}

table.insert(mrwi_specialization[1].upgrades, "weapon_mrwi_primary_reload_swap_secondary_1")
table.insert(mrwi_specialization[1].upgrades, "weapon_mrwi_secondary_reload_swap_primary_1")

mrwi_specialization[1].desc_id = "menu_pxp4_deck23_1_desc"
mrwi_specialization[1].short_id = "menu_pxp4_deck23_1_short"

end

Avatar

@ashdavis The problem with your copycat edit is that you're editing your own local variables, not the perk deck data that's in the game. The perk deck definitions are in self.specializations in skilltreetweakdata. You need to access and edit those- those, you can set to a local variable for easy access, because of how tables work in Lua.
eg. (assuming this is inside the SkillTreeTweakData.init hook)

local crewchief_deck = self.specializations[1] -- get the first perk deck
local card3 = crewchief_deck[3] -- get the third card from that deck
for i=#card3.upgrades,1,-1 do -- instead of using pairs or ipairs, iterate through the upgrades array backwards (largest to smallest)
    -- so that removing upgrades doesn't disrupt the iteration order

	table.remove(card3.upgrades,i) -- remove the upgrade in this iteration; repeats through the whole list, so all upgrades will be removed
end

removes all the upgrades from the third card of Crew Chief (the first perk deck)

Avatar

@offyerrocker
Kay thanks!!!

but it should at least had the extra effect in placed, no?

Avatar

@ashdavis Your code wasn't doing anything to the game because you pointed it to a new table that you made- it was copied from the game, but it has no link to the game's code.

You had a line that said: table.insert(mrwi_specialization[1].upgrades, "weapon_mrwi_secondary_reload_swap_primary_1")
but mrwi_specialization[1] is a local variable that you declared yourself. If you want to edit the perk deck in the game, you need to point it to the perk deck in the game.

Is that what you mean?

14 395