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.

[VX]JobChanger [Complete]

Baka Artses Studios Inc. of RPGMakerVX.net requested this script, so I figured what the hell... why not?

What this script does:

This script basically gives you a menu within which you can change your characters class.

This script is fully working and (crosses fingers) 100% bug free!!!!

Screen Shot:
http://img73.imageshack.us/img73/8346/jobchangerscreenshotnv1.jpg[/img]

Demo:
http://www.mediafire.com/?iujmelhdymv

Script:
Code:
#==============================================================================
# ** Scene_Job
#------------------------------------------------------------------------------
# This Script was written by The Black Knight
# (aka tk_blackknight, aka Keith Brewer, aka rockstar1986)
# 
# IF YOU USE THIS SCRIPT, ALL I ASK IS THAT YOU PUT MY NAME IN THE CREDITS
#	   It's free to use as long as you do put me in the credits.
#
#
# WHAT IT DOES:
# This script basically just gives you a graphical interface to allow
# the player to select which job to switch to for a character.
#
# This script was created upon request by Baka Artses Studios Inc. 
#==============================================================================

class Scene_Job < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 actor_index : actor index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, from_menu = false)
	@actor_index = actor_index
	@from_menu = from_menu
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
	super
	@actor = $game_party.members[@actor_index]
	create_menu_background
	@actor = $game_party.members[@actor_index]
	@class_status_window = Window_ClassStatus.new(@actor)
	@scenename_window = Window_SceneName.new(0, 0, "Job Change")
	@help_window = Window_Help.new
	@help_window.x = 160
	@help_window.y = 0
	@help_window.width = 384
	create_class_list
	create_option_list
	
	@command_window.active = false
	@command_window2.active = true
  end
  #--------------------------------------------------------------------------
  # * Create Option List
  #--------------------------------------------------------------------------
  def create_option_list
	s1 = "Change Class"
	s2 = "Cancel"
	@command_window2 = Window_Command.new(544, [s1, s2], 2)
	@command_window2.x = 0
	@command_window2.y = 56
	@command_window2.height = 56
  end
  #--------------------------------------------------------------------------
  # * Create Class List
  #--------------------------------------------------------------------------
  def create_class_list
	s1 = $data_classes[1].name
	s2 = $data_classes[2].name
	s3 = $data_classes[3].name
	s4 = $data_classes[4].name
	s5 = $data_classes[5].name
	s6 = $data_classes[6].name
	s7 = $data_classes[7].name
	s8 = $data_classes[8].name
	@command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6, s7, s8], 2)
	@command_window.x = 0
	@command_window.y = 240
	@command_window.height = 176
  end  
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
	super
	dispose_menu_background
	
	@class_status_window.dispose
	@scenename_window.dispose
	@command_window.dispose
	@command_window2.dispose
	@help_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Switch to Next Actor Screen
  #--------------------------------------------------------------------------
  def next_actor
	@actor_index += 1
	@actor_index %= $game_party.members.size
	$scene = Scene_Job.new(@actor_index, @from_menu)
  end
  #--------------------------------------------------------------------------
  # * Switch to Previous Actor Screen
  #--------------------------------------------------------------------------
  def prev_actor
	@actor_index += $game_party.members.size - 1
	@actor_index %= $game_party.members.size
	$scene = Scene_Job.new(@actor_index, @from_menu)
  end
  #--------------------------------------------------------------------------
  # * Update Class Selection Window >> This allows it to check for input
  #--------------------------------------------------------------------------
  def update_class_selection
	if Input.trigger?(Input::B)
	  Sound.play_cancel
	  @command_window2.active = true
	  @command_window.active = false
	elsif Input.trigger?(Input::C)
	  Sound.play_decision
	  case @command_window.index
	  when 0
		@actor.class_id = 1
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 1
		@actor.class_id = 2
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 2
		@actor.class_id = 3
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 3
		@actor.class_id = 4
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 4
		@actor.class_id = 5
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 5
		@actor.class_id = 6
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 6
		@actor.class_id = 7
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  when 7
		@actor.class_id = 8
		$scene = Scene_Job.new(@actor_index, @from_menu)
	  end
	end
  end
  #--------------------------------------------------------------------------
  # * Update Class Selection Window >> This allows it to check for input
  #--------------------------------------------------------------------------
  def update_option_selection
	if Input.trigger?(Input::B)
	  Sound.play_cancel
		if @from_menu == false
		  $scene = Scene_Map.new
		else
		  $scene = Scene_Menu.new
		end  
	elsif Input.trigger?(Input::C)
	  Sound.play_decision
	  case @command_window2.index
	  when 0
		Sound.play_decision
		@command_window.active = true
		@command_window2.active = false
	  when 1
		Sound.play_decision
		if @from_menu == false
		  $scene = Scene_Map.new
		else
		  $scene = Scene_Menu.new
		end		
	  end
	end
  end  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	update_menu_background
	if @command_window.active
	  #If the Command Window is active, tell the help window to say this:
	  @help_window.set_text("Change to which class?")
	else
	  #Otherwise, tell it to say this:
	  @help_window.set_text("")
	end
	if @command_window2.active
	  update_option_selection
	else
	  update_class_selection
	end
	@command_window.update
	@command_window2.update	
	@class_status_window.update
	@help_window.update
	if Input.trigger?(Input::R)
	  Sound.play_cursor
	  next_actor
	elsif Input.trigger?(Input::L)
	  Sound.play_cursor
	  prev_actor
	end
	super
  end
end
#==============================================================================
# ** Window_ClassStatus
#------------------------------------------------------------------------------
#  This window displays full status specs on the Job Change screen.
#==============================================================================

class Window_ClassStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
	super(0, 112, 544, 128)
	@actor = actor
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	draw_actor_name(@actor, 128, 0)
	draw_actor_class(@actor, 128, 24)
	draw_actor_face(@actor, 0, 0)
	draw_actor_graphic(@actor, 96, 96)
	draw_basic_info(216, 0)
#~	 draw_parameters(32, 160)
	draw_exp_info(364, 0)
#~	 draw_equipments(288, 160)
  end
  #--------------------------------------------------------------------------
  # * Draw Basic Information
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_basic_info(x, y)
	draw_actor_level(@actor, x, y + WLH * 0)
	draw_actor_state(@actor, x, y + WLH * 1)
	draw_actor_hp(@actor, x, y + WLH * 2)
	draw_actor_mp(@actor, x, y + WLH * 3)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameters
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
#~   def draw_parameters(x, y)
#~	 draw_actor_parameter(@actor, x, y + WLH * 0, 0)
#~	 draw_actor_parameter(@actor, x, y + WLH * 1, 1)
#~	 draw_actor_parameter(@actor, x, y + WLH * 2, 2)
#~	 draw_actor_parameter(@actor, x, y + WLH * 3, 3)
#~   end
  #--------------------------------------------------------------------------
  # * Draw Experience Information
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_exp_info(x, y)
	s1 = @actor.exp_s
	s2 = @actor.next_rest_exp_s
	s_next = sprintf(Vocab::ExpNext, Vocab::level)
	self.contents.font.color = system_color
	self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
	self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
	self.contents.font.color = normal_color
	self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 0)
	self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 0)
  end
  #--------------------------------------------------------------------------
  # * Draw Equipment
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
#~   def draw_equipments(x, y)
#~	 self.contents.font.color = system_color
#~	 self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
#~	 for i in 0..4
#~	   draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
#~	 end
#~   end
end
#==============================================================================
# ** Window_ClassStatus
#------------------------------------------------------------------------------
#  This window displays full status specs on the Job Change screen.
#==============================================================================

class Window_ClassStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
	super(0, 112, 544, 128)
	@actor = actor
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	draw_actor_name(@actor, 128, 0)
	draw_actor_class(@actor, 128, 24)
	draw_actor_face(@actor, 0, 0)
	draw_actor_graphic(@actor, 96, 96)
	draw_basic_info(216, 0)
#~	 draw_parameters(32, 160)
	draw_exp_info(364, 0)
#~	 draw_equipments(288, 160)
  end
  #--------------------------------------------------------------------------
  # * Draw Basic Information
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_basic_info(x, y)
	draw_actor_level(@actor, x, y + WLH * 0)
	draw_actor_state(@actor, x, y + WLH * 1)
	draw_actor_hp(@actor, x, y + WLH * 2)
	draw_actor_mp(@actor, x, y + WLH * 3)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameters
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
#~   def draw_parameters(x, y)
#~	 draw_actor_parameter(@actor, x, y + WLH * 0, 0)
#~	 draw_actor_parameter(@actor, x, y + WLH * 1, 1)
#~	 draw_actor_parameter(@actor, x, y + WLH * 2, 2)
#~	 draw_actor_parameter(@actor, x, y + WLH * 3, 3)
#~   end
  #--------------------------------------------------------------------------
  # * Draw Experience Information
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_exp_info(x, y)
	s1 = @actor.exp_s
	s2 = @actor.next_rest_exp_s
	s_next = sprintf(Vocab::ExpNext, Vocab::level)
	self.contents.font.color = system_color
	self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
	self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
	self.contents.font.color = normal_color
	self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 0)
	self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 0)
  end
  #--------------------------------------------------------------------------
  # * Draw Equipment
  #	 x : Draw spot X coordinate
  #	 y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
#~   def draw_equipments(x, y)
#~	 self.contents.font.color = system_color
#~	 self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
#~	 for i in 0..4
#~	   draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
#~	 end
#~   end
end
class Window_SceneName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 x : window X coordinate
  #	 y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y, text)
	super(x, y, 160, 56)
	@text = text
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	self.contents.draw_text(4, 0, 128, WLH, @text, 1)
  end
end


I hope you enjoy the script, its my FIRST ONE! :D
(When I say this is my first script, I mean my first released script! lol)

Please feel free to give me feedback/suggestions on this script, so that I might improve in the future.
 
Dude. Thanks a lot. I don't have to do this through eventing anymore >.<

-Is happy.-

Thanks again!
Sasame Kiryu
Baka Artses Studios Inc.
 
Great script!

I'm no good at scripting, but I could see a lot of cool additions to this script, like certain Actors not being able to change their class; being able to change a characters base stats and stat growth via jobs; etc.

Awesome script none the less!
 
Oh, one other addition I'm sure a lot would enjoy is being able to unlock certain classes by numerous conditions. (Some of which I can think of right now: Based on anoter class (one or more) level(Like Final Fantasy Tactics). And via script as a reward from quests and such.)

Thanks a ton for taking these idea's into heart. I find this script very useful with a project I'm currently working on, and would love to see these features implemented!

::Edit::
I did some battle and experience testing.
I set the reward experience to max for killing a test monster, and upon victory I received the "-name- is now -Class- Level 75!" but when I went to change my class, it said my class level was only level 2. I'm assuming that the class level is only going to the next level (from level 1 to 2) instead of jumping from 1 to 75.

(It may be the battle system I'm using is conflicting, but I do not see why that would be affecting it.)
 
hmm.. what script are you using? because by default, classes don't have levels, only the actors have levels, and when you change an actors class, they're level is left unchanged.

and I don't see how my script would conflict with that seeing how it doesn't change or touch any variables or globals at all. also, if you have yahoo or msn messenger, send me a PM with your SN, I'd love to chat with you about your ideas for my script.
 
Ahh, my mistake. I had downloaded your script and another job class script to test them both. I mistook the other script as yours.
Right now I am using yours in the project I'm currently messing around on.

PM'ed you my sn.
 

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