Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Buying Find Traps/ Remove Traps broken  (Read 142 times)

0 Members and 0 Guests are viewing this topic.

Dolfo

« on: 09, April 2022, 19:17:19 »
Somehow don't work. Both scripts take the money for level 2 and give the right messages, but this line
Code: [Select]
pl:SetSkill(game.TYPE_SKILL, skill, slevel, 0)
is not successfully invoked. Normaly a success call on this function leads to
"You are now level 2 in the skill Find Traps/Remove Traps.".
I think SetSkill is launching an error, but lua script doesn't check return value vom SetSkill.
Can't say where the error is, because same code is functionally on legacy server.  ::)
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #1 on: 28, October 2022, 18:14:23 »
We have still problems here with remove traps npc trainer. I relation to this behavior, perhaps bug depends on a indirect trap disarm skill? I have same bug behavior on my local server weapon trainers, when i use unpatched lua function SetSkill() for the lua logic?

If the bug is not in your script, i would say, you have changed the trapdisarm skill to an indirect skill somehow on season server?

So fix could be to change it back to direct skill or remove the indirect skill level block logic in SetSkill().

https://www.daimonin.org/12206/lua-function-setskill/msg109522/topicseen/#msg109522

I personally don't understand the logic behind this block. Full function is limited to level up only 1 level and function can only be started by lua scripts, dev team decides where these scripts are. I would remove this block. Also helps future scripters not to waste time, when they ask themself, "Why is this function not working on my skill?"  :o

Edit: I have seen you have changed SetSkill function, looks like this function currently don't work. Also Frakah don't work on public.
« Last Edit: 28, October 2022, 19:11:47 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #2 on: 31, October 2022, 18:41:10 »
I have spend some time here now. Tried to understand what happened here. You have revised the full exp system. I appreciate this. But currently it leads to a broken logic in GameObject_SetSkill in daimonin_object.c at public trunk and public season trunk. I tried to fix it for my local server, so i can continue on my other goals.  :P

Mainly i found two errors in logic. The exp calculation was totally deleted and exp adjust was called with adjust +0 exp. Secondly the call was with EXP_FLAG_CAP, which caps max exp to 1/4 of the level, so we need to train 4 times on frahka to get one level. Here is my code snippet to fix this.

Edit: I cleaned this mess. Dunno if you have better function in non public area?
« Last Edit: 22, November 2022, 08:50:00 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #3 on: 22, November 2022, 08:44:09 »
This was a pain. Yes really. Such a mess. Public trunk give me a totally broken lua SetSkill function.
I spend several hours trying to understand functional and non functional code in relation to this. I know it's always time, but when muliply coders have not the time to read in, what other coders have done there, then we end in chaos with logics from multiply asyncron minds. Each one is doing things, without the understanding, what the other has done. This is how it looked there.

Also the idea of building a function to set a skill and then targeting a exp_adjust is not the best. We need always to calculate exp for this levels from outside first. This leads to more mess, like we calculate the excact exp outside, calling exp_adjust and this functions grants bonus exp. Next is this mess of direct and indirect skill. We adjust both skills with exp_adjust and this function works with exp, so we need not differenciate this in exp_adjust. Also this cap in lua setskill, when someone has 1 exp in an indirect skill, setskill lua refuse to give next level? Why? That's so much useless restrictions only blowing code up, make it more and more not understandable.

So i defined a new flag EXP_FLAG_NO_BONUS. This means admin commands can target exp_adjust without the bonus calculation to get excactly the exp or the level they want using commands /setskill /addexp

I reworked exp_adjust, there was also some broken logic in. I didn't differenciate anymore between DIRECT and INDIRECT level. The working logic for indirect level has replaced the broken logic for direct level. I also updated exp.h and c_wiz.c to to use the new flag.

I tested this so far.
command /setskill name skillnr skilllevel works fine in both directions for direct and indirect level
command /addexp name skillnr exp works fine in both directions for indirect level
from luascript size i only tested so far level up 1 indirect level, this uses also the EXP_FLAG_NO_BONUS, so it gives perfect the exp to reach next level.

So at least the level/exp adjustments working fine. Next is exp_adjust also adjusting mana and grace. This is really a bad place to put this in here, adjusting mana and grace, but ingnoring hp? This hp, mana, grace adjustment should be done in one function and outside exp_adjust, where exp_adjust can call this. But currently i don't go there. I still focus on exp logics first.

https://github.com/Kamor/Dolfo/blob/main/server/src/include/exp.h
https://github.com/Kamor/Dolfo/blob/main/code/AddExp
https://github.com/Kamor/Dolfo/blob/main/bugfix/GameObject_SetSkill
https://github.com/Kamor/Dolfo/blob/main/bugfix/exp_adjust
« Last Edit: 23, November 2022, 15:06:14 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Tags:
 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1138 Views
Last post 08, May 2005, 02:50:23
by Azgodeth
45 Replies
3796 Views
Last post 11, May 2007, 11:47:37
by angry
9 Replies
1969 Views
Last post 20, November 2007, 18:43:06
by Atan
0 Replies
2631 Views
Last post 22, June 2010, 22:06:35
by smacky
41 Replies
2840 Views
Last post 23, November 2023, 18:50:03
by Dolfo