Login
Topic: Editing Cnut files (not for modding, just curiosity)
Home › Forums › Battle Brothers: Game Discussion & Feedback › Editing Cnut files (not for modding, just curiosity)
- This topic has 7 replies, 5 voices, and was last updated 5 years, 10 months ago by AdamMil.
-
AuthorPosts
-
21. March 2017 at 16:07 #20729MeteParticipant
I was trying to do some really simple things, like edit the weapon names. I was able to edit the names but looks like your cnut files doesn’t work with string that are bigger than 7 characters? Are the devs obfuscating strings or is this something done by the compiler? I compiled a file I created and I was able to see the full string, doesn’t matter the size.
Just to sane my curiosity, is there a Name = “knife” in the knife.cnut file?
Thanks.
22. March 2017 at 08:36 #20747ZensalinParticipantHi Mete!
I am not a dev, so I can’t answer your initial question, but I want to ask you one!Did you simply rename the files themselfs or did you actually edit them? If so: How/with what did you decompile/edit the scripts?
I’m asking because, if I would be able to read out various things of the scripts (like unique weapon stat ranges, background stat ranges, event info, etc.) I could turn some “guesswork” on the wiki into untouchable facts by reading the data out.
Battle Brothers Wiki (Fanmade)
BreakdownEpiphanies Soundcloud (Game Soundtrack)
It’s-a Me!22. March 2017 at 13:36 #20753MeteParticipantIf you open the cnut files you will be able to identify some string, like “Name”, these string have a prefix and a suffix in the form of:
08 04 N a m e 10
Where the 08 is a “header”, the 04 is the size of the string, the string, and 10 is the end, of course the Name is in hex, so thats how I changed weapons names, the problem is that it only works for strings that are not bigger than 7 characters.
Also, I tried to edit some weapon values, I found that for knife, there are like 9 integers with value 20, and some others with value 25, I tried to compare the address and the characters around these values to the values on other weapons but I couldn’t find a pattern, I will probably do it by trial and error.I just got my hands on NutCracker, but it didnt decompile the cnut files at all. As I said, if I create a cnut file and compile, I can edit the strings, so I guess they are doing something different.
But, I didn’t spend to much time looking at these files, I will probably keep trying when I get some time.
22. March 2017 at 17:08 #20754DanubianParticipantGood luck mate, i really want to mod this game myself too. Its a bit ridiculous modding is where it is now, i really hope this is one of the priorities for the near future.
22. March 2017 at 17:15 #20757SarissofoiParticipantHa. You are exactly in place where I was been few months ago(or even later).
Good luck as I run of mine and achieve nothing.22. March 2017 at 20:54 #20764MeteParticipantHa. You are exactly in place where I was been few months ago(or even later).
Good luck as I run of mine and achieve nothing.Mind sharing your discoveries?
22. March 2017 at 22:43 #20765SarissofoiParticipantHa. You are exactly in place where I was been few months ago(or even later).
Good luck as I run of mine and achieve nothing.Mind sharing your discoveries?
Nothing really.
The files are compiled and I was out of ideas how to break them. Tried Nut cracker and some other programs with no to zero effect.13. February 2019 at 12:50 #23956AdamMilParticipantI gave it a try. There are multiple layers of DRM and deliberate corruption/ciphering of the CNUT files to make them hard to read; clearly the developers went out of their way to prevent people from reading the scripts. But after 8 or 9 hours I got it. Here’s the content of that knife.cnut file you mentioned:
[code]
this.knife <- this.inherit(“scripts/items/weapons/weapon”, {
m = {},
function create()
{
this.weapon.create();
this.m.ID = “weapon.knife”;
this.m.Name = “Knife”;
this.m.Description = “A short knife, not made for combat.”;
this.m.Categories = “Dagger, One-Handed”;
this.m.IconLarge = “weapons/melee/knife_01.png”;
this.m.Icon = “weapons/melee/knife_01_70x70.png”;
this.m.SlotType = this.Const.ItemSlot.Mainhand;
this.m.ItemType = this.Const.Items.ItemType.Weapon | this.Const.Items.ItemType.MeleeWeapon | this.Const.Items.ItemType.OneHanded;
this.m.IsDoubleGrippable = true;
this.m.AddGenericSkill = true;
this.m.ShowQuiver = false;
this.m.ShowArmamentIcon = true;
this.m.ArmamentIcon = “icon_knife_01”;
this.m.Value = 30;
this.m.Condition = 32.00000000;
this.m.ConditionMax = 32.00000000;
this.m.RegularDamage = 15;
this.m.RegularDamageMax = 25;
this.m.ArmorDamageMult = 0.50000000;
this.m.DirectDamageMult = 0.20000000;
}function onEquip()
{
this.weapon.onEquip();
this.addSkill(this.new(“scripts/skills/actives/stab”));
this.addSkill(this.new(“scripts/skills/actives/puncture”));
}function onUpdateProperties( _properties )
{
this.weapon.onUpdateProperties(_properties);
}});
[/code]I peeked at a bunch of other files, too. Interesting stuff there. It’s possible to figure out the most efficient backgrounds to hire now since you can read the stats directly out of the scripts…
-
AuthorPosts
- You must be logged in to reply to this topic.