[VX] Job Changing/EXP Script

ok I like the way you made some classes unlockable..

but is there a different way to do it?

say more like final fantasy tactics? where squire turns into knight...
and chemist turns into white mage/black mage...

I was hoping to put in a few starting classes...

Novice: (or actually none) this class I wanted to allow it to use passive skills that would be learned from other classes...
then I wanted to have a script check the novice's job level and say if at level 10... you went to a couple areas you could buy additional jobs... or have to do quests for other jobs...

say at level 10 novice char went to a fighter school... you would be charged a fee... then given a quest of defeating some monsters... after that it activated a switch and gave you...

Fighter and Brawler... Fighter focuses more on weapons while brawler focuses on defense and fists...

I am thinking that as long as the class was unlocked by the main char other chars could choose the class...

but it would be nice if some of the chars were locked from touching certain classes...
Well, I'll see what I can do for you. My scripting knowledge is rather basic and my biggest problem would be figuring out how to make it so Prexus' Window_ClassPick only shows certain classes. So far the only way to manipulate which classes are shown is by changing the @item_max which will reduce the number of classes shown, but not let you pick and choose which classes you want. (This is how I currently have it set to "unlock" jobs in a Final Fantasy V manner, by simply changing the @item_max to include or exclude classes) I haven't ever really played around with the window classes, so I'm not to totally sure how to do this. If somebody can help me figure that out, I should be able to build the rest of the system that wsensor talked about. I'll mess around with trying to change it, like I have done with pretty much everything else, but if somebody with more scripting knowledge/knowledge of window classes can help, it would be greatly appreciated. I'll try and see what I can figure out for you over the weekend wsensor. Hopefully I can think of something.
could you use hash stuff?
like include only the jobs available in a hash?

I think I saw it in another job script but it does not have separate job levels like this one...
Yeah.... I have VERY basic scripting knowledge, and I don't even know what hashing is... (wow, that sounds awful reassuring about my plugin, doesn't it?) Like I said before, I pretty much learned all I know from changing random bits here and there and seeing what happened. Let me look into hashing to see what exactly it is and see if I can't implement. Thanks for the suggestion wsensor =)
I've going to be putting out a large update to this script within a week or so, including a majority of the features that have been mentioned in this thread. This make may your script null, scarecrow, but thank you for helping support my script in my lack of interest.
Well, I am really looking forward to your update Prexus, as this script is one of my personal favorites (as well as pretty much essential for the game I am making). I am really excited that you will be releasing an official addition to the script as the workarounds I had provided to add features were not very well done and I am looking forward to the easily customizable options etc. As far as making my script null, I really don't mind as this was more of a learning experience than anything for me. I've gone from having absolutely no knowledge of scripting to being able to implement features and having a basic understanding of ruby (ie methods, classes, etc.) I apologize if it appeared that I hijacked your thread/script for my own purposes, but that really wasn't my intention. I simply wanted to alter the script for my own use and intentions, and because there were features others were interested in, I posted it here. Anyways, please accept my apologies for essentially hijacking your script, and I really look forward to your update. Best wishes.

--Scarecrow580
Is there any way to implement special proficiencies for specific characters?
AKA: the main character can always weild the King's Sword, no matter what his class, while no other character can?
Also, sorry for any typos. Hard to type on a Wii.
hi. serious noob here.

haven't tried to use the script yet but i'm thinking it'll work for my game idea. one question: any way to unlock the class system (and, for that matter, change party system) later into the game instead of having it available from the beginning? again, apologies if this question is incredibly rudimentary.
Sorry, one more quick question: in using scarecrow's script, I'm going to have multiple class databases. What I want to do is make a game in which each character has access to about 4 classes, but not from the very beginning. Example: main character starts with access to warrior and thief, later in the game adds on paladin, then much later can also switch to a fourth class. Would the only way to do this be to create a separate class database for each character, and then another one for that character when he/she adds on new classes?

Feel free to e-smack me if this makes no sense.
I guess where just gonna have to wait for Prexus or Scarecrow to make more addons...
Prexus stated he will be releasing his new version within a week, so I suggest waiting for the next version to see what all is included. If need be, I can try and implement any features you want for you, but we should wait to see if Prexus includes the features you are interested in or if he plans on adding them. Additionally, any features I would try and add on now, probably wouldn't fit with the new version so I would have to re-write them. So after the release of the new version, I would be more than happy to try and help anybody, given that Prexus doesn't mind, of course.
First day using VX, i know a few bit's and bobs about it. I really liked the look of this script so i thought i would give it a go and i added scarecrows add-on.

The thing i want to do is, for example: Allow change to Paladin when lvl 30 (or w.e) I found the bit in scarecrows add on that allows you to do this and i have read it, only trouble is it makes no sense to me, can someone quickly give me an idea on how to change it for future reference xD, sorry for the hastle  ¬Ã‚ ¬.
Prexus, ive noticed something that could go wrong with your script that I think should be looked into.
If a player is level 60 and gets a new job, then kills a monster.. he can easily gain several levels in that job at a time.
Suggestion? Make it so that you can set how many "job points" a monster, or group of monsters, can give.. You must reach X job points to reach a level in that job.

Also
Is it possible to make it like FF5 so that you can use a skill of another class, you can use a single skill of that class for another job? Or something similar to this... Or make it like FF11 where you can have a level 10 warrior/level 5 cleric as long as both classes are level 10? (That would be made easy by assigning each class a variable, than when it asks, "Pick your secondary class" It automatically divides that secondary class by 2 until it's reassigned, then it brings it back to the level it use to be) (Let me clarify on this - The secondary class can NEVER be higher than 50% of the main class in levels.. This is to balance it out)
Also when someone levels up their actually class, can it be an option to set their "Stat gain" Depending on the class that they currently are? (such as change it so that the maker can set the minimum value and the maximum value, which would create it's own curve)
And one more suggestion.. Adding a "Custom commands menu" To alter the various commands, and when you turn into one class, it automatically takes one of the commands and turns it into the command that goes along with that class.. Example - I have a barbarian class... I choose it with one of my characters. He now gets the "Rage" ability where "Skill" use to be.

One more idea - Make special "Passive" Traits added on to the script so that you can make classes that actually give a passive trait depending. Such as higher crit etc... And make it compatibile with tankentai 2.7.. Thanks Prexus, you rock.
Quick question: I got the whole menu thing down, but is there a way to hide the job change part of the menu until a certain switch has been activated. So that the player characters can't change jobs until after they do the quest that unlocks that power. Or whatever.
Hey Prexus, I just wanted to see ow that update was coming along. I'm rther excited to see what you will be implementing. Hopefully all is well. Best wishes.
I am having a big problem. Everytime I go to the event that has the job changer as soon as I talk to the event it tells me windows selectable line 32 error. it refuses to work.
What will the update include?

I made a addon for the prexus script already which allows you to select what characters classes are and also allow you to add new classes during the game.

Script:
Content Hidden Spoiler
#==============================================================================
#  Job changer(v1.0)-addon -Selectable Classes
#------------------------------------------------------------------------------
#  This add on allows you to know pick selectable classes for Prexus job changer
#  script. In order to assign a character to a class you must use the config
#  in the following format: AVAILABLE_CLASSES[actor.id]={1=>class.id,
#  2=>class.id...}.
# 
#  New script commands: Used in script in Event Commands
# 
#  Character_Class.new_class(actor,class_id):
# 
#  Adds a class to the selected actor
#  e.g. Character_Class.new_class(1,6): Ralph learns Dark Knight or 
#  Character_Class.new_class($game_party.members[2].id,6): party member 3 learns
#  Dark Knight
#
#   Character_Class.remove_class(actor_id,class_id): Removes Class from character
#  doesn't work if character has class or is currently at that class
#  Not 100% tested please report any bugs
#
#==============================================================================

# Config

# AVAILABLE_CLASSES[actor.id]={1=>class.id,  2=>class.id...}.

# Notes: make one for each actor or you will get an error

AVAILABLE_CLASSES=[]#Don't change

# Actor 1 Ralph -> Paladin, Warrior, Magican
AVAILABLE_CLASSES[1] = {
1 =>1,
2=>2,
3=>4}

# Actor 2 -> Paladin, Warrior, Priest
AVAILABLE_CLASSES[2] = {
1 =>1,
2=>2,
3=>3
}

# Actor 3 -> Paladin
AVAILABLE_CLASSES[3] = {
1 =>1
}
# Actor 3 -> Paladin, Knight
AVAILABLE_CLASSES[4] = {
1 =>1,
2 =>5
}
AVAILABLE_CLASSES[5] = {
1 =>1,
2 =>5
}
#------------------------------------------------------------------------------
#Script
#==============================================================================
class Character_Class
   
   def self.new_class(actor,class_id)
     @ava_class = AVAILABLE_CLASSES[$game_actors[actor].id]
     @ava_class[@ava_class.length+1] = class_id unless @ava_class.has_value?(class_id)
   end
   
def self.remove_class(actor,class_id)
    @ava_class = AVAILABLE_CLASSES[$game_actors[actor].id]
    if @ava_class.has_value?(class_id) 
    if $game_actors[actor].class_id!= class_id
    if @ava_class.size > 1
    @lose = @ava_class.index(class_id)
    @ava_class.delete(@lose)
    for i in @lose...(@ava_class.size+1)
      @ava_class[i] = @ava_class[i+1]
    end
    end
    @ava_class.delete(@ava_class.size) unless @ava_class[@ava_class.size] != @ava_class[@ava_class.size-1]
  end
  end
  end
   
end
 
class Window_CurrentParty < Window_Selectable

alias vitalice_addon_init initialize
 
  def initialize
    vitalice_addon_init
    @item_max = $game_party.members.size
  end
end

class Window_ClassPick < Window_Selectable
 
  def item

  return  $data_classes[AVAILABLE_CLASSES[member.id][self.index + 1]]
  end
 
  def refresh
    @item_max = AVAILABLE_CLASSES[member.id].size 
    @y = 0
    y = 0
    for i in 0..$data_classes.size - 1
     rect = item_rect(i)
      self.contents.clear_rect(rect)
    end
    for i in 1..@item_max
      @y+=WLH
      w = self.contents.width
      self.contents.font.color.alpha = (@member.class_id == $data_classes[AVAILABLE_CLASSES[member.id][i]].id ? 128 : 255)
      self.contents.draw_text(0, y+@y-WLH, w, WLH, $data_classes[AVAILABLE_CLASSES[member.id][i]].name)
      level = @member.class_level[$data_classes[AVAILABLE_CLASSES[member.id][i]].id]
      self.contents.draw_text(0, y+@y-WLH, w, WLH, "Lv. " + level.to_s, 2)
    end
  end
end


Assigning classes to characters in this script is simple just make a new Variable at the top called AVAILABLE_CLASSES[(actor_id)] then  assign each class by by AVAILABLE_CLASSES[(actor_id)]= {1=> class_id, 2=>class_id2...}. Do for each character in your game.

Also allows you to add a class to character through events  Character_Class.new_class(actor,class_id) script. Hopes this helps
This is an awesome script, very useful, I'm just wondering, is there a script command so I can change an actor's job via an event without bringing up the changing menu? If there already is one, I'm going to feel so stupid. Lol.

Sam.
BUMP !
I am curious whether the update will be posted soon or not. :)
Bump once more.

I am still rather curious about this one Prexus. Hopefully all is well?
Best Wishes.

-Scarecrow580
Okay I have a quick question about scarecrow580 plug in for this script. Is there a way to take out the job changes feature, yet keep the % stat bonuses for certain jobs?
awww... I want one script like this one for RMXP....
With regards to the script posted by Alexnard, I am having issues.

I've tried using it a bunch of different ways and still get the same errors.

It says this, "Cannot convert hash into integer"

and the error is referenced to this line of code:

      self.contents.font.color.alpha = (@member.class_id == $data_classes[AVAILABLE_CLASSES[member.id]].id ? 128 : 255)
Expand to see the code.


I am not a scripter and this doesn't seem too complicated a problem, but I am stumped.

Is there anyone who can offer some advice to why I'd be getting this hash/integer error?

I have tried this script in both my current project and a new project and keep getting the same errors.
Fist off I would like to say thank you for making such a well programed script. However I'm stuck on the unlocking part of the script. I do know a few Programing languages, however I don't know anything about Ruby and have yet taken the time to learn the language.

#-----------------------------------------------------------------------------
  # This is an Alteration Of a Piece of Prexus' Script. It Has Been Altered
  # Such That You Can Unlock Jobs in a Final Fantasy V Manner. While This
  # Is Slightly Confusing, It Is Rather Easy To Implement. In The Code Below,
  # There is a Marked Section Where, If You Want The Jobs Unlocking System,
  # You Will Alter The Line As Indicated Below, Else, Leave it Alone.
  # The n Below, Is to be Replaced With The ID of a Variable. In Order To Use
  # The Job Unlocking System, You Must Set Variable n to a Number. If The
  # Variable is Set to 1, All Jobs Are Available. If the Variable Is Set Greater
  # Than 1, For Each Unit Above One, One Job Will Be Left Off The Job Selection
  # List. So, If The Variable Is 2, The Last Class In Your Classes Tab Will
  # Be Left Off The List. In Order to Unlock Jobs, Begin The Game With A Higher
  # Variable Number, and When New Jobs Are Unlocked, Simply Alter The Variable
  # To a Lower Number, Eventually Reaching 1 (ie. All Jobs Available)
  # This Can Additionally Be Used To Create Classes Which The Player Is Never
  # Aloowed To Select. Simply Make The Unselectable Class The Lowest Class In
  # The Classes Tab. Then, Make The Variable Never Equal to One. In This Way,
  # This Class Will Never Be "Unlocked".
  #-----------------------------------------------------------------------------
class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    #@item_max = $data_classes.size - 1 # Replace 1 with $game_variables.[](n)
####################################################
#From the explanation from above this is what I understand how to implement this code.
$test  =  5 
@item_max = $data_classes.size - $game_variables.[]($test)
#Then change the code through the Event commands >> advance >> script
#however when I do it this way all the jobs show. I am missing something and am in hopes that
#someone could explain how to set this up properly.
####################################################
  create_contents
    @member = member
    self.index = -1
    self.active = false
    refresh
  end
end

Thank you for your time.

SKi
Quote:
class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    #@item_max = $data_classes.size - 1 # Replace 1 with $game_variables.[](n)
####################################################
#From the explanation from above this is what I understand how to implement this code.
$test  =  5
@item_max = $data_classes.size - $game_variables.[]($test)
#Then change the code through the Event commands >> advance >> script
#however when I do it this way all the jobs show. I am missing something and am in hopes that
#someone could explain how to set this up properly.
####################################################


The problem is that $game_variables.[]($test) with $test = 5 tells the code to look at the fifth variable and use that value. I believe you probably have your fifth variable set to 0 (or undefined, thus the game takes it as zero). I decided to use the $game_variables.[](n) form so that non-scripters could simply change the variable without calling a scripting event. If you want to change it through a scripting event, instead use this:

class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    @item_max = $data_classes.size - $test
Expand to see the code.


Then it will use the value of $test instead of using the value of $test to specify a variable to use. Hopefully this answers your question? If not, just let me know and I will try to explain it more clearly. Best wishes.

--Scarecrow580
I require your help.....
I keep getting the following error after simply taking the script from the demo and inserting it into the game above all other scripts...

the error is as follows:



??? Profession? 437????No method error
undefined method [] fornil:NilClass

I have over 6 classes

PLEASE HELP!!!!!!!
I get an error when I have less than 4 party members. It occurs when I move over to the black spot (Where the 4th party member would be). It reads
Quote:
Script 'Profession' line 434: NoMethodError occurred.
Undefined method 'clss_id' for nil:NilClass

which is
self.contents.font.color.alpha = (@member.class_id == $data_classes[i].id ? 128 : 255)
Expand to see the code.

Help?

EDIT:

Your Job Changing and Party Scripts have a compatibility issue. When both are in the game "Party below Job below Materials" The Job script will mess up if you have less than 4 characters and go to a blank line. It does this by itself too, but I changed part of the code to:

class Window_CurrentParty < Window_Selectable
  def initialize
    super(48, 80, 256, 64)
    @item_max = $game_party.members.size 
    @column_max = @item_max
    create_contents
    self.index = 0
    refresh
  end
Expand to see the code.


So it will work when it is by itself, but still not with the Party Changer. I don't know which to put on top of the other. Putting the party changer on top of the job changer with the edited code will stop the error, but it causes a new one. The party size will go down from 4 to 3 and stay that way in the Party changer (Only 3 max members vs 4) and works when you take, 2 or 3 members out of the party as well.
Picture:
Content Hidden Spoiler
I have a question about this script. When you use it, can you make certain classes be able to change to another class? (ex. Priest lv30 ONLY to Pope)
Hello! I'm a newbie when it comes to scripting since i just got a copy of VX a few days ago...
Great scripts you got here and I'm using Scarecrow's plug-in right now...

Anyways, for those who are using Dargor's CMC, add this script below the plugin:
Content Hidden Spoiler
#==============================================================================
# ** Custom Commands - Prexus' Job Changing System
#------------------------------------------------------------------------------
#   © SowS, 2008
#   12/05/08 
#------------------------------------------------------------------------------
#   Instructions:
#   As usual, paste this above main but BELOW Prexus' Job Changer...
#   Now, in his class changer, you will see this in line 163
#       $scene = Scene_Map.new
#   Change this into:
#       $scene = Scene_Menu.new
#   If you are using Scarecrow's plugin, delete all lines starting from line 694
#     to the last line.
#==============================================================================

# Vocabulary
Vocab::ClassChange = 'Job'

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#   This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias sows_vx_cmcclasschange_menu_create_command_window create_command_window
  alias sows_vx_cmcclasschange_menu_update_command_selection update_command_selection
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    commands = $game_system.menu_commands
    index = commands.index(Vocab::save)
    $game_system.add_menu_command(index, Vocab::ClassChange)
    sows_vx_cmcclasschange_menu_create_command_window
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    sows_vx_cmcclasschange_menu_update_command_selection
    command = @command_window.selection
    if Input.trigger?(Input::C)
      Sound.play_decision
      case @command_window.selection
      when Vocab::ClassChange
        $scene = Scene_ClassChange.new
      end
    end
  end
end


My instructions are there.
okay, so i'm going to do my job system mostly sans scripts, since i can't script really and i haven't found something that suits my needs. i am going to create items called "change character" (character being the person's name) for each character that can change classes. using the item will pull up a common choice event to switch the character's class. this will allow me very easily to change what classes each character can use without having to rely on scripts or multiple databases, etc., even if it's a bit clunky (works for me; in my game there won't be the need to change classes all that often, more like once or twice a dungeon, and each character in my game will only use up to four classes anyway). should only need a few switches/variables to make it run.

so, my question is, is there a way i can use one of the scripts posted so that i can still do a lot of the fun stuff with jobs - specifically having stat bonuses, job levels/experience, and keeping learned skills/job levels when changing jobs - while still using my rinky dink way of changing jobs? also if you can already see a problem with the way i've thought out how to do this, please let me know. thanks.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=42990