Guess i need to do more explanations about this script:
I need something like modstr/moddes/modint but for skills.
Since there is no such command i was in dire need to create one to address the skillcap problem; How can i check if i'm at the skillcap because of my pure skill of because i dress enhancing skill items? i can undress e redress my char every time i do the check or ...more simply check if the char has a memory (i_mem_varskill) and look at what numeric exists on it.
Every time i add something that raise skill, i create a tag.<skillnumber> on the memory which store the value. (that's why the numeric tag) in fact when i check i do:
Code:
[FUNCTION CHECKMEMSKILL]
// IN: skill number OUT: value if found, -99 if it doesn't | or IN: negative value OUT: Skills & values
IF !(<SRC.FINDID.i_mem_varskill>)
RETURN -1
ELSE
REF1 = <SRC.FINDID.i_mem_varskill>
IF (<dARGN> < 0)
LOCAL.TAGSKILLCOUNT=<REF1.TAGCOUNT>
LOCAL.TAGCOUNT = <LOCAL.TAGSKILLCOUNT> - 1
FOR 0 <LOCAL.TAGCOUNT>
LOCAL.SKILLFOUND=<eval <REF1.TAGAT.<LOCAL._FOR>.KEY>>
LOCAL.SKILLVALUE=<eval <REF1.TAGAT.<LOCAL._FOR>.VALUE>>
RETURN <dLOCAL.SKILLFOUND>,<dLOCAL.SKILLVALUE>
ENDFOR
ELSE
IF (0<REF1.TAG.<EVAL <ARGN>>>)
RETURN <EVAL <REF1.TAG0.<EVAL <ARGN>>>>
ELSE
RETURN -99
ENDIF
ENDIF
ENDIF
Now...the problems:
Quote:- don't use OBJ (OBJ is a global reference and some other script could clobber your reference or you could clobber theirs), use a REFn instead
Done
Quote:- when you are checking a TAG in an IF statement, use IF (<TAG0.whatever>) instead of IF (0<TAG.Whatever>)
I can't. If i use the other way i would get error in console -_-
Quote:- instead of using ARGN to get passed-in arguments, use ARGV to see how many there are and ARGV[0] to get the first one and ARGV[1] to get the second one etc...
ok, i'm gonna changing it, but i just take numbers, since is the only thing i'm working with (skill numbers) maybe i will put a def for the skills in order to use also skill names.
Quote:- I would avoid creating tags that are just numeric... (in your example you are using TAG.<eval <ARGN>> and stuff like that... if gets confusing. Instead use TAG.Skill_<dARGN>
I can't do that, for the reason i told u..otherwise i have to put a STREAT everytime i want to TRY the tags, so i guess it will slow down the process or just make it less efficient.
Quote:- Since you don't use the LOCAL.tagcount inside the loops, this:
ok, done
__
Now, lil/big problems:
when i do checkmemskill 0 or checkmemskill and i use
IF <ARGN> or ARGS or whatever, for sphere is the same, but i need to check the difference (since, if i do checkmemskill 0, i'm gonna check if there is a Tag of alchemy in the mem of the player, while if i do checkmemskill, i'm gonna retrieve all the skill tags and values of the player)
so i had to put argn > 0 and use a negative value to check all the tags... seriously?
plus now i find some bugs while adding items with totally different skills coz when i unequip the first item the mem is also, getting char to lose skill points when he unequip the second item.
(ofc, since u are a dev now, if u plan to do a modskill command, all this shit will be useless and i'll very happy to trash it
)