• 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!

How to change ex. You advanced in "..sword fighting.."

Croow

learning LUA :)
Joined
Aug 17, 2015
Messages
25
Reaction score
4
Welcome in my mini tutorial. I'll show you how to change name of skill displayed after "You advanced in ..."
I'll use for example: "You advanced in sword fighting"
I'm using for this TFS 0.3.6.

First open your project file and choose tools.cpp. It should look like this:
2021788.jpg

Then clik CTRL + F and find this:
Code:
case SKILL_SWORD:
After it you should see code like this:
Code:
    case SKILL_SWORD:
        {
            std::string tmp = "sword";
            if(suffix)
                tmp += " fighting";

            return tmp;
        }
Now you can change:
Code:
"sword"
and
Code:
" fighting"
according to your needs.
Example:
Code:
    case SKILL_SWORD:
        {
            std::string tmp = "sword";
            if(suffix)
                tmp += " skill";

            return tmp;
        }
Now just compile and you are done.

Then it will show in game "You advanced in sword skill." instead of "You advanced in sword fighting."

#edit
It's also works in items. I mean now on look on item it will say for example +5 sword skill.
 
Last edited:
i think this is very helpful for people like me ( back after many years and trying to start a new "custom" server. )

i miss the old XML server days! so easy back then ;)
 
Although it might be beyond the scope of this tutorial but maybe should explain what the thing in double quotes is, also that they should use double rather than single quotes, because single quotes in c / c++ denote a character literal whereas double quotes denote a string literal :p

Maybe explain a bit about the switch statement and how the cases are executed and possibly where skill_sword is defined..
Code:
case SKILL_SWORD:
Just thinking out loud :)
 
Back
Top