• 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+ How to install true dual wielding

A patch is a text file that describes differences between two files. Actually you can open it in a text editor and apply the changes yourself, you don't even need patch.exe for that.

Now patch.exe is a program that can read such a file and apply the changes to a specified file automatically. It just wants to know which patch it should use and which file is supposed to be patched. Gotta look up how to use patch.exe on on Windows exactly (i.e. which arguments it expects) since I'm on Linux myself. But that's the idea.
 
A patch is a text file that describes differences between two files. Actually you can open it in a text editor and apply the changes yourself, you don't even need patch.exe for that.

Now patch.exe is a program that can read such a file and apply the changes to a specified file automatically. It just wants to know which patch it should use and which file is supposed to be patched. Gotta look up how to use patch.exe on on Windows exactly (i.e. which arguments it expects) since I'm on Linux myself. But that's the idea.
Yea i know that i can add them with hand but it would be bad idea because i dont really know where could i add them so i would mess up something. Thats why i created thread i need someone to explain how to use that patch.exe
 
I already told you. It wants to know which file to patch and which patch to use. Now go and find out how to pass that information to this program. It's not some magical, OT-specific binary (patch.exe) you have there, it's a decades old tool. Google "patch.exe usage" or similar.
 
Untitled.png
 
Since the sources have changed since this patch has been introduced the safest way to do it is by hand.

It's easier than it looks to do however depending on the changes you might have to alter the patch to meet the needs of the sources & this could require basic to intermediate know of C++.

Let's say it doesn't require any knowledge & you are using a clean build, this line here tells which file to modify.
C++:
diff --git a/config.lua b/config.lua
config.lua

This next thing to look for is something like this
C++:
@@ -88,6 +88,7 @@
This tells you the line number to make the change so the 1st set of numbers 88,6 would tell you to look on line 88 for the original code. The minus ( - ) sign tells you that a change will be made on this line and the plus ( + ) in front of the number 88,7 is the change.

There is also normally a visual representation of what code comes before or after the change.
Such as:
Lua:
classicEquipmentSlots = false

These numbers can also be helpful when you are dealing with a large file such as luascript.cpp it give you a general idea of where to start looking for the code especially if you have already made changes to the source or the sources are slightly different.

If there are no plus ( + ) or minus ( - ) signs in front of the code then that means this is the original code. But if there is a ( - ) minus sign in front of it then this is code that has been removed or altered. If there is a plus ( + ) sign in front of the code then this is code that is new and is being added to that line.

You can also determine what has been added or removed/edited from the sources by its color code, red for edited/removed & green for new.
 
Since the sources have changed since this patch has been introduced the safest way to do it is by hand.

It's easier than it looks to do however depending on the changes you might have to alter the patch to meet the needs of the sources & this could require basic to intermediate know of C++.

Let's say it doesn't require any knowledge & you are using a clean build, this line here tells which file to modify.
C++:
diff --git a/config.lua b/config.lua
config.lua

This next thing to look for is something like this
C++:
@@ -88,6 +88,7 @@
This tells you the line number to make the change so the 1st set of numbers 88,6 would tell you to look on line 88 for the original code. The minus ( - ) sign tells you that a change will be made on this line and the plus ( + ) in front of the number 88,7 is the change.

There is also normally a visual representation of what code comes before or after the change.
Such as:
Lua:
classicEquipmentSlots = false

These numbers can also be helpful when you are dealing with a large file such as luascript.cpp it give you a general idea of where to start looking for the code especially if you have already made changes to the source or the sources are slightly different.

If there are no plus ( + ) or minus ( - ) signs in front of the code then that means this is the original code. But if there is a ( - ) minus sign in front of it then this is code that has been removed or altered. If there is a plus ( + ) sign in front of the code then this is code that is new and is being added to that line.

You can also determine what has been added or removed/edited from the sources by its color code, red for edited/removed & green for new.
Great answer. I'll try to install it by hand.
 
C++:
uint8_t Player::getPercentLevel(uint64_t count, uint64_t nextLevelCount)
 {
    if (nextLevelCount == 0) {
@@ -2583,6 +2619,10 @@ ReturnValue Player::queryAdd(int32_t index, const Thing& thing, uint32_t count,
                               leftType == WEAPON_SHIELD || leftType == WEAPON_AMMO
                               || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
                        ret = RETURNVALUE_NOERROR;
+                    } else if (type != WEAPON_DISTANCE && type != WEAPON_WAND &&
+                               g_config.getBoolean(ConfigManager::ALLOW_DUAL_WIELDING) &&
+                               vocation->canDualWield()) {
+                        ret = RETURNVALUE_NOERROR;
                    } else {
                        ret = RETURNVALUE_CANONLYUSEONEWEAPON;
                    }
@@ -2624,6 +2664,10 @@ ReturnValue Player::queryAdd(int32_t index, const Thing& thing, uint32_t count,
                               rightType == WEAPON_SHIELD || rightType == WEAPON_AMMO
                               || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
                        ret = RETURNVALUE_NOERROR;
+                    } else if (type != WEAPON_DISTANCE && type != WEAPON_WAND &&
+                               g_config.getBoolean(ConfigManager::ALLOW_DUAL_WIELDING) &&
+                               vocation->canDualWield()) {
+                        ret = RETURNVALUE_NOERROR;
                    } else {
                        ret = RETURNVALUE_CANONLYUSEONEWEAPON;
                    }
And mine is not even close lmfao
C++:
uint8_t Player::getPercentLevel(uint64_t count, uint64_t nextLevelCount)
{
    if (nextLevelCount == 0) {
        return 0;
    }

    uint8_t result = (count * 100) / nextLevelCount;
    if (result > 100) {
        return 0;
    }
    return result;
}
as you can see i dont even have
  1. leftType == WEAPON_SHIELD || leftType == WEAPON_AMMO
  2. || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
  3. ret = RETURNVALUE_NOERROR;
 
NVM its in ReturnValue Player::queryAdd(int32_t index, const Thing& thing, uint32_t count,

Edit somehow i managed to add but i get this error
1>..\src\luascript.cpp(342): error C2039: 'setAttackSpeed': is not a member of 'Player'
1> c:\test\server\src\bed.h(26): note: see declaration of 'Player'
 
Last edited:
Are you calling something like player.setAttackSpeed() instead of player->setAttackSpeed()?

Edit: setAttackSpeed() isn't a method of the player class because it doesn't exist at least in my TFS.
 
Last edited:
Are you calling something like player.setAttackSpeed() instead of player->setAttackSpeed()?

Edit: setAttackSpeed() isn't a method of the player class because it doesn't exist at least in my TFS.
Nvm fuck this stupid dual wielding system. Close this thread.
 
Back
Top