JP Skill Engine Problem with Subclass

Discussion in 'RGSSx Script Support' started by slickdeath97, Oct 5, 2019.

  1. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    #1
  2. Oddball

    Oddball Veteran Veteran

    Messages:
    1,545
    Likes Received:
    390
    First Language:
    English
    Primarily Uses:
    N/A
    Are there any notetags you can put on enemies to have actors earn JP from defeating them?

    Edit: Yup. there are. sounds like you think its a plug and play

    JP.png
     
    #2
  3. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    do not that i have enemies with that note tag: [​IMG]
     
    #3
  4. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Sounds like you think it is plug and play.

    Your setup is good, but the JP manager script is not inclusive with subclasses.
    Also the learn skills script is not inclusive with subclasses. unless you have addons to allow the skills an actor learns from the subclass.

    Without testing I would say that the problem is with the sub class script working with the learn skills script.
    The JP script is applied to the actor not a class. $game_actors[x].earn_jp(y)
     
    #4
  5. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    is there a way i can make it to where i can have subclasses get JP?
     
    #5
  6. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Last edited: Oct 7, 2019
    #6
  7. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    do note the jp goes for primary classes not actors, if you change the primary class of an actor with 200JP the JP will go down to 0 for the class you pick unless that class has some JP.
     
    #7
  8. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    So you're displaying the jp on the screen. What script do you have to show this?

    Can you learn skills that don't require JP? OK, it works without needing JP.
     
    #8
  9. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    The JP showing on the menu screen is just a change in the JP manager script, if you want to display it go to yanflys website and Ctrl+F and search display JP.
     
    #9
  10. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    OK, after looking into the script more I saw that it says gainjp(class_id)
    so it does go to the class, you're right.
    Add this on, it will duplicate any gain jp for the subclass.
    Code:
    class Game_Actor < Game_Battler
     
      #--------------------------------------------------------------------------
      # new method: init_jp
      #--------------------------------------------------------------------------
      def init_jp
        @jp = {}
        @jp[@class_id] = 0
        @jp[@subclass_id] = 0
      end
     
      #--------------------------------------------------------------------------
      # new method: earn_jp
      #--------------------------------------------------------------------------
      def earn_jp(jp, class_id = nil)
        gain_jp(jp * jpr, class_id)
        class_id = @subclass_id
        gain_jp(jp * jpr, class_id)
      end
     
      #--------------------------------------------------------------------------
      # new method: gain_jp
      #--------------------------------------------------------------------------
      def gain_jp(jp, class_id = nil)
        init_jp if @jp.nil?
        class_id = @class_id if class_id.nil?
        class_id_sub = @subclass_id if class_id.nil?
        @jp[class_id] = 0 if @jp[class_id].nil?
        @jp[class_id] += jp.to_i
        @jp[class_id] = [[@jp[class_id], YEA::JP::MAX_JP].min, 0].max
        @jp[class_id_sub] = 0 if @jp[class_id_sub].nil?
        @jp[class_id_sub] += jp.to_i
        @jp[class_id_sub] = [[@jp[class_id_sub], YEA::JP::MAX_JP].min, 0].max
        @battle_jp_earned = 0 if @battle_jp_earned.nil? && $game_party.in_battle
        @battle_jp_earned += jp.to_i if $game_party.in_battle
      end
     
    end # Game_Actor
    
    There is however one issue with the jp script/default system. If you have separate levels for the subclasses, then when you switch your class you will gain jp for the difference in levels.
     
    #10
  11. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    Where do i put the new part?
     
    #11
  12. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    in a new script slot...below the jp manager script.
     
    #12
  13. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    is there a way to fix it to where it doesn't give you more JP even if the subclass has different levels and is there a way to show the subclass JP in difference to the primary class JP?
     
    Last edited: Oct 5, 2019
    #13
  14. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    This fixes the display.
    Code:
    class Window_Base < Window
     
      alias r2_draw_actor_class_924v  draw_actor_simple_status
      def draw_actor_simple_status(actor, dx, dy)
        r2_draw_actor_class_924v(actor, dx, dy)
        @class_id = actor.class_id
        @sublass_id = actor.subclass.nil? ? nil : actor.subclass.id
        draw_actor_jp_class(actor, @class_id, dx, dy + line_height * 2)
        if !actor.subclass.nil?
        draw_actor_jp_subclass(actor, @subclass_id, dx, dy + line_height * 3)
        end
      end
    
      def draw_actor_jp_subclass(actor, subclass_id, dx, dy, dw = 112)
        draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0
        dw -= 24 if Icon.jp > 0
        change_color(system_color)
        draw_text(dx, dy, dw, line_height, Vocab::jp, 2)
        draw_text(dx, dy, dw, line_height, actor.subclass.name, 3)
        dw -= text_size(Vocab::jp).width
        change_color(normal_color)
        draw_text(dx, dy, dw, line_height, actor.jp(actor.subclass.id).group, 2)
      end
    
    end # Window_Base
    
    fixed the gain jp
    JP manager script line 519 under level_up
    Code:
        earn_jp(YEA::JP::LEVEL_UP) unless SceneManager.scene_is?(Scene_Class)
    
    One more minor bug. the subclass gain jp when the main class gains a level.
     
    Last edited: Oct 5, 2019
    #14
  15. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    Where do i put the display fix? Is there a way to fix the bug with primary class level up?
     
    #15
  16. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    really, now I feel like I'm spoon feeding you.
    Add onto the previous script I posted above or in a new script entry.
    I have no idea, but I'm trying. Perhaps you can let me work on it, or maybe someone else has some insight to this issue.
     
    #16
  17. slickdeath97

    slickdeath97 Veteran Veteran

    Messages:
    71
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMVXA
    Ok, so the display works, but this is what is looks like for the subclass JP:
    BTW, I am still kinda new to the rpg maker with the places to put scripts. Sorry for my stupidity.
     
    #17
  18. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,381
    Likes Received:
    3,656
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA

    I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #18
  19. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,707
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    I had that issue a little bit myself and just adjusted the dy value.
    But why your main class does not show up I do not know.
    upload_2019-10-5_9-43-34.png upload_2019-10-5_9-44-7.png
     
    #19
  20. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,093
    Likes Received:
    12,271
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Yanfly never intended for subclasses to gain JP, so all of their scripts are set up around that idea. I once found a script that gives the subclass JP too written as an Yanfly add-on, but I didn't save it so I have no idea where it is anymore. But it was written as an add-on so might work with all Yanfly scripts appropriately?
     
    #20

Share This Page