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

Solved New Skill problem

Keru

Entrepreneur
Joined
Jul 24, 2008
Messages
1,777
Solutions
2
Reaction score
167
Location
USA
Hey there just as the title says I've a problem trying to create a new skill.

First off the problem(I use OTC latest, to check the skill change, and TFS 1.0 Latest also):
While using /addskill name, skill
It didn't gave me any level, nor error. While trying to surf the skill window on OTC I couldn't with this error on terminal
Code:
ERROR: failed to load UI from 'skills.otui': OTML error in '/game_skills/skills.otui' at line 173: indentation with tabs are not allowed
ERROR: Unable to load module 'game_skills': LUA ERROR:
/game_skills/skills.lua:35: attempt to index global 'skillsWindow' (a nil value)
stack traceback:
    [C]: in function '__index'
    /game_skills/skills.lua:35: in function 'init'
    /game_skills/skills.otmod:8:[@onLoad]:1: in main chunk
    [C]: in function 'ensureModuleLoaded'
    /init.lua:46: in main chunk

So far the change I've made in OTC is
Code:
      SkillButton
      id: skillId7
      SkillNameLabel
        !text: tr('Mining')
      SkillValueLabel
      SkillPercentPanel
at the very end of skills.otui

and on Const.h after
Code:
Fishing,
added
Code:
       Mining,
        LastSkill
    };

Now to the changes I've made on TFS
In condition.cpp after
Code:
            case CONDITION_PARAM_SKILL_FISHINGPERCENT: {
            skillsPercent[SKILL_FISHING] = value;
            return true;
        }

added

Code:
        case CONDITION_PARAM_SKILL_MINING: {
            skills[SKILL_MINING] = value;
            return true;
        }

        case CONDITION_PARAM_SKILL_MININGPERCENT: {
            skillsPercent[SKILL_MINING] = value;
            return true;
        }

In enumus.h after
Code:
   CONDITION_PARAM_FIELD = 46
add
Code:
    CONDITION_PARAM_SKILL_MINING = 47,
    CONDITION_PARAM_SKILL_MININGPERCENT = 48

After
Code:
  SKILL_FISHING = 6,
added
Code:
   SKILL_MINING = 7,[CODE] and editted [code]
    SKILL_MAGLEVEL = 8,
    SKILL_LEVEL = 9,
    SKILL_LAST = SKILL_MINING

inprotocolgame.cpp after
Code:
    msg.add<uint16_t>(std::min<int32_t>(0xFFFF, player->getSkill(SKILL_FISHING, SKILLVALUE_LEVEL)));
    msg.add<uint16_t>(player->getBaseSkill(SKILL_FISHING));
    msg.AddByte(player->getSkill(SKILL_FISHING, SKILLVALUE_PERCENT));
added
Code:
    msg.add<uint16_t>(std::min<int32_t>(0xFFFF, player->getSkill(SKILL_MINING, SKILLVALUE_LEVEL)));
    msg.add<uint16_t>(player->getBaseSkill(SKILL_MINING));
    msg.AddByte(player->getSkill(SKILL_MINING, SKILLVALUE_PERCENT));

in tools.cpp after

Code:
        case SKILL_LEVEL:
            return "level";
added
Code:
        case SKILL_MINING:
            return "mining";

INLUASCRIPT.CPP after
Code:
registerEnum(CONDITION_PARAM_SKILL_FISHING)
added
Code:
registerEnum(CONDITION_PARAM_SKILL_MINING)[code]

after
   [code] registerEnum(CONDITION_PARAM_SKILL_FISHINGPERCENT)
added
Code:
 registerEnum(CONDITION_PARAM_SKILL_MININGPERCENT)


Code:
registerEnum(SKILL_FISHING)[[code]
        added   [code]registerEnum(SKILL_MINING)

In DB
Code:
 players colum "  `skill_fishing` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_fishing_tries` bigint(20) unsigned NOT NULL DEFAULT 0,[code]



Sorry for the extent wall of text, and the format, I wanted to keep it UserFriendly to help fellow noobs like me to re create the above stated, thanks
 
Last edited:
@Summ
¬¬ are you for real? just cuz I used Tab to put an space :(? I feel dumb :( thanks

But the problem about
/addskill playername, skill

Still is not fixed :( I'm not sure I did a good job on the sources, do you have any idea?

I used the script for fishing just edited the gain part of SKILL_FISHING for SKILL_MINING but I do not gain exp on it
 
Last edited:
No helperino?
the error
Code:
ERROR: failed to load UI from 'skills.otui': OTML error in '/game_skills/skills.otui' at line 173: indentation with tabs are not allowed
ERROR: Unable to load module 'game_skills': LUA ERROR:
/game_skills/skills.lua:35: attempt to index global 'skillsWindow' (a nil value)
stack traceback:
    [C]: in function '__index'
    /game_skills/skills.lua:35: in function 'init'
    /game_skills/skills.otmod:8:[@onLoad]:1: in main chunk
    [C]: in function 'ensureModuleLoaded'
    /init.lua:46: in main chunk

was fixed it was just some typo thx to summ for pointing my stupidity :)
but the skill don't seem to work :/ I don't gain any skill out of it
 
Back
Top