How do I cap level on different classes for different actors?

Discussion in 'RPG Maker VX Ace' started by ElOtario, Dec 12, 2018.

  1. ElOtario

    ElOtario Villager Member

    Messages:
    25
    Likes Received:
    1
    First Language:
    Pretuguês
    Primarily Uses:
    RMVXA
    Something like this:

    So there's actor X, actor Y, and actor Z.
    There's class x, class y, and class z.

    Actor X level cap:
    class x: 30
    class y: 21
    class z: 28

    Actor Y level cap:
    class x: 23
    class y: 24
    class z: 42

    Actor Z level cap:
    class x: 25
    class y: 52
    class z: 2

    The numbers were random but you get the idea.
     
    #1
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,484
    Likes Received:
    5,092
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Code:
    class Game_Actor
      def max_level
        case actor.id
        when 1 # actor ID 1
          case @class_id
          when 1 # class ID 1
            return 23
          when 2 # class ID 2
            return 24
          when 3 # class ID 3
            return 25
          end
        when 2 # actor ID 2
          case @class_id
          when 1 # class ID 1
            return 23
          when 2 # class ID 2
            return 24
          when 3 # class ID 3
            return 25
          end
        when 3 # actor ID 3
          case @class_id
          when 1 # class ID 1
            return 23
          when 2 # class ID 2
            return 24
          when 3 # class ID 3
            return 25
          end
        end
      end
    end
    
    The number doesn't match with your example but you get the idea.
     
    #2
    MushroomCake28 likes this.
  3. MushroomCake28

    MushroomCake28 KAMO Studio Veteran

    Messages:
    1,793
    Likes Received:
    3,220
    Location:
    Montreal, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    @TheoAllen Seeing some code without ";" actually hurts my eyes...
     
    #3
  4. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,484
    Likes Received:
    5,092
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    @MushroomCake28 I'd say ";" is unnecessary noises :p
    (enough out of topic talk)
     
    #4
  5. MushroomCake28

    MushroomCake28 KAMO Studio Veteran

    Messages:
    1,793
    Likes Received:
    3,220
    Location:
    Montreal, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    @TheoAllen Even if it's unnecessary I've become so used to it that not seeing it makes me uncomfortable lol. ";" is like an addiction for me.
     
    #5
  6. ElOtario

    ElOtario Villager Member

    Messages:
    25
    Likes Received:
    1
    First Language:
    Pretuguês
    Primarily Uses:
    RMVXA

    I'm kind of a noob. Where do I put this?
     
    #6
  7. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,484
    Likes Received:
    5,092
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Insert it as a new script. If you don't know how to insert script, maybe you can try to search how to insert script in VX Ace.
     
    #7

Share This Page