Gaining TP in damage formula?

Discussion in 'RPG Maker VX Ace' started by Oddball, Oct 18, 2019.

Thread Status:
Not open for further replies.
  1. Oddball

    Oddball Veteran Veteran

    Messages:
    1,662
    Likes Received:
    436
    First Language:
    English
    Primarily Uses:
    N/A
    Can you use a damage formula to have an ally gain TP? I'm trying to make a skill were the target gains TP equal to there MP. Then they're MP empties
     
    #1
  2. NinjaKittyProductions

    NinjaKittyProductions Professional Murder Hobos Veteran

    Messages:
    357
    Likes Received:
    299
    First Language:
    English
    Primarily Uses:
    RMMV
    This is how I did it:
    b.tp = b.mp; b.mp = 0; 0

    Capture.PNG
     
    #2
    Engr. Adiktuzmiko likes this.
  3. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    Take note though that such setup will only work on battle. If you're doing a menu skill, you wont be able to target an ally with an HP damage skill, the game wont allow it.

    On a side note, you might want to change it to

    b.tp += b.mp

    If you want tp gain. The original formula makes the target's TP equal to their MP.
     
    #3
    NinjaKittyProductions likes this.
  4. NinjaKittyProductions

    NinjaKittyProductions Professional Murder Hobos Veteran

    Messages:
    357
    Likes Received:
    299
    First Language:
    English
    Primarily Uses:
    RMMV
    I tried this and it wouldn't add to the TP. Not sure why. Might be something on my end.

    On the only usable in battle... just change to HP recovery and you should be able to use it from the menu.
     
    #4
    Engr. Adiktuzmiko likes this.
  5. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    If it doesnt work, then just do

    b.tp = (b.tp + b.mp)

    :)

    PS: If you do HP recovery, you wont be able to use it on full HP actors... This engine has lots of checks for menu skills somehow... IIRC though, putting a sure effect on the effects box, like TP + 0 or running a blank common event allows you to use the skill.

    Anyway as long as the skill is battle only, the menu limitations shouldnt matter.
     
    Last edited: Oct 18, 2019
    #5
    NinjaKittyProductions likes this.
  6. Oddball

    Oddball Veteran Veteran

    Messages:
    1,662
    Likes Received:
    436
    First Language:
    English
    Primarily Uses:
    N/A
    Thanks everyone! In this game, TP boosts damage dealt and is called DPS. It's max is 10, and it goes down each turn. This skill will only be used in battle, i want it to add to TP equal to the targets MP then empty the TP. It's not corrupted magic in this game. It's a blacksmith skill called "Forge"
     
    #6
  7. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    If thats the case, you might need to add a check to make sure the TP wont go above 10... Or what should happen if for example my current TP is 5 and the MP is 6? Does the TP become 10 and the MP still becomes 0? or should the MP only be reduced by 5?
     
    #7
    Oddball likes this.
  8. Oddball

    Oddball Veteran Veteran

    Messages:
    1,662
    Likes Received:
    436
    First Language:
    English
    Primarily Uses:
    N/A
    After you mention it, it's only fair MP should be reduced by 5 in this case. And possibly MP regeneration should be increased from 1 each turn, to 2 each turn for a few turns
     
    #8
    Engr. Adiktuzmiko likes this.
  9. Engr. Adiktuzmiko

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

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    Then you need to add that on the damage formula, as for the enhanced regen, you could just do that as a state..

    TBH, when formula's become a bit more complicated, I prefer writing them in the script editor as a method and just make the damage formula box call that method..

    Like

    Code:
    module DAMAGE
      def self.mptotp(b)
        if (b.tp + b.mp) > 10
          value = 10 - b.tp
          b.tp = 10
          b.mp -= value
          #or b.mp = (b.mp - value)
          #if -= doesnt work
        else
          b.tp = (b.tp + b.mp)
          b.mp = 0
        end
      end
    end
    
    Then on the formula box, you just do DAMAGE.mptotp(b)

    Ofc you can still do this on the damage formula itself, but the single line might be too confusing.
     
    #9
    Oddball likes this.
  10. NinjaKittyProductions

    NinjaKittyProductions Professional Murder Hobos Veteran

    Messages:
    357
    Likes Received:
    299
    First Language:
    English
    Primarily Uses:
    RMMV
    Yea, this is the way to go. I hate that vx ace damage formula only has about a 100 character limit <_<
     
    #10
    Engr. Adiktuzmiko likes this.
  11. Oddball

    Oddball Veteran Veteran

    Messages:
    1,662
    Likes Received:
    436
    First Language:
    English
    Primarily Uses:
    N/A
    Last edited: Oct 18, 2019
    #11
    Engr. Adiktuzmiko likes this.
  12. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,974
    Likes Received:
    10,672
    First Language:
    English
    Primarily Uses:
    RMVXA

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #12
Thread Status:
Not open for further replies.

Share This Page