TP Rework

Discussion in 'JS Plugin Requests' started by Mr_K, Jul 8, 2019.

  1. Mr_K

    Mr_K Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I’ve attempted to search for similar requests and I can’t find anything. Hopefully this hasn’t already been requested since I don’t see anything similar in the master plugin list. Before I start, I have no scripting knowledge and am only going on my current understanding and the idea for what I want to achieve.

    I am attempting to use two resources, one for spells and one for skills, individually. I want to use MP for spells and SP(Stamina Points) for skills(since they are physically based). Is there any way to change TP so that it is no longer generated during combat and would instead start as a level/class(job) based minimum/maximum which could be altered with a growth formula? I realize that this is may be difficult to do seeing as it functions in a very different way than what I am wanting to use it for, based on the “hardcoded” combat system.

    P.S. - Would there be an option of removing TP and adding a second MP bar that could be renamed?

    Thanks in advance,
    Mr_K
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,998
    Likes Received:
    6,326
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    some effects like that can be done by traits and parameter changes, but to change the fixed maximum of 100 for TP you'll need a plugin.

    if I remember correctly there are several plugins that do this, but I don't have any links.
     
    #2
  3. caethyril

    caethyril ^_^ Veteran

    Messages:
    946
    Likes Received:
    586
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Yanfly's Enhanced TP plugin can do this with some configuration: http://yanfly.moe/2016/01/08/yep-55-enhanced-tp/

    Basically, to turn TP into another simple MP-like gauge, you can disable the TP Mode changing options, pick a mode to give to your actors, set all the "gain on hit" kind of parameters to 0, and put a suitable formula for the maximum TP, e.g.
    Code:
    45 + user.level * 5
    ^ This should give actors 50 max TP at level 1, 55 at level 2, etc. If you're using the same TP Mode for actors and enemies, best to include an "isActor" check in there too, e.g.
    Code:
    user.isActor() ? 45 + user.level * 5 : user.mmp
    ^ This says "for actors, return 50 at level 1, 55 at level 2, etc; otherwise return the battler's max MP". You can customise this stuff, naturally~ :kaothx:

    Assuming TP works the same for all actors, you can simply change the name in the database (System tab). Otherwise you may be interested in this plugin by NeMV: https://forums.rpgmakerweb.com/index.php?threads/nemv-class-tp-rename.60266/
     
    #3
  4. Mr_K

    Mr_K Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    So I’d be able to achieve something similar to MP this way? I’ve messed around with Yanfly’s enhanced TP but I guess I haven’t exhausted all options and should take another look. I was hoping to achieve 9999/9999 maximum for HP/MP/SP along with stat bonuses from gear and have MP/SP increase based on class/sub class and level. That would be possible?

    Edit: Thank you for the quick and detailed replies! :)
     
    #4
  5. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    3,909
    Likes Received:
    3,278
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Yeah, you can basically do this. Yanfly's Enhanced TP is a good start - set Preserve TP to ON (or true), and change most of the parameters (like take damage, deal damage, regen TP, etc.) to 0.

    From there, you will need to modify the user's Max TP through a tiny bit of code. You can find this code inside rpg_objects.js:
    Code:
    Game_BattlerBase.prototype.maxTp = function() {
        return 100;
    };
    You can make this into a formula such as return (100 + (5 * this._level)) to have the battler's Max TP increase by 5 per level. If you have multiple classes that are all supposed to have different Max TP values from each other, you will need to set up a conditional branch inside this method and return the value obtained from one of the formulae within that branch. You can ask how to do this in the "Learning JS" subforum once you've got the rest of your system working correctly - it's not hard to do, but it's beyond the scope of this thread. (One more important note: it's best to copy this method into a new .js file that you create in your project's "plugins" folder, and then modify it there, rather than modifying it directly in the code. This will allow you to reverse mistakes more easily, and also will prevent your changes from being overwritten when you download a new version of RPG Maker.) EDIT: Per @caethyril's info below, you can actually just input the formula into the Max TP Parameter for each mode in Yanfly's plugin. That's a much easier way to handle this part than changing the code.

    If you want Items or Skills to restore TP, this can usually be done by simply adding the amount into "TP Gain" in the database. If you need a number higher than 100, or want to use a percentage, then you can do it in the damage formula using b.tp or b.maxTp() to represent the target's current or maximum TP (use a instead of b to get the user's instead).

    At this point you will have a system that is very similar to MP for your TP! The only differences are that you will not restore any current TP upon leveling up (this would need to be done with a script change), and (if you are using damage popups) TP gains achieved through the damage formula will not create a popup like MP gains achieved through the Features Box normally would. Besides that, it should be perfect!
     
    Last edited: Jul 9, 2019
    #5
    caethyril and Mr_K like this.
  6. Mr_K

    Mr_K Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you very much! :)
     
    #6
  7. caethyril

    caethyril ^_^ Veteran

    Messages:
    946
    Likes Received:
    586
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    As I mentioned, Yanfly's Enhanced TP has a max TP parameter for each mode, no need for a separate override~

    Good call on the "TP won't restore to max on level up", though. :)
     
    #7
    Mr_K likes this.
  8. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    3,909
    Likes Received:
    3,278
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    I didn't think so since this is completely omitted from the documentation - but yeah, I can see from a fleeting moment in the video that each Mode does indeed have a Max TP parameter. Does it allow a formula (which is necessary to allow Max TP to grow with class/actor level), or is it limited to accepting direct numeric values?
     
    #8
  9. caethyril

    caethyril ^_^ Veteran

    Messages:
    946
    Likes Received:
    586
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Yes, max TP accepts a formula. :) Not sure why it's glossed over in the video/documentation. :kaoswt:
     
    #9
    Mr_K and Wavelength like this.
  10. Mr_K

    Mr_K Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright, so I think I’m following along so far. Yanfly’s Enhanced TP is the way to go? What about the issue with restoring TP on level up?

    Thanks again!
     
    #10
  11. Mr_K

    Mr_K Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Why am I getting this error? Error.png
     
    #11
  12. caethyril

    caethyril ^_^ Veteran

    Messages:
    946
    Likes Received:
    586
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Looks like something to do with Yanfly's Grid-Free Doodads plugin. I'm not familiar with that plugin personally, but if you're using it then check that you followed the setup instructions ("Instructions - Requirements") listed on its page and that you haven't left any resources still packed in archives; extract them from .rar if needed (.rar extraction advice here).

    Also check your Yanfly plugins are in the recommended order, listed here. :)

    If you're still having trouble, I'd suggest starting a new thread, since this is unrelated to "TP Rework". :kaoswt:

    Edit: whoops, nearly missed this post
    Not sure what the best approach there might be... :kaoslp:
     
    #12

Share This Page