Checking TP as a condition.

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
158
Reaction score
20
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.
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
711
Reaction score
229
First Language
English
Primarily Uses
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,787
Reaction score
14,016
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
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
158
Reaction score
20
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
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
711
Reaction score
229
First Language
English
Primarily Uses
@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.
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
158
Reaction score
20
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,787
Reaction score
14,016
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
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
158
Reaction score
20
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?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,787
Reaction score
14,016
First Language
English
Primarily Uses
RMMV
= is assignment
== is comparison

You would be after =>
 

Latest Threads

Latest Posts

Latest Profile Posts

I haven't make anything new yet, but I'm back addicted to writing some MZ plugins. Man, I wish I have more free time like I did 5 years ago.
Holy cow... work is demanding and I'm back in college. I'm kind of scared of my dad right now after the incident, but at least I don't live with him all the time. Anyway, working on Fandom Scouts and my FNAF character set. The FNAF sprites are actually going to be used in the game... unfortunately the enemy sprites are FNAF World traces, so no sharing those.
The honeymoon period is over with Cyberpunk 2077, It sadly doesnt live up to the hype, pretty graphics arent everything (especially when I cant even do something as simple as changing the radio station over!). Replaying Breath of the wild has reminded me what a good game really looks like, plus that one has good glitches!....

Forum statistics

Threads
107,689
Messages
1,031,471
Members
139,807
Latest member
jldmadruk
Top