iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> MultiTeired Class System / Promote Item (v 2.0c), Now supports class based promote routes.
Rating 5 V
Mithran
post Feb 28 2009, 05:49 AM
Post #1


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




MultiTeired Class System / Promote Item v 2.0c
by Mithran


Introduction
Lets start off by saying that this is not a 'job changer' script or anything of the like. The basis of this script is to have different method of changing classes either at certain game stages, or through the use of an item. This intent for this script is when you want actors to 'upgrade' their class to a different, better class, at some point in the game. Both can be accomplished by using lots of different 'promote' items, some creativeness and the use of LOTS of conditional branches and event commands, this simply makes it much, much eaiser and adds a few other options.

Features
- set up a specific 'promote' route for each actor in the customization section
- set up level requirements for promotion
- use an item or event to 'promote' characters.
- option to include or exclude the 'old' classes skills when changing class
- option to inherit the 'new' classes skills (if you are past the learn level) when changing class
- option to display class tier on the menu or status screens
- option to reset level on class change and keep a portion of the old class' leveled stats
- The item will not be used if it cannot promote
- class based promote routes are now available

How to Use
Install on its own script page in the materials section of the script editor above main and below default scripts.

Script
Spoiler:
CODE
## Multitiered Class System / Promote Item
# By Mithran at RMVX.net
# Requested by Roxas210 at RMVX.net
# Additional Features requested by Deccy Bon at RMVX.net
# v 2.0c
# Last Update May 25, 2009
# Please do not redistribute without asking!
# Adds a class change effect to an item.  The class change will 'promote' an
# actor to their next tier class.

# In the note field of the item you want to promote, type
# <promote n>
# Where n is the class tier you want to promote.  
# Example:
# <promote 1> is used on Ralph, default class of paladin and tier 1 class of
# Knight.  Ralph will become a knight.  If used on Ralph when he is a Knight, it
# will buzz you and the item will not be consumed.

# If actor based promotion sets are used, starting class is always known as
# tier 0 (unpromoted)
# If class based promotion sets are used

# Actor based class tiers are set up in the module.  
# If they are not, the script assumes the next class down on the list is the
# promote class.  Eg., Ralph would promote from Paladin to Warrior by default
# If you are using class based class tiers, they MUST be defined in the module
# There is no autosetup for class based.

# Using an normal evented "class change" will break actor based promotes.  
# NOTICE: Using an evented / outside class change is now supported if the class
# based promotion system is used.  The script will autocorrect to the correct
# 'tier' if this method is used.  This should only be used if you want to change
# an actor to a class outside his class' normal promotion path.
# Whenever possible, you should use the below method instead.

# If you require a forced promote, use the Advanced > Script Command and one of
# the following:

# promote_actor(actor_id)
# replace actor_id with the number of the actor you are promoting.  They will move
# up one tier, if available

# promote_member(group_id)
# Promotes the specified member in your group, if they exist.  
# group_id is replaced by 0 for the first member of the group, 1 for the 2nd, etc.

# demote_actor(actor_id)
# demote_member(group_id)
# same as the above, except they demote the actors.

# NOTICE:  These two command names have changed from v 1.0b
# actor_change_tier(actor_id, tier, demote?)
# member_change_tier(member_id, tier, demote?)
# Same as the above, but they make the actor the specified tier class.  If the
# tier is out of range, or they are already the selected tier, nothing
# will happen.  The demote flag is optional.  If it is true, the class change
# will demote.  If it is false or omitted, the class change will not demote.
# Example:
# actor_change_tier(1, 1) will change Ralph to his tier 1 class
# If he is above tier 1, he will remain at that tier

# Install: Insert in the materials section of the script editor above main and
# below custom scripts.

# = = = = = = = = = = = = = = = = CUSTOMIZATION = = = = = = = = = = = = = = = =

module Mithran
  module PromoteItem
    SYSTEM = 0
# 0 = Use Actor Based Class Tiers
# 1 = Use Class Based Class Tiers
# See below for indiviudal setup
    
    ONSCREEN_TIER_FORMAT = 4
    # 0 = disabled
    # 1 = draw to the right of character class on status menu
    # 2 = draw below character level on status menu
    # 3 = draw to the right of characer class everywhere*
    # 4 = draw to the right of character level everywhere**
    # false = disabled
    # * (does not fit on menu with default settings)
    # ** (will draw over HP if class tier passes 9)
    
    # These next four options only apply to drawing the Class Tier
    ONSCREEN_TIER_COLOR = Color.new(255, 132, 132, 255)
    # The color of the text for onscreen tier in format Color.new(red, green, blue, alpha)
    ONSCREEN_TIER_SIZE = 20
    # The font size for drawing class tier
    ONSCREEN_TIER_BOLD = false
    # true = bold, false = not bold
    ONSCREEN_TIER_TEXT = "CLv"
    # Vocab used to before displaying tier level
    
    RESET_LEVEL = false
    # If you set this to a true, a promoted actor will be taken down to level 1
    # when changing class.  See the next two options for further customization.
    RESET_LEVEL_KEEP_STATS = false
    # Allows you to keep a portion of the stats from your previous level when
    # you level down.  Set this to a number from 0 to 100 to activate, and that
    # percent of the current leveled parameters will be carried on to when level
    # is reset.
    # This will also keep the stats if another script levels down the actor for
    # whatever reason.
    # Set to false to disable.
    # Eg.,
    # RESET_LEVEL_KEEP_STATS = 50
    # If the character gained 30 atk from leveling, they will keep +15 when
    # leveled down.
    LEVEL_DOWN_LOSE_SKILL = false
    # Lose skills when you level down after a class change.  Only applies if
    # level is reset above.  If you want to lose all class skills on a class
    # change, use the below option CLEAR_SKILLS
    # Losing levels outside this script will still retain skills.
    
    ALLOW_TIER_SKIP = true
    # If set to true, using a promote item from higher on the list will skip
    # tiers.  Example, skipping from Paladin (tier 0) to Priest (tier 2) would
    # be allowed
    
    CLEAR_SKILLS = false
    # If set to true, removes all skills learned from the previous class when
    # changing class.  Otherwise, they will be kept.
    
    INHERIT_SKILLS = true
    # If set to true, when changing class, the actor will gain all the skills
    # from the levels that they missed.  Normally, they would 'miss' these
    # skills and not be able to learn them if they already passed the learn
    # level
    
    DEFAULT_REQUIRED_LEVELS = [0, 0]
    # the default levels required to promote to each class tier
    # if set to 0 or omitted for the class tier, there is no level requirement
    
    REQUIRED_LEVELS = [] # DO NOT CHANGE THIS LINE
    # The required levels for each class tier.  This can be set indiviudally,
    # for each actor (or class, depending on the system used).  If ommited, the
    # default above will be used
    # Example:
    REQUIRED_LEVELS[1] = [10, 25]
    # If actor based promotion is used, this will require Ralph to be level 10
    # before promoting to tier 1, and level 25 before promoting to tier 2
    # If class based is used, this will require Class 1 (paladin) to be
    # level 10 before promotion to tier 1, and level 25 before promoting to tier 2
    # If using class based tiers, the required level for tier 0 is always assumed 0
    # **Evented demotes always ignore level requirements
    
# = = = = = = = = = = = = = = = = ACTOR BASED = = = = = = = = = = = = = = = = =
    # This section ONLY applies if Actor Based Class Tiers are used
    
    PROMOTE_MAX = 2
    # The max amount of class promotes allowed by default.  This is only for
    # auto setup, and will be ignored if all actor promotes are defined.
    # Auto setup only works for actor based class promotions
    

    ACTOR_PROMOTES = [] # DO NOT CHANGE THIS LINE
# Setup individual actor promote routes in the section below
# Format is ACTOR_PROMOTES[actor_id] = [tier1, tier2, ... tiermax]
# *Initial class is assumed as 'tier zero'
# Scroll down for examples.
    
# FORMATTING FOR ACTOR PROMOTES HAS NOT CHANGED SINCE V 1.0
# IF YOU ARE USING ACTOR DEFINITIONS FROM BEFORE V2.0, YOU MAY COPY PASTE THEM
# OVER THE BELOW SECTION

# DEFINE YOUR ACTOR PROMOTE SETS BELOW THIS LINE.  CHANGE ANY OF THE EXISTING
# LINES BELOW AS YOU SEE FIT
    ACTOR_PROMOTES[1] = [6, 5]
    ACTOR_PROMOTES[2] = [5, 7]
    ACTOR_PROMOTES[3] = [1, 5]
    ACTOR_PROMOTES[4] = [8]
    

# DEFINE YOUR ACTOR PROMOTE SETS ABOVE THIS LINE.  CHANGE ANY OF THE EXISTING
# LINES ABOVE AS YOU SEE FIT

# EXAMPLES:
#    ACTOR_PROMOTES[1] = [6, 5]
# Ralph's two promotes are 'dark knight' and 'knight'  His initial class is
# defined in the database (default is paladin)

#    ACTOR_PROMOTES[2] = [5, 7]
# Ulrika's two promotes are 'knight' and 'grappler'

#    ACTOR_PROMOTES[3] = [1, 5]
# Bennett's two promotes are Paladin and Knight.

#    ACTOR_PROMOTES[4] = [8]
# Ylva's only promote is thief.

# For all other actors, their promote lists would be assumed as the two classes
# directly following them on the class list.  For example, Lawrence
# (default Knight, class 5), would promote to classes 6 (dark knight) and
# 7 (grappler)
    
# = = = = = = = = = = = = = = = = CLASS BASED = = = = = = = = = = = = = = = = =
# This section ONLY applies if Class Based Class Tiers are used
# The setup here is slightly different from actor based.  

# UNLIKE WITH ACTOR BASED CLASS TIERS ABOVE, TIER ZERO MUST BE DEFINED HERE
# EVERY CLASS SET MUST BE DEFINED.  ANY CLASS OMITTED WILL BE PERMANTELY TIER 0
# Format is CLASS_SETS[class_id] = [tier0, tier1, tier2 ... tiermax]
# THE CLASS ITSELF SHOULD BE INLCUDED ONCE AND ONLY ONCE ON THE RIGHT
    CLASS_SETS = []  # DO NOT ALTER OR DELETE THIS LINE
# DEFINE YOUR CLASS SETS BELOW THIS LINE.  CHANGE ANY OF THE EXISTING LINES BELOW
# AS YOU SEE FIT
# SCROLL DOWN FOR EXAMPLES
    CLASS_SETS[1] = [1, 2, 3]
    CLASS_SETS[2] = [1, 2, 3]
    CLASS_SETS[3] = [1, 2, 3]
    CLASS_SETS[4] = [0, 0, 4]
    CLASS_SETS[5] = [5, 6]
    CLASS_SETS[6] = [6, 5]
    CLASS_SETS[7] = [8, 7]
    CLASS_SETS[8] = [8, 7]
    
    
# DEFINE ALL CLASS SETS ABOVE THIS LINE.  CHANGE ANY OF THE EXISTING LINES ABOVE
# AS YOU SEE FIT

## EXAMPLES -
#    CLASS_SETS[1] = [1, 2, 3]
##              ^     ^  
# Paladin is a tier zero class evidenced by its position in the brackets on the
# right.  Its promotoes are warrior and priest

#    CLASS_SETS[2] = [1, 2, 3]
#               ^        ^
# Warrior is a tier one class evidenced by its position in the brackets on the
# right.  Its respective tier zero would have been paladin (if demoted) and
# priest.

#    CLASS_SETS[3] = [1, 2, 3]
#               ^           ^
# Priest is a tier two class evidenced by its position in the brackets on the
# right.  Its respective tier zero would have been paladin (if demoted) and tier
# one would have been warrior.

#    CLASS_SETS[4] = [0, 0, 4]
#               ^           ^
# Magician is a tier two class.  It can never be demoted or promoted.

#    CLASS_SETS[5] = [5, 6]
#               ^     ^
# Knight is a tier zero class with its only promote being Dark Knight.

#    CLASS_SETS[6] = [6, 5]
#               ^     ^
# Dark Knight is also a tier zero class with its only promote being Knight.

# NOTE:
# In both the above examples 5 and 6, the class tier would remain zero even
# after being 'promoted' thus allowing a 'promote loop'.

#    CLASS_SETS[7] = [8, 7]
#               ^        ^
# Grappler is a tier one class.  Its demote is Thief.

#    CLASS_SETS[8] = [8, 7]
#               ^     ^
# Thief is a tier zero class that promotes to Grappler.

# BAD EXAMPLES:        
#  CLASS_SETS[1] = [6, 5]
# Paladin's class tier is not defined, and therefore is assumed zero.
# Paladin will promte directly to Knight in this example, and Dark Knight will
# be ignored and incassisble through this upgrade path.
#  CLASS_SETS[2] = [2, 2, 3]
# Warrior's default class tier is zero.  However, after being promoted, it stays
# zero. Warrior would consume tier one promote items, and basically nothing would
# happen.
# Warrior will also never be able to promote to priest unless direclty promoted.
# The correct way to set this up would be-
#  CLASS_SETS[2] = [2, 0, 3]
# This would disallow promoting to tier one because the class is invalid.
# Tier two can be directly promoted to through an event, or, if the option is enabled
# through a tier two item.



    
# = = = = = = = = = = = = = = = END CUSTOMIZATION = = = = = = = = = = = = = = =  

  end
end

class Game_Actor < Game_Battler
  attr_accessor :class_tier
  
  def actor_promote_class(tier)
    if Mithran::PromoteItem::SYSTEM == 1 && tier > class_tier
      class_change_class(tier)
      return
    end
    while class_tier < tier
      self.class_tier += 1
      class_change_effect unless $data_classes[class_tier_ids[class_tier]].nil?
    end
  end

  def actor_demote_class(tier)
    if Mithran::PromoteItem::SYSTEM == 1 && tier < class_tier
      class_change_class(tier)
      return
    end
    while class_tier > tier
      self.class_tier -= 1
      class_change_effect unless $data_classes[class_tier_ids[class_tier]].nil?
    end
  end
  
  def class_change_class(new_tier)
    if new_tier != class_tier
      self.class_tier = new_tier
      class_change_effect
    end
  end
  
  alias class_id_promote= class_id=
  def class_id=(class_id)
    if $data_classes[class_id] != nil
      self.class_id_promote = class_id
    end
    set_new_class_tier if Mithran::PromoteItem::SYSTEM == 1
  end

  def class_change_effect
    old_level = @level
    old_params = []
    leveled_bonus = []
    
    for i in 0..5
      old_params[i] = base_param(i)
    end
    
    clear_class_learnings if Mithran::PromoteItem::CLEAR_SKILLS

    if Mithran::PromoteItem::RESET_LEVEL
      downto_level = Mithran::PromoteItem::RESET_LEVEL
      downto_level = 1 if Mithran::PromoteItem::RESET_LEVEL == true
      while @level > downto_level
        for learning in self.class.learnings
          forget_skill(learning.skill_id) if learning.level == @level && Mithran::PromoteItem::LEVEL_DOWN_LOSE_SKILL
        end
        change_exp(@exp_list[@level - 1], false)
      end
      for i in 0..5
        leveled_bonus[i] = old_params[i] - base_param(i)
      end
    end
    
    hp_before = @hp
    mp_before = @mp
    
    self.class_id = class_tier_ids[class_tier]
    
    if @level < old_level && leveled_bonus.empty?
      for i in 0..5
        leveled_bonus[i] = old_params[i] - base_param(i)
      end
    end
    
    if (@level < old_level) && Mithran::PromoteItem::RESET_LEVEL_KEEP_STATS
      pct = Mithran::PromoteItem::RESET_LEVEL_KEEP_STATS
      pct = 100 if Mithran::PromoteItem::RESET_LEVEL_KEEP_STATS == true
      for i in 0..5
        if leveled_bonus[i] > 0
          set_base_param(i, (base_param(i) + (leveled_bonus[i] * pct / 100)))
        end
      end
    end
    
    inherit_class_learnings if Mithran::PromoteItem::INHERIT_SKILLS
    
    self.hp = hp_before
    self.mp = mp_before
    
  end
  
  def clear_class_learnings
    for i in self.class.learnings
      forget_skill(i.skill_id) if i.level <= @level
    end
  end
  
  def inherit_class_learnings
    for i in self.class.learnings
      learn_skill(i.skill_id) if i.level <= @level
    end
  end
  
  def initial_param(n)
    return actor.parameters[n, 1]
  end
  
  def unmod_param(n)
    return actor.parameters[n, @level]
  end
  
  def base_param(n)
    x = actor.parameters[n, @level]
    case n
    when 0
      x += @maxhp_plus
    when 1
      x += @maxmp_plus
    when 2
      x += @atk_plus
    when 3
      x += @def_plus
    when 4
      x += @spi_plus
    when 5
      x += @agi_plus
    else
      x = 0
    end
    return x
  end
  
  def set_base_param(n, param)
    x = base_param(n)
    diff = param - x
    case n
    when 0
      @maxhp_plus = diff
    when 1
      @maxmp_plus = diff
    when 2
      @atk_plus = diff
    when 3
      @def_plus = diff
    when 4
      @spi_plus = diff
    when 5
      @agi_plus = diff
    end
  end
  
  def class_tier
    set_new_class_tier if Mithran::PromoteItem::SYSTEM == 1 && @class_tier.nil?
    @class_tier ||= 0
    return @class_tier
  end
  
  def set_new_class_tier
    n = class_tier_ids.index(self.class_id)
    n ||= 0
    @class_tier = n
  end
  
  def initial_class_id
    return class_tier_ids[0] if Mithran::PromoteItem::SYSTEM == 1
    return actor.class_id
  end
    
  def required_class_level
    result = Array.new(tier_max)
    idnum = 0
    if Mithran::PromoteItem::SYSTEM == 1
      idnum = class_id
    else
      idnum = self.id
    end
    defaults = Mithran::PromoteItem::REQUIRED_LEVELS[idnum]
    if defaults.nil?
      defaults = Mithran::PromoteItem::DEFAULT_REQUIRED_LEVELS
    end
    result.each_index { |i|
    result[i] = defaults[i]
    result[i] = 0 if defaults[i].nil?
    }
    result.unshift(0)
    return result
  end    
  
  def class_tier_ids
    if Mithran::PromoteItem::SYSTEM == 1
      return class_tier_ids_classbased
    end
    setting = Mithran::PromoteItem::ACTOR_PROMOTES[self.id]
    if setting != nil
      result = [initial_class_id]
      result += setting
      return result
    end
    result = []
    for i in 0..Mithran::PromoteItem::PROMOTE_MAX
      result[i] = initial_class_id + i
    end
    return result
  end
  
  def class_tier_ids_classbased
    setting = Mithran::PromoteItem::CLASS_SETS[self.class_id]
    result = []
    if setting.nil?
      result = [self.class_id]
    else
      setting.each_index { |i|
      result[i] = setting[i]
      }
    end
    return result
  end
  
  def tier_max
    return (class_tier_ids.size - 1)
  end
  
end


class Game_Battler
  alias item_effective_promoteitem item_effective?
  def item_effective?(user, item)
    if item.promote
      if Mithran::PromoteItem::ALLOW_TIER_SKIP
        return true if (self.class_tier < item.promote) && (item.promote <= self.tier_max) && ($data_classes[self.class_tier_ids[item.promote]] != nil) && (self.level >= self.required_class_level[item.promote])
      else
        return true if (self.class_tier == item.promote - 1) && (item.promote <= self.tier_max) && ($data_classes[self.class_tier_ids[item.promote]] != nil) && (self.level >= self.required_class_level[item.promote])
      end
      return false
    end
    return item_effective_promoteitem(user, item)
  end
  
  alias item_effect_promoteitem item_effect
  def item_effect(user, item)
    item_effect_promoteitem(user, item)
    if !@skipped && self.actor? && item.promote
      actor_promote_class(item.promote)
    end
  end
end

class Game_Interpreter
  
  def promote_actor(actor_id)
    actor = $game_actors[actor_id]
    return if actor.nil?
    tier = actor.class_tier + 1
    actor_change_tier(actor_id, tier, false)
  end

  def demote_actor(actor_id)
    actor = $game_actors[actor_id]
    return if actor.nil?
    tier = actor.class_tier - 1
    actor_change_tier(actor_id, tier, true)
  end
  
  def promote_member(member_id)
    return if $game_party.members[member_id].nil?
    promote_actor($game_party.members[member_id].id)
  end

  def demote_member(member_id)
    return if $game_party.members[member_id].nil?
    demote_actor($game_party.members[member_id].id)
  end
  
  def actor_change_tier(actor_id, tier, demote = false)
    actor = $game_actors[actor_id]
    return if actor.nil?
    return if tier < 0
    return if tier > actor.tier_max
    return if tier == actor.class_tier
    return if $data_classes[actor.class_tier_ids[tier]] == nil
    if tier > actor.class_tier  
      actor.actor_promote_class(tier) if (actor.level >= actor.required_class_level[tier])
    elsif demote
      actor.actor_demote_class(tier)
    end
  end
  
  def member_change_tier(member_id, tier)
    return if $game_party.members[member_id].nil?
    actor_change_tier($game_party.members[member_id].id, tier)
  end
  
end

class RPG::Item
  def promote
    return $1.to_i if self.note =~ /<promote (\d+)>/i
    return false
  end
end

class Window_Base
  alias draw_actor_class_tieredclass draw_actor_class
  def draw_actor_class(actor, x, y)
    draw_actor_class_tieredclass(actor, x, y)
    offset = self.contents.text_size(actor.class.name).width + 12
    draw_actor_tier(actor, x + offset, y) if Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 3
  end
  
  def draw_actor_tier(actor, x, y)
    old_color = self.contents.font.color
    old_bold = self.contents.font.bold
    old_size =  self.contents.font.size
    self.contents.font.size = Mithran::PromoteItem::ONSCREEN_TIER_SIZE
    self.contents.font.color = Mithran::PromoteItem::ONSCREEN_TIER_COLOR
    self.contents.font.bold = Mithran::PromoteItem::ONSCREEN_TIER_BOLD
    text = Mithran::PromoteItem::ONSCREEN_TIER_TEXT
    wide = self.contents.text_size(text).width
    self.contents.draw_text(x, y, wide, WLH, text)
    self.contents.font.color = normal_color
    self.contents.font.bold = false
    self.contents.draw_text((x + wide + 10), y, (self.contents.text_size(actor.class_tier.to_s).width), WLH, actor.class_tier.to_s)
    self.contents.font.size = old_size
    self.contents.font.color = old_color
    self.contents.font.bold = old_bold
  end
  
  alias draw_actor_level_tieredclass draw_actor_level
  def draw_actor_level(actor, x, y)
    return if @__nodraw_level
    draw_actor_level_tieredclass(actor, x, y)
    offset = 62
    draw_actor_tier(actor, x + offset, y) if Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 4
  end
  
end

class Window_Status
  
  alias refresh_tieredclass refresh
  def refresh
    refresh_tieredclass
    if Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 1
      offset = self.contents.text_size(actor.class.name).width + 12
      draw_actor_tier(@actor, 128 + offset, 0)
    elsif Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 2
      offset = 65
      draw_actor_tier(@actor, 128 + offset, 32 + WLH * 0)
    end
  end
end

class Window_SkillStatus < Window_Base
  
  alias refresh_tieredclass refresh
  def refresh
    @__nodraw_level = true if Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 4
    refresh_tieredclass
    @__nodraw_level = false
    return unless Mithran::PromoteItem::ONSCREEN_TIER_FORMAT == 4
    offset = self.contents.text_size(Mithran::PromoteItem::ONSCREEN_TIER_TEXT).width + 10 + self.contents.text_size(@actor.class_tier.to_s).width - 20
    draw_actor_level(@actor, 140 - offset, 0)
  end
end


Compatability
Incompatable with job changer scripts.

Credit and Thanks
- Mithran
- initially requested by Roxas210
- class based requested by Deccy Bon

Author's Notes
Feedback is welcome. Please do not redistribute without asking. Please give credit if used.

This post has been edited by Mithran: May 27 2009, 08:36 AM


--------------------
Go to the top of the page
 
+Quote Post
   
Sasame Kiryu
post Feb 28 2009, 08:16 AM
Post #2


どのような
Group Icon


Type: Writer
Alignment: Chaotic Neutral




Good ol' Shining Force pops straight into mind.

Good stuff. I've been looking to implement a system like this into one of my games.
Go to the top of the page
 
+Quote Post
   
Deccy Bon
post Feb 28 2009, 08:39 AM
Post #3


The Biochemist D�B
Group Icon






Nice script, exactly what i've been looking for sooooo long! One issue though, my game is highly open ended, and the party can be constructed of any classes, with this script the promotions are based off actor ID's. Would it be possible to make the promotions based off class ID's?
because at this stage; (say i make a Wizard character), when I promote, I change into the 2nd tier fighter class. I want it so a wizard (when promoted) will change into the 2nd tier wizard class, not just what is defined for that actor.

Sorry, I don't think i explained that very well, but I tried tongue.gif

Please help, this is a awesome script.


--------------------
The Ambrosia Project : 2nd Degree
The rising, ever-growing, free-roaming RPG. Build the best team possible with
500 Grades to gain, lots of weapons, promoted classes and deadly skills.

  • Graphics [||||||||||]
  • Music [||||||||||]
  • Scripts [||||||||||] - DONE!
  • Maps [||||||||||]
  • Skills & Items [||||||||||]
Go to the top of the page
 
+Quote Post
   
Mithran
post Feb 28 2009, 08:57 AM
Post #4


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (Deccy Bon @ Feb 28 2009, 12:39 AM) *
Nice script, exactly what i've been looking for sooooo long! One issue though, my game is highly open ended, and the party can be constructed of any classes, with this script the promotions are based off actor ID's. Would it be possible to make the promotions based off class ID's?
because at this stage; (say i make a Wizard character), when I promote, I change into the 2nd tier fighter class. I want it so a wizard (when promoted) will change into the 2nd tier wizard class, not just what is defined for that actor.

Sorry, I don't think i explained that very well, but I tried tongue.gif

Please help, this is a awesome script.


I'll take a look at this, but no promises. To be clear, you want the promote to happen based on the current class, and up to the next tier of the current class? The current class "tier" is pretty ingrained in there, so manually changing to a class in another 'tier' would break this pretty hard. What I mean is, if you change from, say, wizard tier 1 to fighter teir 2 through the normal method, the 'tier' would still 1, thereby allowing the newly changed fighter to still use the teir 2 promote item. The item would be consumed, but he wouldnt change class, because he was already the designated teir 2. It also presents the problem that the classes 'tiers' would have to be exactly the same for every 'teir' of the class.

How about if I make a way to assign new class sets to actors midgame? Would that work? What method are you using to change the classes midgame? If it is a normal event, you could implement the new class set at the time you change the main class. I have one other idea too that I will look into. This may not be soon, though, so let me know on the other option.


--------------------
Go to the top of the page
 
+Quote Post
   
Roxas210
post Feb 28 2009, 01:13 PM
Post #5



Group Icon


Type: Designer




Look when I use the item it only promotes the other classes to the first class, and the characters don't change their classes names even if they promote...
Go to the top of the page
 
+Quote Post
   
Garge
post Feb 28 2009, 01:25 PM
Post #6



Group Icon


Type: Designer




QUOTE (Roxas210 @ Feb 28 2009, 08:13 AM) *
Look when I use the item it only promotes the other classes to the first class, and the characters don't change their classes names even if they promote...

Works fine for me when thrown into a new project. Are you sure there are no other scripts that might be conflicting with this and/or are you sure you've set up everything properly?
Go to the top of the page
 
+Quote Post
   
Roxas210
post Feb 28 2009, 01:26 PM
Post #7



Group Icon


Type: Designer




QUOTE (Garge @ Feb 28 2009, 01:25 PM) *
Works fine for me when thrown into a new project. Are you sure there are no other scripts that might be conflicting with this and/or are you sure you've set up everything properly?


You might be right Ι am a bit confused on how to put the classes and all that tier staff...
Go to the top of the page
 
+Quote Post
   
Garge
post Feb 28 2009, 02:19 PM
Post #8



Group Icon


Type: Designer




From the script itself:
» Click to show Spoiler - click again to hide... «

If your actors have more then 1 tier, then the <promote n> must also increase, like putting in <promote 2> in the item's note field to get to tier two of his class, and so on.

QUOTE (Mithran @ Feb 28 2009, 04:07 AM) *
Scroll down to under where it says CUSTOMIZATION. There is an area that says-
CODE
    ACTOR_PROMOTES[1] = [8, 3]


The number in the brackets on the left is the actor ID, the numbers on the right are the class tiers. The class at game start is the initial class and not included in the array. In the above example, you are setting Ralph's two promoted classes to Thief and Priest.

What you want to do is copy paste that, and make one for every actor. Just put the two promoted classes you want in the brackets on the right. Alternatively, you can use the autosetup and set them up in the database. If you use autosetup, the two classes immediately following the actor's initial class will be their promotes. If you want to set them up indiviudally, it should look something like this -

CODE
    ACTOR_PROMOTES[1] = [9, 10]
    ACTOR_PROMOTES[2] = [11, 12]
    ACTOR_PROMOTES[3] = [13, 14]
    ACTOR_PROMOTES[4] = [15, 16]
    ACTOR_PROMOTES[5] = [17, 18]
    ACTOR_PROMOTES[6] = [19, 20]
    ACTOR_PROMOTES[7] = [21, 22]
    ACTOR_PROMOTES[8] = [23, 24]


This example sets Ralphs two promotes to class 9 and 10, Ulrikas to classes 11 and 12, Bennetts to Classes 13 and 14, etc. You have to creates the classes in the database, of course.

Basically whatever classes are meant to be the promotion classes should be put into the "ACTOR_PROMOTES[1] = [9, 10]"
So lets say actor 1 starts off as class 1 in your database, and you want him to promote to class 5 for his first tier and then class 10 as his next and final tier. You would look in the module section of the script for the following:
» Click to show Spoiler - click again to hide... «

You would then change ACTOR_PROMOTES[1] = [8, 3] to ACTOR_PROMOTES[1] = [5, 10]. You'd repeat this process for all your actors and get something that would look like what mithran had posted in the quote above:
» Click to show Spoiler - click again to hide... «

To change at what level the actor can promote at, you would find this part in the module:
» Click to show Spoiler - click again to hide... «

The above means when actor 1 reaches level 10, he can then use the item to promote up to the next tier. When level 25 is reached, he can then move onto the next tier. These would have to be added in for all the tier you have for all the actors, so it'd look like this"
» Click to show Spoiler - click again to hide... «


There are defaults for both how the classes work and what, if any, level is required to promote at, but all of that can be found out if you read in the script a bit. Hopefully this helps you out a little.

This post has been edited by Garge: Feb 28 2009, 02:23 PM
Go to the top of the page
 
+Quote Post
   
Roxas210
post Feb 28 2009, 02:47 PM
Post #9



Group Icon


Type: Designer




QUOTE (Garge @ Feb 28 2009, 02:19 PM) *
From the script itself:
» Click to show Spoiler - click again to hide... «

If your actors have more then 1 tier, then the <promote n> must also increase, like putting in <promote 2> in the item's note field to get to tier two of his class, and so on.


Basically whatever classes are meant to be the promotion classes should be put into the "ACTOR_PROMOTES[1] = [9, 10]"
So lets say actor 1 starts off as class 1 in your database, and you want him to promote to class 5 for his first tier and then class 10 as his next and final tier. You would look in the module section of the script for the following:
» Click to show Spoiler - click again to hide... «

You would then change ACTOR_PROMOTES[1] = [8, 3] to ACTOR_PROMOTES[1] = [5, 10]. You'd repeat this process for all your actors and get something that would look like what mithran had posted in the quote above:
» Click to show Spoiler - click again to hide... «

To change at what level the actor can promote at, you would find this part in the module:
» Click to show Spoiler - click again to hide... «

The above means when actor 1 reaches level 10, he can then use the item to promote up to the next tier. When level 25 is reached, he can then move onto the next tier. These would have to be added in for all the tier you have for all the actors, so it'd look like this"
» Click to show Spoiler - click again to hide... «


There are defaults for both how the classes work and what, if any, level is required to promote at, but all of that can be found out if you read in the script a bit. Hopefully this helps you out a little.


Sure did thank you... cool.gif
Go to the top of the page
 
+Quote Post
   
Mithran
post Feb 28 2009, 04:25 PM
Post #10


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Thank you for the detailed explanation, Garge. You explained it much better than I did. Sometimes I assume a basic knowledge of using implementing scripts, so I am not as detailed as I need to be. Hopefully this will help out newer users.

@Deccy Bon - I looked into making this class based a bit further. There are different ways I can implement this feature, the simplest being to just add an event command to change the character's tier setup to a different 'archetype' that you would pre-set up in the module. Another would be to require you to set up a promotion set for every class (similar to how I did with actors), then change the class' "set" when a class change occured. This would give more complete coverage, but every class' tier set would have to be explicilty defined. This will have to be carefully implemented to avoid things like 'promoting' from a class considered teir 1 to another class considered a lower tier, promoting into a class which doesnt have it own 'tier' defined, etc.


--------------------
Go to the top of the page
 
+Quote Post
   
Deccy Bon
post Feb 28 2009, 10:50 PM
Post #11


The Biochemist D�B
Group Icon






@Mithran
Sounds good, if you do go through with that, can u try explain it very thoroughly to me how to use it? All sounds rather complicated =p
Scripting isn't my area. >_>"
Thx again smile.gif

EDIT: So, you mean that i set up different archetypes for promotion 'chains' in the script. and then change the player to the appropriate archetype.
so, archetype 1 would b like 'wizard-->high wizard-->etc' ...Yeah, i get it now, thats absolutely perfect!

This post has been edited by Deccy Bon: Feb 28 2009, 10:52 PM


--------------------
The Ambrosia Project : 2nd Degree
The rising, ever-growing, free-roaming RPG. Build the best team possible with
500 Grades to gain, lots of weapons, promoted classes and deadly skills.

  • Graphics [||||||||||]
  • Music [||||||||||]
  • Scripts [||||||||||] - DONE!
  • Maps [||||||||||]
  • Skills & Items [||||||||||]
Go to the top of the page
 
+Quote Post
   
Blaziruku
post Feb 28 2009, 11:45 PM
Post #12


Back for Forgotten Legacy!
Group Icon


Type: Designer
Alignment: True Neutral




Awesome! Thanks Mithran! I really needed this! Now I can promote their class!


--------------------
I'm back to remake Forgotten Legacy! Visit my blog to check for daily updates!
Visit the blog for all my updates! Updated 15/10/2011
AWESOME SIG BY EVENANGELS!
Go to the top of the page
 
+Quote Post
   
Midnight Assassi...
post Mar 1 2009, 01:00 AM
Post #13


Backseat Moderator
Group Icon


Type: Artist




Can you put up a demo? I'm really interested in this script! *reminisces of Fire Emblem GBA*


--------------------
HEY BRO SIG'S WAY TOO BIG
-Kav

WHATEVER
-Midnight Assassin

Bye Bye
- BigEd781
Go to the top of the page
 
+Quote Post
   
Blaziruku
post Mar 1 2009, 04:32 PM
Post #14


Back for Forgotten Legacy!
Group Icon


Type: Designer
Alignment: True Neutral




I can not get it to work, why?

Isn't this right?

promote_actor(1)

I did that, and got this error


--------------------
I'm back to remake Forgotten Legacy! Visit my blog to check for daily updates!
Visit the blog for all my updates! Updated 15/10/2011
AWESOME SIG BY EVENANGELS!
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 1 2009, 04:46 PM
Post #15


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Edit: Got it fixed.

Update


v 1.0b
Bugfix: - fixed a crash bug when using the event command for promote_actor or demote_actor

Modified script is in the original post. Thank you for reporting.

This post has been edited by Mithran: Mar 1 2009, 04:54 PM


--------------------
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 5 2009, 09:34 AM
Post #16


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Update


v 2.0
- New feature - class based promote routes. Enables the use of class based promote routes, which allows the creator to perform evented class changes without completely breaking the system (evented class changes should still be used sparingly, however)
- Added more examples and changed the order of the options in the customozation module to support the new feature*
* NOTE: The basic formatting of each of the individual options have not changed. If you are updating the script and still wish to use actor promote routes, it is recommending you copy the old version of the script into a text file before updting so you can copy over your old actor promote routes. Be sure to copy into the appropriate section noted in the new script.
- changed the names of the Event > Advanced > Script commands 'change_actor_class' and 'change_member_class' to 'change_actor_tier' and 'change_member_tier' respectively.

Previous updates:
» Click to show Spoiler - click again to hide... «

Modified script is in the original post.


--------------------
Go to the top of the page
 
+Quote Post
   
Deccy Bon
post Mar 6 2009, 04:10 AM
Post #17


The Biochemist D�B
Group Icon






Mithran, you are a legend. My game's scripts are now 100% complete!

EDIT: One last thing, sorry to keep asking things of ya, but when i promote a character with a item that has been tagged with <promote 1>, they advance to the next tier. Although it seems to still count as tier 0. The "CLv" bit's stay at zero even after the correct promotion item is used. this is making it impossible to use the items that have been tagged with <promote 2> and <promote 3>.
please could ya fix this?

This post has been edited by Deccy Bon: Mar 6 2009, 07:15 PM


--------------------
The Ambrosia Project : 2nd Degree
The rising, ever-growing, free-roaming RPG. Build the best team possible with
500 Grades to gain, lots of weapons, promoted classes and deadly skills.

  • Graphics [||||||||||]
  • Music [||||||||||]
  • Scripts [||||||||||] - DONE!
  • Maps [||||||||||]
  • Skills & Items [||||||||||]
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 15 2009, 03:54 AM
Post #18


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (Deccy Bon @ Mar 5 2009, 09:10 PM) *
Mithran, you are a legend. My game's scripts are now 100% complete!

EDIT: One last thing, sorry to keep asking things of ya, but when i promote a character with a item that has been tagged with <promote 1>, they advance to the next tier. Although it seems to still count as tier 0. The "CLv" bit's stay at zero even after the correct promotion item is used. this is making it impossible to use the items that have been tagged with <promote 2> and <promote 3>.
please could ya fix this?


Sorry for the late reply, but I didnt notice your edit until now. For class based promotions, the "CLv" is set to the first matching class found in the new progression, as shown in the examples. Promoting to a new class in class based doesnt mean they will actuall increase in Teir. Take my example from the script:

CLASS_SETS[5] = [5, 6]
CLASS_SETS[6] = [6, 5]

If you use the promote item on class 5 (knight) he promotes to dark knight. Since the promote teirs for dark knight define dark knight as a teir zero class, he remains teir zero. If you use the item again, he promotes to knight. Since knight is defined as a teir zero class in his promote tree, he remains zero. This creates a loop. The only way to get out of it is to allow the item to promote more than one teir or use an event to get past it. Since only one promote is defined here, this loop is permanent.

To avoid this, you would need to set them up like this:

CLASS_SETS[5] = [5, 6]
CLASS_SETS[6] = [5, 6]

Knight promotes to Dark Knight. Dark Knight's "CLv" within his own tree is 1, so, the new "CLv" is 1

You might also be doing it like the "Bad Example:"

CLASS_SETS[1] = [6, 5]
CLASS_SETS[6] = [1, 5]

This will NOT work. Because of the nature of the class based system automatically correcting to the correct CLv (to prevent ambiguity in the promote trees), each class MUST be defined in its own promote tree. To prevent a crash, I made it so the class assumes tier zero if it is not defined in its own promote tree, but this completely breaks the system anyway. In the above example, both classes promote to (and are stuck at) Dark Knight, which will itself be a tier zero class because it is undefined.

The correct way to do this would be:

CLASS_SETS[1] = [1, 6, 5]
CLASS_SETS[6] = [1, 6, 5]
CLASS_SETS[5] = [1, 6, 5]

Class one (Paladin) is clearly defined as tier zero in all class promote trees. Class 6 (Dark Knight) is clearly defined as tier one in class promote trees. And Class 5 (Knight) is clearly defined as teir two, the final tier, in all promote trees. For your system, you probably want all trees to match for any given promote route, so do like the above example, make a promote route like this:

CLASS_SETS[1] = [1, 6, 5]

Copy it three times:

CLASS_SETS[1] = [1, 6, 5]
CLASS_SETS[1] = [1, 6, 5]
CLASS_SETS[1] = [1, 6, 5]

Change the numbers in the left brackets, making sure you only have one of any given number listed in all of the left bracket areas

CLASS_SETS[1] = [1, 6, 5]
CLASS_SETS[5] = [1, 6, 5]
CLASS_SETS[6] = [1, 6, 5]

Then do the same for all your promote routes. Make sure you dont duplicate any numbers in the left brackets, though, because only the lowest one on the list will be used. If you need more help, post me your CLASS_SETS setup section.

Oh, and if you have a question and want to avoid a double post, feel free to PM me so I can see it. I dont get notifications of edits, and I usually stop checking after a day

PS: I apologize for all misspelling of 'tier' in the above post dry.gif


--------------------
Go to the top of the page
 
+Quote Post
   
Anaxim
post Mar 15 2009, 04:29 AM
Post #19


Captain Paradox Extreme
Group Icon


Type: Undisclosed
Alignment: Chaotic Neutral




I would like a tiny comment, even though I stopped using VX.
The implied ambiguity of the promotion items kinda bugs me.
Any chance you'll put in a feature that allows only specific items to promote from class x to class y? I mean like Knight only becomes Dark Knight in case of [Tainted Holy Water] and returns to Knight only in case of [Holy Water].

Just a thought.


--------------------
"Lightning is like a troll; You don't know what hit you till you smell it."

I will only say a single thing about my acquisition of RPG Maker VX: "Yarr."
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 15 2009, 04:49 AM
Post #20


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (Anaxim @ Mar 14 2009, 09:29 PM) *
I would like a tiny comment, even though I stopped using VX.
The implied ambiguity of the promotion items kinda bugs me.
Any chance you'll put in a feature that allows only specific items to promote from class x to class y? I mean like Knight only becomes Dark Knight in case of [Tainted Holy Water] and returns to Knight only in case of [Holy Water].

Just a thought.


Yes, I had this planned for when I do the archetype based system, which will require this sort of thing. The original 'tier' system was specifically requested where a single item would upgrade the class of any actor at a specific tier. I'm not currently working on this, though. I also have small scripts (snippets), which I havent posted here but I have shared with a few people, that dissallow an item's effect on certain actors or classes, basically duplicating the effect above. For now, if anyone wants these small scripts, just PM me. I never added a 'demote' item to this, so I guess I could consider doing that, too.


--------------------
Go to the top of the page
 
+Quote Post
   

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st September 2014 - 06:44 AM

RPGMakerVX.net is an Privacy Policy, Legal.