im looking for a files to paste You, because it took so long ago XD
im looking for a files to paste You, because it took so long ago XD
omg XDThank you so much for everyone's attention!
But I managed to solve it, it was something very simple, but as a beginner I didn't know it made that much difference.
I was using it by opening the otui file through Notepad++, and configuring it through it, this was causing errors in the lines, so to solve it, test another program, and I used Sublime Text, and guess what? It worked out!
@PuszekLDZ
@margoh
Thanks for the answers and attention!
ERROR: ProtocolGame parse message exception (4207 bytes unread, last opcode is 0, prev opcode is 161): unhandled opcode 0
Find float skillMultipliers[SKILL_LAST + 1] = {1.5f, 2.0f, 2.0f, 2.0f, 2.0f, 1.5f, 1.1f}; and replace it with float skillMultipliers[SKILL_LAST + 1] = {1.5f, 2.0f, 2.0f, 2.0f, 2.0f, 1.5f, 1.1f};
double skillMultipliers[SKILL_LAST + 1] = {1.5, 2.0, 2.0, 2.0, 2.0, 1.5, 1.1};
As you said, it's missing a multiplier for the skill (it was pointed out in a comment but I can't edit the original post)Hi @Ramirow
I'm trying to implement a skill using the OTC mehah and TFS 1.5 version, using your two topics. After following step by step instructions of two tutorials you created, I found following error in the OTC terminal.
Error Message
Code:ERROR: ProtocolGame parse message exception (4207 bytes unread, last opcode is 0, prev opcode is 161): unhandled opcode 0
During the step by step process, one line was not similar between scripts that were swapped in vocation.h file.
Your vocation.h file
Code:Find float skillMultipliers[SKILL_LAST + 1] = {1.5f, 2.0f, 2.0f, 2.0f, 2.0f, 1.5f, 1.1f}; and replace it with float skillMultipliers[SKILL_LAST + 1] = {1.5f, 2.0f, 2.0f, 2.0f, 2.0f, 1.5f, 1.1f};
In TFS 1.5 vocation.h file
Code:double skillMultipliers[SKILL_LAST + 1] = {1.5, 2.0, 2.0, 2.0, 2.0, 1.5, 1.1};
I have an observation here. Did you instruct to modify line with same line without any modification? Wasn't correct way to add an extra number to end of this line? Or is there something that I didn't notice in this modification? It can also be noticed by comparing two lines that line from the server I'm using does not have letter "f" at end of numbers.
I believe that part of problem I am having in implementing script is with vocation.h. So if you could suggest any changes to make script work properly, I would be grateful!"
X = Your desired base skill multiplier. (These numbers correspond to Fist, Axe, Club, Sword, Distance, Shielding and Fishing respectively). Try adding the multiplier and checking if problem is gone.double skillMultipliers[SKILL_LAST + 1] = {1.5, 2.0, 2.0, 2.0, 2.0, 1.5, 1.1, X}
OTC sourceis this on server src or client src
Have added 2 new skills it works, but having some trouble it appears when log out and login again the 2 skills are doing ping pong, if runecraft has skill 15, and reliccraft has skill 10, when i log in again reliccraft has skill 15 and runecraft skill 10 anyone experienced same issue ?This goes hand to hand with my other thread Feature - [TFS 1.3] Adding New Skills (https://otland.net/threads/tfs-1-3-adding-new-skills.265784/)
In order to display an additional skill you code into the sources, you must edit the following files:
(I will use the same example as my other thread, "Runecraft")
src/client/const.h
Search for:enum Skill {
. Under theFishing,
line just add:Runecraft,
src/client/protocolgameparse.cpp
Search for:int lastSkill = Otc::Fishing + 1;
and replace it withint lastSkill = Otc::Runecraft + 1;
Next look forif(skill <= Otc::Fishing)
and change toif(skill <= Otc::Runecraft)
That's enough for source edits, compile it and it's half way done.
Next, we need to modify some otc modules.
modules/gamelib/const.lua
Look for lineSkill = {
Edit that table until it has the correct ids. Example.
Code:Skill = { Fist = 0, Club = 1, Sword = 2, Axe = 3, Distance = 4, Shielding = 5, Fishing = 6, Runecraft = 7, CriticalChance = 8, CriticalDamage = 9, LifeLeechChance = 10, LifeLeechAmount = 11, ManaLeechChance = 12, ManaLeechAmount = 13 }
modules/game_skills/skills.otui
Search forUnder it pasteCode:SkillButton id: skillId6 SkillNameLabel !text: tr('Fishing') SkillValueLabel SkillPercentPanel
Remember to give a +1 to the id of skills below (Critical hit chance, manaleech, etc)Code:SkillButton id: skillId7 SkillNameLabel !text: tr('Runecraft') SkillValueLabel SkillPercentPanel
modules/game_skills/skills.lua
Search forif i > Skill.Fishing then
and change it toif i > Skill.Runecraft then
That should be enough. Hope it helps someone.