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

Show additional skills on client

Thank 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!
 
Thank 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!
omg XD

hahahaha, Im glad to hear that :)
 
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!"
 
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!"
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)
double skillMultipliers[SKILL_LAST + 1] = {1.5, 2.0, 2.0, 2.0, 2.0, 1.5, 1.1, X}
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.
Also, the double or float is just the type of data, stick with what Mehah's client uses and just state the multiplier (without the f's)
 
is this on server src or client src
OTC source

for server side you need this one:
 
on OTCV8 It works well but on mehah it doesn't want to work? Why ?
Post automatically merged:

on otcv8 it works normally on otclient mehah see what's happening
 

Attachments

  • Zrzut ekranu 2023-12-09 123106.png
    Zrzut ekranu 2023-12-09 123106.png
    82 KB · Views: 5 · VirusTotal
  • Zrzut ekranu 2023-12-09 132724.png
    Zrzut ekranu 2023-12-09 132724.png
    86.4 KB · Views: 5 · VirusTotal
Last edited:
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 the Fishing, line just add: Runecraft,

src/client/protocolgameparse.cpp
Search for: int lastSkill = Otc::Fishing + 1; and replace it with int lastSkill = Otc::Runecraft + 1;
Next look for if(skill <= Otc::Fishing) and change to if(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 line Skill = {
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 for
Code:
SkillButton
      id: skillId6
      SkillNameLabel
        !text: tr('Fishing')
      SkillValueLabel
      SkillPercentPanel
Under it paste
Code:
SkillButton
      id: skillId7
      SkillNameLabel
        !text: tr('Runecraft')
      SkillValueLabel
      SkillPercentPanel
Remember to give a +1 to the id of skills below (Critical hit chance, manaleech, etc)

modules/game_skills/skills.lua
Search for if i > Skill.Fishing then and change it to if i > Skill.Runecraft then

That should be enough. Hope it helps someone.
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 ?
Database also does the ping pong , one time reliccraft as 15, log out, check runecraft has 10 and viceversa
 
Last edited:
Back
Top