YEA JP Manager - Learn skills outside of menu

Hydlide

Villager
Member
Joined
Jul 20, 2012
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi all,


So I'm trying to find a way to spend JP outside of the menu with a script call, for instance learning a skill from an NPC rather than from a menu, provided the character has enough JP to expend, but I'm not sure how to do that.


Here's the script for reference: https://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/jp-manager/


I know there's a way but I just can't figure it out!
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
You do that with the provided script calls (lose_jp and the others), those will add/subtract JP points.


And teaching a skill for your actors is a default event command.
 

Hydlide

Villager
Member
Joined
Jul 20, 2012
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
I should re-explain actually. I'm trying to find a way that also checks to see if they even have enough JP for the skill to learn but I'm not sure how to do that. (Edited first post)
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Ohh, right, forgot about that.


Yeah, for some reason Yanfly always miss these script calls in his descriptions. :D


You can check these in scripted conditional branches:

# Actor based check:
$game_actors[id].jp # For the current class, whichever that is
$game_actors[id].jp(class_id) # For a specific class

# Party position based check:
$game_party.members[index].jp
$game_party.members[index].jp(class_id)

Replace id with the database ID of the actor.


Replace index with the party member's position. The 1st member's index is 0, the 2nd member's index is 1, and so on.


Replace class_id with the database ID of the class.


Examples:

Code:
# Checks if Actor 1 got at least 20 JP for the 
# currently active class:
$game_actors[1].jp >= 20

# Checks if Actor 5 got at least 35 JP for Class 5:
$game_actors[3].jp(5) >= 35

# Checks if the party leader got at least 120 JP
# for Class 12:
$game_party.members[0].jp(12) >= 120
 

Hydlide

Villager
Member
Joined
Jul 20, 2012
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
Thanks for the help. I will attempt to implement your code when I get home.


Is there also a way to display the current JP as a variable? 
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
You can use the same script call for that.


Just set the variable to that with the "Script" option inside the "Control Variables" command or use a fully scripted version like this:


$game_variables[id] = $game_actors[id].jp


For example.


After this, you can display it in message boxes with the regular \V[id] message code for variables.
 

Hydlide

Villager
Member
Joined
Jul 20, 2012
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMMV
This is a really quick event that seems to do the trick. I'm not sure how to implement an if/and style argument in the script so hopefully this works!

grabilla.q63232.png
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top