dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
156
Reaction score
46
First Language
English
Primarily Uses
RMMV
So I'm trying to create a system where JP can be used to gain experience based on the number input (set to a variable). The issue is I am unable to get the plugin command loseJP to work with a variable. Is there any way this can be done?

http://yanfly.moe/2015/11/13/yep-27-job-points/
 

shockra

Bored Code Guy
Veteran
Joined
Feb 16, 2016
Messages
472
Reaction score
220
First Language
English
Primarily Uses
RMMZ
Assuming that ClassID isn't important, there's a script that may be more ideal for this. Before I can give an exact function, I need to know more about how the system is supposed to work. Is the experience gained through a skill? An event?
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
156
Reaction score
46
First Language
English
Primarily Uses
RMMV
The XP gain is via event. I use a number input to set the JP to XP value, check the current JP via script call (which works), but unable to subtract the JP to XP variable from the actor's JP.

upload_2018-3-20_12-26-37.png

upload_2018-3-20_12-29-44.png
 

shockra

Bored Code Guy
Veteran
Joined
Feb 16, 2016
Messages
472
Reaction score
220
First Language
English
Primarily Uses
RMMZ
Two possible reasons that this could be happening.

First, I don't think the plugin command can discern uppercase from lowercase. The loseJP should be loseJp, which a lowercase p. If that doesn't work, try the second option below.

Second, the plugin reader may not be able to read \v[15] in the plugin command. Replace that with $gameVariables.value(15)

If neither of those work, you may need the script call itself. The basic function is $gameActors.actor(actorID).loseJp(value, classID);
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
156
Reaction score
46
First Language
English
Primarily Uses
RMMV
$gameActors.actor(1).loseJp($gameVariables.value(15), 1); worked perfectly. Thanks much!

Mods: you may close this thread as it is resolved.
 

Latest Threads

Latest Posts

Latest Profile Posts

After the initial success with one event, I set up four different events on the same map to detect who is in which slot in my current party, and fortunately it managed to work as intended, with the events changing image to match the party members even as I swapped their positions around in formation. This will be a great tool for immersive scene design.
Finally finished the first hand-drawn map! It took me a week, but I'm so proud!
Actual line of code I just had to write for a plugin:

return Object.keys(this._shopStock).map(key => key.split(",")).map(element => element.map(value => Number(value))).filter(key => key[0] === mapId && key[1] === eventId);

Forum statistics

Threads
118,447
Messages
1,116,062
Members
155,421
Latest member
Vance11k
Top