YEP_Job Points to Variables

Discussion in 'Javascript/Plugin Support' started by LawrenceindaSky, Sep 30, 2019.

  1. LawrenceindaSky

    LawrenceindaSky Veteran Veteran

    Messages:
    60
    Likes Received:
    4
    First Language:
    English
    Primarily Uses:
    N/A
    So I was looking at the video by Yanfly and looking at the plugin description, there was no script calls or any examples to store it as a variable. What my goal is, is im trying to store it into a variable, and convert it to Gold. I have a number slider and stuff that works fine (Tested with variables, its a banking system), and im wondering what I can do to achieve this?
    I did happen to find online this:
    $gameParty.leader().jp();
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,257
    Likes Received:
    781
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Try putting that in Control Variables > Script. I think that'll get the JP for the party leader's current class. :)

    For a different actor you could try one of these:
    Code:
    $gameActors.actor(1).jp()
    $gameParty.members()[0].jp()
    Replace the 1 with the actor's ID, or the 0 with their position in the party (0 = leader, 1 = next member, etc).

    To reference a class other than the current class, put the class ID (as defined in the database) inside the brackets, e.g. JP of class 1 for actor 3:
    Code:
    $gameActors.actor(3).jp(1)
     
    #2
    standardplayer likes this.
  3. LawrenceindaSky

    LawrenceindaSky Veteran Veteran

    Messages:
    60
    Likes Received:
    4
    First Language:
    English
    Primarily Uses:
    N/A
    That works perfectly, I was able to display it with \v[x] and get those JP as Gold, issue is now, how do I use that same variable to subtract from JP?

    EDIT: Nevermind about the variables part, I figured a work around, which is a LOT more easier than what I was gonna do, but issue is now, the setJp doesn't seem to work? It says: setJp actorId jp , so I did: setJp 1 0 but it didn't seem to work at all doing that. Maybe im doing something wrong? Maybe there is a way to script it like the $gameActors.actor(1).jp()?

    EDIT2: Solved my own problem xD apparently the plugin hates the number 0, and I was looking at the js file and decided to try learning a bit of JavaScripting and well, the code of $gameActors.actor(1).setJp(0) actually works! All I really needed to do was add 'setjp' instead of 'jp'. But still thanks to your help of what to do with the code! Thank you! Mods can close this post.
     
    Last edited: Oct 1, 2019
    #3
    caethyril likes this.

Share This Page