Max TP for individual party member

● ARCHIVED · READ-ONLY
Started by Landazar 7 posts View original ↗
  1. Hi, as you may (not) remember I made small plugin that allows you to change max TP for players.
    I decided to improve it a little bit more further making maxTP value different for each party member e.g
    Hero #1 - Lv. 3 will have max tp 130
    Hero #2 - Lv. 2 will have max tp 90
    Hero #3 - Lv. 1 will have max tp 50

    and I got an idea, quite brilliant and simple idea that I store MaxTP values in array and return specific index of array using hero level. Function goes like this
    Code:
    (function() {   
    
        Game_BattlerBase.prototype.maxTp = function() {
            var Lv = this._level;
            var ValuePerLevel = [0, 25, 60, 90, 125, 155, 200, 235, 260, 300, 350];
            return ValuePerLevel[Lv];
        };
    })();
    And you know what? IT WORKS! But... There is only one little problem with that approach...
    All enemies in battle just stand and they don't do anything with only exception, when I force them to attack via eventing.

    I wanted to ask more advanced JS scripters how to fix that problem. I already know it's inside my function (for 99.99% its Lv variable) but I can't find how to get another way each party member level.
  2. Because enemies don't have levels so the function returns 'undefined' for enemies. If the enemy's Max TP is 'undefined', the AI will probably be messed up.

    Either make sure the return value is real & return a default value if it is not real, or change "Game_BattlerBase" to "Game_Actor".
  3. Replacing to Game_Actor fixed problem - big mug of beer for you @Aloe Guvner :)
    Spoiler
    a84a9597badbe3b87effd0d86c4dc3a1.jpg
  4. Thanks for the beer haha - happy Friday.

    When using an array, if the player levels past the end of the array, it'll cause an issue (like past level 12). You could use maths and a formula instead, your data is roughly linear right now. For example:
    MaxTP = 35 * Lvl - 35

    This would make it start at 0 and gain 35 each level.
  5. Thank you for advice and don't worry about that - my heroes can reach max level: 10 and no more ;)
  6. Interesting concept, hope you can play it well with your other mechanics in your game! :)
  7. atoms said:
    Interesting concept, hope you can play it well with your other mechanics in your game! :)
    I noticed it long time ago in many MMO's. There is no point of extremly high levels when It actually only boosts basic stats by small values. So fixed params per level and not that big will be easier to balance since in my skill damage formules current TP of hero is included.
    (I renamed TP - tactical points - to FP - Ferocity points, and now I rename it again to AL - Anger Level) Anger can really boost humans strenght, don't you think?