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
So far the change I've made in OTC is
at the very end of skills.otui
and on Const.h after
added
Now to the changes I've made on TFS
In condition.cpp after
added
In enumus.h after
add
After
added
inprotocolgame.cpp after
added
in tools.cpp after
added
INLUASCRIPT.CPP after
added
added
In DB
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
and on Const.h after
Code:
Fishing,
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
Code:
CONDITION_PARAM_SKILL_MINING = 47,
CONDITION_PARAM_SKILL_MININGPERCENT = 48
After
Code:
SKILL_FISHING = 6,
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));
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";
Code:
case SKILL_MINING:
return "mining";
INLUASCRIPT.CPP after
Code:
registerEnum(CONDITION_PARAM_SKILL_FISHING)
Code:
registerEnum(CONDITION_PARAM_SKILL_MINING)[code]
after
[code] registerEnum(CONDITION_PARAM_SKILL_FISHINGPERCENT)
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: