Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Code help needed- Custom Job Point System [ResolvedForNow]

Injury

Awesome Bro

Hey there, haven't posted in a while, but I'm back to working on learning Ruby/RGSS. I have written this preliminary code as a startup class for the job point system. All it is really is an attribute I tried to add to the Game_Actor class to handle jp and jpXP. I need some help progressing this code to actually work!

Here it is.

This is in the Game_Actor public instances variable section.
Code:
attr_reader   :jp                       # Job Points
  attr_reader   :jpXP                     # Job Point Experience Points


This is the code I made in a seperate class

Code:
class Job_System
  def initialization
    print job_points
    print job_pointsXP
    job_points = $game_actor.jp
    job_pointsXP = $game_actor.jpXP
    $game_actor.jpXP == 100
    case $game_actor.jpXP
      when 100
        $game_actor.jp += 1
      end
  end
end

Now, do I have to inherit the Game_Actor class to make it work? or what? I need some help!

thanks!
 
First, $game_actor is not what you want to call. You need to call a specific actr object, say $game_actors[1]. I'm not sure exactly what you're Jp system is, but if you want help with it, PM me and I can give you hand.
 

Injury

Awesome Bro

All I'm doing is whenever they defeat an enemy, they also get a certain ammount of jp. knowing that would take a lot to assign values to each monster, I just figured to start out, make it so you get jp per level and then go from there. Sorry if this is confusing...Someone can lock or drop it I guess.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top