Interfering with Actor TP

● ARCHIVED · READ-ONLY
Started by TheOddFellow 4 posts View original ↗
  1. This event takes place during a battle,

    once a turn, I want to take a specific actor's TP (or that third bar that generates for special attacks.)

    and put that into a variable.

    Now, I've tried:

    \N[0].tp

    N[0].tp

    self.tp

    Once I can put it into a variable, I know what to do from there.

    Hopefully this is the right forum, if not, i'll move it. Thank you fo the help!
  2. \n[1]
    is usable in some of the text windows, but no valid ruby code.

    To refer to a specific actor you can use one of these commands:

    $game_actors[12]

    for the 12th actor (specified by database ID) or

    $game_party.members[12]

    for the 13th member of the current party (first member of the party has the index 0 here)

    $game_actors[5].tp

    would evaluate to the current tp of actor 5 for example.

    If you try to access an actor that does not exist (for example using $game_party.members[3] when your party has less than 4 members) nil will be returned. Calling nil.tp will most likely result in an error, so you'll have to make sure the actor you want does exist.

    In ruby, self refers to the "owner" of the current scope (is there another term for this?). When evaluating event script commands, self refers to the Interpreter-object that runs the event for example.
  3. $game_party.members[0].tp worked perfectly!

    Thank you. I'm an adequate programmer, but I'm in strange waters with ruby code.
  4. \n[] is simply an escape code for text processing. :)