A tp based skill that charges allies TP

● ARCHIVED · READ-ONLY
Started by Manofdusk 6 posts View original ↗
  1.  I'm working on overdrive type skills (ones that scale based on how much TP you have and then set your TP to 0).

     The one I'm working on now is called "Overcharge".

     What it's supposed to do is give the character's 3 allies however much TP he has and then set his TP to 0.

     I haven't decided yet as to whether I'm just going to give them that amount or divide it by 3.

     The problem I'm having is that I can't figure out how to keep the TP gain from granting the user TP as well.

     The first thing I tried was using hp recovery to open the formula tag:

    c = a.tp;  a.tp = 0; b.tp = c

    however, all that does is set everyone's tp to 0.

    c = a.tp; b.tp = c; a.tp = 0 heals some hp and sets anyone who is healed to 0 tp

    then I tried this:

    a.add_state(83)

    and charge tp (20%)

     state 83 is a state that gives a 0 * TCR (so I assumed that means you couldn't charge tp with it on)

     it didn't work.

     I'm not sure what else to try.
  2. The problem is the formula breaks itself after the first character gains TP.

    The first character will set c to be the user's tp, then set the TP to 0.

    The second character will set c to the user's tp (which is now 0) and so on.

    What you will need is a common event that sets the user's tp before the formula comes into play.

    There was a script snippet that was made for me a while ago that could run common events before skill use and you should find that one.

    Run the event to set a variable to the user's tp and then do you r damage formula.

    It's easier said than done, but I can't think of any other fix for this.

    ps: Actually you can try this:

    In the damage formula, 

    if a.tp < 0 ; v[x] = a.tp; end ; a.tp = 0; b.tp = v[x]

    (Or however variables are done in the dam form.)

     Make x the number of a dedicated variable.

    I switched to a variable because I'm not sure if c would be reinitialized each time or not.

    Anyway, that should solve this for you.
  3. I ended up setting the tp cost to 100, granting 100 tp to the party, then setting a.tp to 0. it still fills up the character's tp gauge, but it empties it.... it's not perfect but it works.
  4. I don't have Ace in front of me, and I DEFINITELY don't know the correct syntax, but this might give you enough that you can look it up and figure the rest out (or someone else can make the corrections) if you still want variable amounts:


    x = $game_party.battlers - a; x.each {|actor| actor.tp += a.tp}; a.tp = 0; 0


    The 0 at the end is to return 0 damage. I'm not sure if this is the correct place to do it though, or what alternatives there are to returning 0 damage.


    Basically it's setting the variable x to an array with all the battlers except the current actor via array subtraction. You might need to change a to [a] for it to work properly. Then it's going through each of those members and incrementing their tp by the same amount the current actor has (you can change it to (a.tp / x.size).to_i if you wanted to divide it up). Finally it sets the current actor's tp to 0.


    Another way of doing it that I AM more sure about is this:


    $game_party.battlers.each {|actor| actor.tp += a.tp if actor != a}; a.tp = 0; 0


    which is basically going through the WHOLE battler party and adding the current actor's tp to everyone EXCEPT himself.
  5.  I can't get either of those formulas to work. For some reason, the don't even set the user's tp to 0 either.
  6. Is it actually registering a hit? Copy the damage formula away and then change it to 100. Then play and see if there's 100 damage being done.


    You could also show us a screenshot of the skill page, and of the target and the target's class (if an actor; if the target is an enemy, which I doubt, there won't be a class)