• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Changing fist/axe/club/sword to one/two handed (TFS 1.4.1)

  • Thread starter Deleted member 210450
  • Start date
D

Deleted member 210450

Guest
Hi.

I'd like to delete Fist, Axe, Club, Sword Fighting and replace it with One-Handed Fighting & Two-Handed Fighting. I don't know C++, but due to humble programming knowledge, I imagine how complex changes are needed to make it done.

I wonder if is some simpler way to do it. While googling it, I found some tricky way to delete all skills except e.g. swords and change all weapons to sword type. So, theoretically i can hide/delete Fist & Club Fighting from client, rename Sword Fighting to One-Handed, and Axe to Two-Handed, and each 1h weapon change to sword, and 2h to axe.
But will it work? What "holes" can it make? Obviously, I will have to change details too, like Sword Ring to One-Handed Ring etc. But I still think it can't be so easy.

Even if it is enough, I gotta change all texts, like "You advanced in Sword fighting" etc., it requires modifying source code anyway, doesn't it? Is chaning name of skill easy at all? Change it on client-side is enough, isn't it?

How many, and what are they, parts of code use weapon types and weapon fighting skills?

If not that way, what are the other options? I can't imagine, with my skills in C++, modyfing all skills-related source code by myself (and not gonna pay for it, because im just having fun making an ot, don't really believe i will finish).
 
Last edited by a moderator:
You can do what you said without any edits to the server or client but yes the strings would be wrong. Edit items.xml and make all one handed weapons sword and all two handed weapons club skill. You can rename sword ring and club ring in items.xml too.

To fix the strings;
On the server, you would have to edit the function addSkillAdvance in player.cpp to change the advance message strings.
On the client, you would need to edit the strings for the skills shown in the skills window and ideally hide the axe skill.

This solution is mildly hacky but it works and requires minimal effort.
 
You can do what you said without any edits to the server or client but yes the strings would be wrong. Edit items.xml and make all one handed weapons sword and all two handed weapons club skill. You can rename sword ring and club ring in items.xml too.
Still, I have feeling I'm missing something. Skill rings was just first, obvious thing, but I wonder what other complications could it make.

To fix the strings;
On the server, you would have to edit the function addSkillAdvance in player.cpp to change the advance message strings.
On the client, you would need to edit the strings for the skills shown in the skills window and ideally hide the axe skill.
Thanks for that. But actually, I can't find "one" specific part of code which is responsible for that. I mean, I can see this line:
Code:
("You advanced to {:s} level {:d}.", getSkillName(skill), skills[skill].level))
But it imports texts from array (i guess?). That entire tricky method assumes leaving skill names as they are (on the server side). So I would probably have to extract the text for sword/club and set it rigidly. Or change that string directly in array/var they are imported from. But I found only these:
Code:
        case WEAPON_SWORD: {
            attackSkill = getSkillLevel(SKILL_SWORD);
            break;
        }

        case WEAPON_CLUB: {
            attackSkill = getSkillLevel(SKILL_CLUB);
            break;
        }
And idk if this gonna work without ruining 3/4 of other parts of engine :v

What you mean by saying "ideally hide the axe skill"? You just following my examples, or axe is the best option to hide?
 
Back
Top