Descline 51 and 66 in SkillDesc.txt

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
User avatar
mmpx222
Junior Member
Paladin
Posts: 154
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Descline 51 and 66 in SkillDesc.txt

Post by mmpx222 » Sun Jun 21, 2020 8:22 am

Is there a difference between descline 51 and 66 in SkillDesc.txt? From my experiments, both seem to do the same thing: given a string with "%d" in S1, the descline replaces %d with the value of C1.

(Following the convention laid out by the SkillDesc.txt guide, I'm using S1 to refer to desctextaX, C1 to desccalcaX, and so on.)

For example, given
  • S1 = %d%% chance to attack
  • C1 = 28
Both descline 51 and 66 will show "28% chance to attack".

In vanilla LoD, descline 51 is used by Barbarian/Assassin weapon mastery passives to show critical strike chance, while descline 66 is used by Amazon arrow skills to display elemental damage conversion percentage. However, the two desclines seem to function exactly the same. Is there a difference between the two?
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

User avatar
Cypress
Moderator
Champion of the Light
Posts: 446
Joined: Fri Dec 01, 2017 2:08 am

Re: Descline 51 and 66 in SkillDesc.txt

Post by Cypress » Mon Jun 22, 2020 12:36 am

The only difference I can see is that they produce different numbers if you add in more instances of %d%%. I have no idea what formula they are using for generating each instance of %d%%, but it seems like it is somewhat a function of C1 (although some of the early instances of %d%% are always identical for descline51; notably, it produces C1%, 3%, 128%, 0%, then starts varying based on C1; for descline66, it produces C1%, 1695492%, C1%, then varies based on C1). I also noticed that the 16th and on iteration of %d%% in descline 51 actually causes the description to lag and fluctuate; even just taking a screenshot causes it to have issues. It also seems like the numbers vary based on the skill it is placed onto; placing it onto Axe Mastery produced the previously described results, and placing them onto Poison Explosion resulted in descline 51's numbers rapidly fluctuating and causing a crash on upgrading.

And thinking about it, it seems that descline51's third %d%% is equal to the ID of the respective skill which is kind of bizarre. It spit out a 128% for Axe Mastery (ID=128) on the third %d%% and 83% for Poison Explosion (ID=83) on its third %d%%. So I guess these values are at least partially being read from various parts of the txt files, but I have no idea where it is getting the other values from.

Regardless, I can't think of a single reason anyone would want to make use of any of these differences as they seem largely uncontrollable aside from using the first instance of %d%%. In summation, I don't see any significant differences between the two.

User avatar
mmpx222
Junior Member
Paladin
Posts: 154
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Re: Descline 51 and 66 in SkillDesc.txt

Post by mmpx222 » Fri Jun 26, 2020 4:42 pm

Cypress wrote:
Mon Jun 22, 2020 12:36 am
The only difference I can see is that they produce different numbers if you add in more instances of %d%%. I have no idea what formula they are using for generating each instance of %d%%, but it seems like it is somewhat a function of C1 (although some of the early instances of %d%% are always identical for descline51; notably, it produces C1%, 3%, 128%, 0%, then starts varying based on C1; for descline66, it produces C1%, 1695492%, C1%, then varies based on C1). I also noticed that the 16th and on iteration of %d%% in descline 51 actually causes the description to lag and fluctuate; even just taking a screenshot causes it to have issues. It also seems like the numbers vary based on the skill it is placed onto; placing it onto Axe Mastery produced the previously described results, and placing them onto Poison Explosion resulted in descline 51's numbers rapidly fluctuating and causing a crash on upgrading.
Sounds like when you give more format specifiers (e.g. %d) than the hardcoded amount, the game tries to read the values from arbitrary memory locations. Something like a format string attack. This is probably what makes the game unstable (lagging and crashing).
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

Post Reply

Return to “General Mod Making”