Status
Not open for further replies.

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
So I have a few plugin issues. I am gonna go through them one at a time.

The first one is Yanfly JP system not sticking with the character once there is a class change. I dont know if that was by design, but once I class change, the JP goes back to 0. This is needed for Yanfly's Stat Allocation System (renamed JP to SP [Stat Points})

Thank you for any help.

P.S.: I will introduce you to the other issues once this one is fixed. :kaoswt2:

I will try to update this with a plugin list later, I am rushing to post this 30 minutes before work. :kaocry:
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
665
Reaction score
284
First Language
english
Primarily Uses
RMMV
"When Job Points are earned, they are given to the actor's current class. If
the actor were to switch classes, then the Job Points will be changed to
that class's Job Points until reverted back."

its right in the "introduction" info about the plugin
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
"When Job Points are earned, they are given to the actor's current class. If
the actor were to switch classes, then the Job Points will be changed to
that class's Job Points until reverted back."

its right in the "introduction" info about the plugin

I knew I was missing something. So does that mean I would need to use a different system if wanted it to stay? Or is a plug-in available for it? I have a two job change class system (advance classes twice). :/
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
I knew I was missing something. So does that mean I would need to use a different system if wanted it to stay? Or is a plug-in available for it? I have a two job change class system (advance classes twice). :/
You could modify the class change function to also grant JP to the new class equal to the amount of JP the old class had.

You could also do this using events, if your class change is scripted (as in the player doesn't do it himself from the menu). I believe there are plugin commands you can use to set JP of specified classes, and functions to call from a script box (or set variable command) to get the current JP of a current class.
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
You could modify the class change function to also grant JP to the new class equal to the amount of JP the old class had.

You could also do this using events, if your class change is scripted (as in the player doesn't do it himself from the menu). I believe there are plugin commands you can use to set JP of specified classes, and functions to call from a script box (or set variable command) to get the current JP of a current class.


No variables as far as I can see. Since I didn't see the intro, maybe I'm missing something again. Lmao
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV

No variables as far as I can see. Since I didn't see the intro, maybe I'm missing something again. Lmao
From the website:
Plugin Commands:

gainJp actorId jp
gainJp actorId jp classId
Replace 'actorId' with the ID of the actor you wish to change the JP of.
Replace 'jp' with the amount of JP you wish to alter. If you are using
'classId', replace it with the ID of the actor's class you wish to alter.
This command will let the actor gain JP.
Of course, since you can't use a variable in a plugin command, that isn't entirely useful. Instead, you can set a variable to the actor's current JP, and then call the function to set their JP for the new class to the variable:

◆Comment:Sets variable 1 to the party leaders JP for current class
◆Control Variables:#0001 = $gameParty.members()[0].jp()
◆Comment:Reset old class JP to 0
◆Script:$gameParty.members()[0].setJp(0)
◆Comment:Change class of actor 1
◆Change Class:Harold, Warrior, false
◆Comment:Set party leader's JP for new class to old class
◆Script:$gameParty.members()[0].setJp($gameVariables.value(1))
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,164
Reaction score
14,654
First Language
English
Primarily Uses
RMMV
"When Job Points are earned, they are given to the actor's current class. If
the actor were to switch classes, then the Job Points will be changed to
that class's Job Points until reverted back."

I read that as if your actor has 20 JP, then they change class, the 20 JP would follow them to the new class. Which seems to be exactly the opposite of what you're saying happens.

In that case, I would question whether your Yanfly plugins are in the right order, and if you're using the Victory Aftermath plugin, which is also mentioned in the intro notes.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
I read that as if your actor has 20 JP, then they change class, the 20 JP would follow them to the new class. Which seems to be exactly the opposite of what you're saying happens.

In that case, I would question whether your Yanfly plugins are in the right order, and if you're using the Victory Aftermath plugin, which is also mentioned in the intro notes.
Having looked under the hood on this plugin a few minutes ago, I can say for sure that the wording on that sentence is incorrect. The plugin is coded that job points are specific to the actor's class, and they are stored in an array, with an element for each classId. When changing classes, the actors job points swap from the amount the old class had to the amount the new class has, which is generally zero unless you do something to change that yourself.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
665
Reaction score
284
First Language
english
Primarily Uses
RMMV
im actually doing something similar in my current game but only using the subclasses to pull off what you are attempting though.
the sub class is not changeable which is the character class and that has the attribute increases.
the main class is changeable which is the job class and that determines which skills it can learn but only effects attributes through job level and not JP.
all while using skill equip + allow skill types to pull off the multi class system of base+advanced classes
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
im actually doing something similar in my current game but only using the subclasses to pull off what you are attempting though.
the sub class is not changeable which is the character class and that has the attribute increases.
the main class is changeable which is the job class and that determines which skills it can learn but only effects attributes through job level and not JP.
all while using skill equip + allow skill types to pull off the multi class system of base+advanced classes

Reading this made my brain hurt. This sounds complicated or I just don't understand. Lmao. Good luck.
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
From the website:

Of course, since you can't use a variable in a plugin command, that isn't entirely useful. Instead, you can set a variable to the actor's current JP, and then call the function to set their JP for the new class to the variable:

This doesn't work.

◆Comment:Sets variable 1 to the party leaders JP for current class ◆Control Variables:#0001 = $gameParty.members()[0].jp()

I am assuming this means you are setting the 1st party members JP to the specified variable (in my case, Control Variables:#0038 = $gameParty.members()[0].jp() )


◆Comment:Reset old class JP to 0 ◆Script:$gameParty.members()[0].setJp(0)

I am assuming this sets the previous variable to 0 as the variable is set by the previous script. Although I tried using it without this and it doesn't do anything anyway.

◆Comment:Change class of actor 1 ◆Change Class:Harold, Warrior, false ◆Comment:Set party leader's JP for new class to old class ◆Script:$gameParty.members()[0].setJp($gameVariables.value(1))

I am assuming this sets the first party member to the variable (in my case: $gameParty.members()[0].setJp($gameVariables.value(38)) )

Just trying to understand the code is all. Thank you for trying to help tho. :)
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
This doesn't work.

◆Comment:Sets variable 1 to the party leaders JP for current class ◆Control Variables:#0001 = $gameParty.members()[0].jp()

I am assuming this means you are setting the 1st party members JP to the specified variable (in my case, Control Variables:#0038 = $gameParty.members()[0].jp() )


◆Comment:Reset old class JP to 0 ◆Script:$gameParty.members()[0].setJp(0)

I am assuming this sets the previous variable to 0 as the variable is set by the previous script. Although I tried using it without this and it doesn't do anything anyway.

◆Comment:Change class of actor 1 ◆Change Class:Harold, Warrior, false ◆Comment:Set party leader's JP for new class to old class ◆Script:$gameParty.members()[0].setJp($gameVariables.value(1))

I am assuming this sets the first party member to the variable (in my case: $gameParty.members()[0].setJp($gameVariables.value(38)) )

Just trying to understand the code is all. Thank you for trying to help tho. :)
The first lines set a game variable (0001 in my case) to the JP of the party leader. The second set doesn't do nothing, it sets his JP in his original class to 0. This is to prevent any weird issues that might arise from changing classes back and forth multiple times or something. Even if you don't envision a time when it might happen now, it's better to take care of loose ends like this before you notice a problem with them.

The last script uses the setJp() function to set the JP of the leader to the value provided, in this case, the value of the variable 0001, or 38 in your case. By using this function after the actor has changed class, the zero Jp he will have in his new class will be replaced with the Jp he had in his old class.

Also keep in mind you don't have to use $gameParty.members()[X] specifically, you can also use $gameActors.actor(x) instead to pull the actor based on database location, rather than location in the party order.
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
The last script uses the setJp() function to set the JP of the leader to the value provided, in this case, the value of the variable 0001, or 38 in your case. By using this function after the actor has changed class, the zero Jp he will have in his new class will be replaced with the Jp he had in his old class.

What if i have multiple class changes happening at one time? Would i use this script after EACH class change or after all the classes are done changing?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
What if i have multiple class changes happening at one time? Would i use this script after EACH class change or after all the classes are done changing?
Do everything I have listed for every class change in the exact same order. You can even re-use the same variable, as it's only being used to store a temporary value.

If you originally just did 4 class changes, just repeat what I posted four times, changing out the x in $gameActors.actor(x) for each actor you're changing the class for.

EG: Harold is actor 1.

Code:
◆Comment:Sets variable 1 to actor 1s JP for current class
◆Control Variables:#0001 = $gameActors.actor(1).jp()
◆Comment:Reset old class JP to 0
◆Script:$gameActors.actor(1).setJp(0)
◆Comment:Change class of actor 1
◆Change Class:Harold, Warrior, false
◆Comment:Set party leader's JP for new class to old class
◆Script:$gameActors.actor(1).setJp($gameVariables.value(1))
Therese would be actor 2:
Code:
◆Comment:Sets variable 1 to actor 2s JP for current class
◆Control Variables:#0001 = $gameActors.actor(2).jp()
◆Comment:Reset old class JP to 0
◆Script:$gameActors.actor(2).setJp(0)
◆Comment:Change class of actor 2
◆Change Class:Therese, Hero, false
◆Comment:Set party leader's JP for new class to old class
◆Script:$gameActors.actor(2).setJp($gameVariables.value(1))

Repeat for each class change as needed.
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
Do everything I have listed for every class change in the exact same order. You can even re-use the same variable, as it's only being used to store a temporary value.

If you originally just did 4 class changes, just repeat what I posted four times, changing out the x in $gameActors.actor(x) for each actor you're changing the class for.

EG: Harold is actor 1.

Code:
◆Comment:Sets variable 1 to actor 1s JP for current class
◆Control Variables:#0001 = $gameActors.actor(1).jp()
◆Comment:Reset old class JP to 0
◆Script:$gameActors.actor(1).setJp(0)
◆Comment:Change class of actor 1
◆Change Class:Harold, Warrior, false
◆Comment:Set party leader's JP for new class to old class
◆Script:$gameActors.actor(1).setJp($gameVariables.value(1))
Therese would be actor 2:
Code:
◆Comment:Sets variable 1 to actor 2s JP for current class
◆Control Variables:#0001 = $gameActors.actor(2).jp()
◆Comment:Reset old class JP to 0
◆Script:$gameActors.actor(2).setJp(0)
◆Comment:Change class of actor 2
◆Change Class:Therese, Hero, false
◆Comment:Set party leader's JP for new class to old class
◆Script:$gameActors.actor(2).setJp($gameVariables.value(1))

Repeat for each class change as needed.

So I set their JP (i call it SP in my game, not sure if that matters) to 10, then i do what you said. It gets reset to 0.

EDIT: I use a plugin command to set the JP (e.g.: setJp 1 10).

My event setup:

2110911008f8dce214f41449608c6e85.png
 
Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
So I set their JP (i call it SP in my game, not sure if that matters) to 10, then i do what you said. It gets reset to 0.

EDIT: I use a plugin command to set the JP (e.g.: setJp 1 10).

My event setup:

2110911008f8dce214f41449608c6e85.png
You've mixed two different script calls, and the one that sets Jp isn't working because it's causing an error. You have $gameParty.members(x).setJp() you should be using $gameActors.actor(x).setJp()
 

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
You've mixed two different script calls, and the one that sets Jp isn't working because it's causing an error. You have $gameParty.members(x).setJp() you should be using $gameActors.actor(x).setJp()

Ok, I changed most of them. Only Therese is not changing to 10 now.

This is what it looks like now:

6fa0858cf854d1d7528251a9eaaafd3b.png
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
Ok, I changed most of them. Only Therese is not changing to 10 now.

This is what it looks like now:

6fa0858cf854d1d7528251a9eaaafd3b.png
Did you change the order of Marsha and Therese in your database? You're saving a variable called 'Marsha's SP' using what would normally be Therese' actor id.

Therese's SP isn't being set because you're setting it to 0 before changing Marsha's class, then resetting it to the saved value, then changing Therese' class (resetting it to zero again).

The actor Id is the order they show up in the database. I specifically showed you a code snippet that was relatively simple, reused the same variable, and would've worked for as many copy pastes as needed, all you needed to do was change the X in the code to the Id number of the actor you were changing classes on.

Edit:
This whole eventing thing is clearly not going well for you, given the amount of trouble you've run into. Using a small plugin is much easier on your part. I showed you how you could get around this problem in the plugin via clever eventing, maybe in the future if you run into a similar problem you might be able to come up with something similar. Keep that in mind.

Since I've spent so much time trying to get this working for you, I went ahead and made a script that will fix this issue automatically, without any input from you. Simply import this script into your project, and place it under the JP plugin.

This patch makes it so that when an actor changes classes, their old JP is moved to their new class, and then their old JP is removed from their old class. Real simple. Just get rid of all that extra variable stuff I had you do earlier, and change classes like you normally would.
 

Attachments

  • JP Swap On Class Change.js
    278 bytes · Views: 6
Last edited:

Jenova

Because you are...a puppet!
Veteran
Joined
Nov 29, 2017
Messages
447
Reaction score
292
First Language
English
Primarily Uses
RMMV
Did you change the order of Marsha and Therese in your database? You're saving a variable called 'Marsha's SP' using what would normally be Therese' actor id.

Therese's SP isn't being set because you're setting it to 0 before changing Marsha's class, then resetting it to the saved value, then changing Therese' class (resetting it to zero again).

Ok, This makes sense. It was not following the database. Thank you.

The actor Id is the order they show up in the database. I specifically showed you a code snippet that was relatively simple, reused the same variable, and would've worked for as many copy pastes as needed, all you needed to do was change the X in the code to the Id number of the actor you were changing classes on.

Curb your attitude. If you don't wanna help me, don't. Nobody is forcing you to help me.
With that being said, I do appreciate the help nonetheless.

I don't understand a lot of what is going on in the background of the engine, so the database wasn't something that I thought of off the bat. I'm going in blind here.

Thank you again for your help.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
Apologies if my words sounded confrontational up there. It's just that I'd tested the solution I gave you prior to posting it to ensure that it worked before having you try it, so I knew it was working.

The truth is, this is much faster, and easier to do with a tiny little plugin, which I provided in an edit you might not have seen yet. I didn't provide this script right away specifically because you'd said you weren't very experienced with the maker, so I was using it as an opportunity to show you (or anyone else reading this) a way to achieve what you were looking for without throwing more plugins at the problem.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

1620833447825.png
This is one of the most beautiful art styles I've seen... it's also the style I draw in... er.... what's this style called...?
Ami
This is the End of the Endurance,everyone are celebrating the end of their Endurance

I just wondering what Menu for Tomorrow
Two years into developing my game and I just scrolled through the BaseResource Pack that comes with MV for the first time xD I never knew how much awesome stuff was in there. Also so many names I know from the forum, like Shaz & Archeia ... and that's not the only resource pack I found in the depth of my hard drive :0 Right now I'm both confused and hyped about all the stuff I own.
Decided to start watching Naruto; and not only is it a genuinely good series, but it's also very inspiring.
I just wish Funimation got its act together and fix the missing dubbed episodes.

Forum statistics

Threads
111,290
Messages
1,059,986
Members
144,604
Latest member
Greerenz
Top