Leveling up Physical (TP) Skills

Discussion in 'RGSS3 Script Requests' started by Kes, Mar 1, 2014.

  1. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    Does anyone know of a script which enables a character to level up a physical skill, rather than a magic skill?  I've hunted through the Master Script List and can't see one.

    What I would like to do is have a mechanism whereby after X uses of a skill, it levels up and increases the attack value of that skill.  Ideally it would be capable of leveling up 10 times.  However, if there is something which approximates this, that would probably be fine.

    It may be, of course, that there is a non-script way of doing this, but if so it has eluded all my attempts to think of one.

    Thanks.
     
    #1
  2. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    The script I put together for this post (see the last reply I made for the pastebin link to the script) does pretty much exactly what you're talking about (with a bit of tweaking the config). Just change the magic school Hashes to only include Physical as an element. Alternatively, check out this post, which has a similar premise. If you'd like some combination of those scripts or an altered version of one of them, I'd be happy to oblige ^^.
     
    #2
    CWells likes this.
  3. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    Looking at these from a position of scripting ignorance, I'd say that the one that you've been discussing with CWells is probably nearer what I'm looking for. 

    The way I had imagined this working (in an ideal world) would be

    Skill starts at level 1

    15 uses of the skill leads to level 2

    40 leads to lvl 3

    and so on - though I would probably have to experiment to find the right curve.

    I wouldn't have thought it necessary for a gauge to show the player how many more uses are needed for level up, as I think it might make my skill window a bit cluttered.

    Your script for CWells is tied to elements, and this would not be appropriate for physical skills, so I couldn't see how that bit would work.  Though it did suggest that there could be 2 ways of identifying the skills in question.

    One would be simply any skill with the appropriate tag would go up by the rate set.  

    The other would be any skill in a particularly group would go up if any other skill in that group were used.

    But what if I wanted Skill A to go up as per the example above, and Skill B to go up with a higher use requirement?  Would the usage rate have to be the same for all skills?

    What I wasn't able to work out from the script was how to allocate a higher attack value to the skill.  Let us say, for the purposes of an example, that the skill in question has the standard

    a.atk * 4 as its attack value.  At level 2, it might become 40 + a.atk * 4 - or whatever value I wanted after testing out the balance of it.  Would something as straightforward as that be possible?

    Sorry if these questions seem a bit basic, but that's because I'm not at all knowledgeable yet about scripting (next learning project).
     
    Last edited by a moderator: Mar 1, 2014
    #3
  4. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    Ok, starting from the top XD

    The AP curve for levelling skills is definable based on a BASE value and a CURVE value. The formula I'm using to apply them is BASE * SKILL_LEVEL + (CURVE * ((SKILL_LEVEL - 1) ** 2)) - ** being the Ruby symbol for exponents. To apply a custom curve to each skill, as opposed to each school or set of skills, would be fairly straightforward, and require only a little bit of tweaking.

    Did you look at the gauges that I set up? I reduced the number of skill columns to 1 to allow space for them, so it doesn't look too cluttered, and I think it's better to know when a skill is going to level up rather than having it be a surprise XD but maybe that's just me. Either way, that's only one section of the script, which can easily be removed (just remove the whole * V. WINDOWING block ^^).

    As stated in my initial response, Physical is one of the default Elements in the database. Taken as-is, you could change the Hashes to only contain Physical-type skills - BASE_OFFSET becomes 

    BASE_OFFSET = {  # School name => element id  :physical    => 0} # Don't remove this

    and LEARNING CURVE becomes

    Code:
    LEARNING_CURVE = {  # School name => element id  :physical    => 0} # Don't remove this
    That said, if you're looking for a way to denote which skills specifically will have the levelling applied to them, that's simple enough - the other script I linked levels a skill denoted in a notetag by a set amount of AP depending on the enemy you "reap".

    There are two blocks to look at here: the SKILL_BOOST variable in the Config, and the make_damage_value function in the * IV. FUNCTIONALITY block. Admittedly, this is a pretty straightforward way to implement additional damage based on the skill level, but it's fairly configurable as well. If you'd rather have a base value than a multiplicative one, you can instead define a formula and simply add it to the base value in make_damage_value after the line 

    value = item.damage.eval(user, self, $game_variables)Going by your example of an additional 40 base damage per level, the next lines would read 

    if user.is_a?(Game_Actor)  value += SKILL_BOOST * (item.level[user.id]-1)endsetting SKILL_BOOST to 40.

    All in all it would be easy to implement the changes that you're talking about ^^. Let me know specifically what you want in the final product and I'd be happy to make the changes and send it along.
     
    Last edited by a moderator: Mar 1, 2014
    #4
  5. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    That is a very generous offer on your part.  Okay, here is what I would like:

    The ability to have a custom curve for each skill.

    Skills to be identified separately, not as part of a group.

    I think I'll manage without the gauge, but tell the player as part of the skill description that it will level up with use.

    I think (though I am not sure) that I will be able to have finer control over the development of the skill if I use a specific amount (like the 40 in my example), rather than a multiplicative one.  I'm a bit concerned that by the time I get to level 10 a multiplier would be giving far too much damage - your example of compound interest sums up the problem well. 

    The joy of differing time zones now kicks in, as I need to get some sleep, so won't be around to answer any further queries that you might have for several hours.  I hope I've answered what you needed to know.
     
    #5
  6. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    This should do what you want: Skill Levels.

    Let me know if there's anything you'd like added, or if you find any issues or bugs ^^.

    I added a bit of functionality - you can define either a flat or compound rate, and the offsets/curves and AP per use are more customizable. I was also thinking of having a variable maximum level, but for now it's a default in the Config.
     
    Last edited by a moderator: Mar 1, 2014
    #6
  7. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    Using this as a straight plug and play produced the results intended i.e. a 40 increase in the flat rate and 25% increase in the compound rate.  However, I can't seem to get the custom boost to work.  I decided to use the example you gave so that I could be sure that I was implementing the change in the script as I should, so I changed it at line 90 to read:

    SKILL_BOOST_FLAT = {

            0 => 40, # Default

            1 => 60,

          } # Don't remove this

     

    In the skill note box I have:

     

    <GROWS>

    <BOOST FLAT :1>

     

    But it still increases at the default 40, rather than the new 60.  Presumably I've got the tag wrong in some way, but I can't see how.

     

    I think it would be nice to have a variable maximum level, if that isn't too much trouble.  I want 10 in the game I'm planning, but in another one I might want something different.

     

    I also realised that I have no way of telling the player what level a skill has reached.  The gauge you put into the script for CWells only told the player how far to the next level, not what level the actor had reached.  Would this be too complicated to implement?  I suspect it might be.

     

    Thanks for the work so far.  
     
    #7
  8. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    The window functionality also showed the current level ^^. (It's to the left of the gauge itself, and says MAX when you hit the max level XD).

    I doubt you're doing anything wrong, I'll take a look and run some tests to see if I can figure out what's breaking it :S. I'll add in the configurable max level too.

    EDIT: I re-read your post - try <BOOST ID: 1> rather than <BOOST FLAT:1>. Flat is the default state, I realize after looking at it again that it's a bit confusing ><".

    EDIT 2: I actually like your way a lot better, changing it to that XD (I'll add a more comprehensive description and usage guidelines above the config once it's more or less where it should be in terms of functionality.)

    EDIT 3: Here's the updated script: Skill Levels. It should hopefully be more intuitive; let me know if there are any more issues ^^.

    EDIT 4 (the last one, I promise): If you want I can try to fit the skill level without the gauge into the default Skills view, it may look a bit crowded though. Alternatively, I can do a similar thing to what I did for the Magic Script and simply switch it to 1 column, just without the gauge. Also, no problem ^^ I love scripting!
     
    Last edited by a moderator: Mar 1, 2014
    #8
  9. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    Because editing a post doesn't bring it up in the 'New Content' page, I only realised this morning that you had upset the script, hence my delay in getting back to you.

    I am still having trouble getting it to recognise that I want something other than the default +40.  Following the instruction in line 120 I have a tag which reads <BOOST FLAT: 60>.  The original script had the section:

    #  SKILL_BOOST_FLAT = {

          #    0 => 40, # Default

          #    1 => 60,

          #   } # Don't remove this

          #

          # Gives skills with <BOOST TYPE: 1> tags a 60 damage increase per level.

          #-----------------------------------------------------------------------

          SKILL_BOOST_FLAT = {

            0 => 40, # Default

          } # Don't remove this

          

          SKILL_BOOST_COMP = {

            0 => 1.25, # Default, 25%

          } # Don't remove this

     

    And so I added a line saying

           1=>60

     

    The updated script doesn't have that section; it just reads:

     # Allows setting a non-default damage boost value.

        # Boost type defaults to flat.

        # Usage: 

        #  <BOOST FLAT: 60>

        #  <BOOST COMP: 0> (assigning 0 uses the default SKILL_BOOST_COMP value)

        #-----------------------------------------------------------------------

     

    And so I have not added an equivalent line.  Is that correct?

     

    Thanks for the variable max; very useful.

     

    As for the skill level, could I try and see what it would look like if you put the first option you mention, i.e. fitting the skill level without the gauge into the default Skills view to see what it looks like?

     

    Thanks.
     
    #9
  10. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    The reason for the change from the Hash I was using

    SKILL_BOOST_FLAT = { 0 => 40,}to the current format, is that defining the ID of the desired default was already using a notetag, so it really only served as a grouping mechanism. The default value can still be redefined, but I think it's easier just to define non-default values where you were going to have customization rather than defining numerous defaults and referencing them. In response to your initial question, yes, that's correct - the BOOST tags remain essentially the same.

    Here's the script with a couple of fixes and the skill level added to the skill menu: Skill Levels. The selection boxes are a bit awkward and longer skill names might overlap.
     
    #10
  11. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    I am still not getting the custom increase; damage goes up from 386 to 426, which is an increase of 40, not of 60.  I don't see what I am doing wrong.

    Showing the skill levels the way you have is absolutely fine.  I'll just be careful how long my skill names are.  There is one tweak that I would like - if it's possible.  Not everyone will have skills that level up, but as it is all skills have Level 1 next to them, which may lead the player to believe that something could alter if only they stuck at it long enough.  Is it possible to have an option to show the level or not?
     
    #11
  12. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    Odd - setting a new base damage works fine for me I'll keep looking, I may have made a change that fixed the issue somewhere along the line, so hopefully it's better now ^^. Here's the newest version of the script, which should also remove levels from skills that don't grow: Skill Levels
     
    #12
  13. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,550
    Likes Received:
    2,902
    Location:
    Philippines
    First Language:
    Tagalog
    You can also try my skill level script + it's skill use plug-in... with it, you're gonna use the damage formula to handle any effect of the level to damage though, though it gives you more flexibility when it comes to what levels does.
     
    Last edited by a moderator: Mar 5, 2014
    #13
  14. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    Another update: Skill Levels

    Some fixes to the regex mainly.

    Let me know if there are any other issues ^^.
     
    #14
  15. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    That's it!  Everything now works fine.  

    But here is where I cringe with embarrassment.  The fault may have been with me all along.  I only noticed now that the tag for the actor with damage of 60 instead of 40 read

    <SKILL FLAT : 60> instead of <SKILL FLAT: 60>

    i.e. there was an extra space between flat and the colon.  I am so sorry if it was that which has caused you all this work.  I shall now crawl off into a corner in shame.

    Thank you very much for all your help on this.
     
    #15
  16. DuncanS

    DuncanS Veteran Veteran

    Messages:
    160
    Likes Received:
    96
    Location:
    Toronto, Ontario, Canada
    First Language:
    English
    XD no worries! I'm just glad it's working ^^. Let me know if anything else crops up.
     
    #16
  17. Tigersong

    Tigersong Furry Fellow Veteran

    Messages:
    451
    Likes Received:
    44
    First Language:
    English
    Hi. I've been reading (well, skimming truthfully) this thread and wondering: Could the script be edited so a certain number of skill uses unlocks the next skill in the list?

    For instance- Skill A needs to be used 20 times before the player can use Skill B. If you could do this, I think it would make a nice alternative to gaining skills at certain levels. And it could help me simulate the Addition system in Legend of Dragoon.
     
    #17
  18. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,550
    Likes Received:
    2,902
    Location:
    Philippines
    First Language:
    Tagalog
    @Tigersong - you can do that using my script
     
    #18
  19. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,799
    Likes Received:
    10,584
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ha! Got this in with one day to spare before it counts as necroposting!

    @DuncanS

    I've been thinking, and I was wondering if you could do another tweak to this.

    Let's say, for example, that a skill at level one deals 100 damage and costs 10 TP.  Going up by the default values, by level 5 the skill is dishing out 260 damage, but is still only costing 10 TP, which is going to make things a bit ridiculous.

    Is there any way of scaling up either TP or MP by a set amount so that larger damage also equals more costly?

    Thanks
     
    #19
  20. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,550
    Likes Received:
    2,902
    Location:
    Philippines
    First Language:
    Tagalog
    @ksjp - I think you can probably utilize another script like Yanfly's custom cost system to do that (as long as the level script allows you to fetch the level), and I do think it might be better that way
     
    #20

Share This Page