Checking TP as a condition.

Discussion in 'RPG Maker MV' started by BrightIdeaProduction, May 14, 2017.

    Tags:
  1. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello all!

    I am writing today with one simple question....
    How the hell can I check TP as a condition. Either via script call, plug-in, or etc?

    The reason being, I am working on an Action RPG, and need to check for TP for skills.

    I.E If player tp >5 blah blah blah
    If player tp<1 disable dash.
     
    #1
  2. Zarsla

    Zarsla Veteran Veteran

    Messages:
    676
    Likes Received:
    194
    First Language:
    English
    if you're talking about the damage formula then it's "a.tp" if it's the user of a skill or item, while it's "b.tp" if it's a target.
    However if it's a script call or conditinal branch then:
    $gameActors.actor (x).tp where x is the id of a specfic actor or
    $gameParty.members()[y-1].tp where y is the postion in the party the member is with the party leader being equal to 1.

    You should check out this, it's the script call plugin list and this, which has some good info for basic damage formula stuff, good for skills and items and gives some basic MV JS code too.
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    You might also be able to use Control Variables to put the TP into a variable (use Game Data), then use the variable in a conditional branch
     
    #3
  4. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    @Shaz
    Can't, game data by default doesn't use player's tp.
    @Zarsla if i just did a conditional branch. I.E if $gameActors.actor (x).tp would i be able to use more complex expressions?
    for example would i be able write out
    $gameActors.actor (x).tp >5
    $gameActors.actor (x).tp <5
     
    #4
  5. Zarsla

    Zarsla Veteran Veteran

    Messages:
    676
    Likes Received:
    194
    First Language:
    English
    @BrightIdeaProduction yes, you'd do this using the script function(it's on page 4 of the conditional branch window) in a codtional branch and write out,say:
    $gameActors.actor(x).tp > 5

    or you could do what @Shaz said and in a control variable, set it to script and place
    "$gameActors.actor(x).tp"
    then you would deal with the variable as you normal would.
     
    #5
  6. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Figured out a solution.

    upload_2017-5-14_17-19-14.png
     
    #6
  7. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    In short you can tie the TP directly into a variable. So then you can later check the variable.
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you're doing a conditional branch straight after and that's the only thing you want the value for, you can just put it straight into the conditional branch and skip the variable step altogether.

    Code:
    Conditional Branch: Script: $gameActors.actor(1).tp == 0
     
    #8
  9. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Ahhh Thanks, good sheep.
     
    #9
  10. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    One more question. does " == " mean equal in the fact of =?

    I ask to clarify the expression for greater than or equal to.
    Would it be => ? or how would that be expressed?
     
    #10
  11. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    = is assignment
    == is comparison

    You would be after =>
     
    #11
  12. BrightIdeaProduction

    BrightIdeaProduction Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    thanks shaz
     
    #12

Share This Page