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.

Yet another Silly Script Request!!!

Okay... this one got me when i came acrossed it...

This is what I started to think would make an excellent additon to this game I'm making... anyway here it is...

A skill that only works for just the battle- no simple skill

This skill will transform the character, change his class, change his skills, and change his equip...

When the battle is over the character will change back to his default self...

but the tricky part is not to interfere with the previous scripts...

such as the level up script that changes the character's, character, graphic, class, and etc.

Here's what I have... the character will change twice before he learns this skill so at the level of 10 he learns this skill that changes him only for the battle... and when the battle is over he will change back to his level 5 or higher self not any previous... and any previous won't get affected and "accidently" change into the level 5 character....

Thus with that said... the new skill will be learned for another two as well but for the same character...

ex: Bronze Warrior ->Lv. 3 =Iron Warrior ->Lv.5 =Steel Warrior ->Lv.10 Steel Warrior Learns Skill : Dragon Transform = END OF BATTLE -> Stell Warrior...
Dragon Transform ->lv.25 = Learns skill Greater Dragon Transfor = END OF BATTLE -> Steel Warrior...
Steel Warrior-> Lv.50 = Learns skill Ultima Dragon = End of Battle-> Steel Warrior...

got the hint now... it seems difficult and i don't know if there are anymore scripts out there for this... but if someone can help me here is a script that
Exsharaen gave me...
Code:
# SETTINGS BEGIN

# specify in which position your actor will change
# may be filled more than 1 position
# zero-based (so 1st actor is in pos 0, 2nd in pos 1, and so on)
POS_TO_CHANGE = [1]

# changes details...
ACTOR_TO_CHANGE =
{
1 => # position in party
  {
    3 => # minimum level to reach
    {
    # ----------- GRAPHIC CHANGE -------------------
    :change_hero_name => "warrior2",
    :change_chara_graph => true, # set false to keep chara graphic
    # OMIT these settings if you don't change graphic
    :new_character_name => "warrior2",
    :new_character_hue  => 0,
    :new_battler_name   => "warrior2",
    :new_battler_hue    => 0,
    # ------------- CLASS CHANGE -------------------
    :change_class       => true, # set false to keep current class
    # OMIT this setting if you don't change class
    :new_class_id       => 8,
    # ------------- SKILL CHANGE -------------------
    :change_skill       => false, # set true to change skills
    # OMIT these settings if you don't change skill
    :new_skills         => [1, 2, 3],
    :omit_old_skills    => false # set false to keep old skill
    },
    5 =>
    {
    :change_hero_name => "warrior3",
    :change_chara_graph => true,
    :new_character_name => "warrior3",
    :new_character_hue  => 0,
    :new_battler_name   => "warrior3",
    :new_battler_hue    => 0,
    :change_class       => true,
    :new_class_id       => 3,
    :change_skill       => true,
    :new_skills         => [87],
    :omit_old_skills    => true
    },
    6 => # minimum level to reach
    {
    :change_chara_graph => false,
    :new_character_name => "003-Fighter03",
    :new_character_hue  => 0,
    :new_battler_name   => "003-Fighter03",
    :new_battler_hue    => 0,
    :change_class       => false,
    :new_class_id       => 3,
    :change_skill       => false,
    :new_skills         => [1, 2, 3],
    :omit_old_skills    => false
    },
    15 =>
    {
    :change_chara_graph => false,
    :new_character_name => "004-Fighter04",
    :new_character_hue  => 0,
    :new_battler_name   => "004-Fighter04",
    :new_battler_hue    => 0,
    :change_class       => false,
    :new_class_id       => 3,
    :change_skill       => false,
    :new_skills         => [1, 2, 3],
    :omit_old_skills    => false
    }
    # and so on...
  }
}

and

class Game_Actor
  #--------------------------------------------------------------------------
  # * Change EXP
  #     exp : new EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      check_actor_for_changes
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # Level down
    while @exp < @exp_list[@level]
      @level -= 1
      check_actor_for_changes
    end
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  
  def check_actor_for_changes
    # position need to change?
    unless POS_TO_CHANGE.empty?
      for pos in POS_TO_CHANGE
        # just checking, in case you don't specify the changes for this position...
        if ACTOR_TO_CHANGE.has_key?(pos)
          actor = $game_party.actors[pos]
          return if actor == nil
          # need changes?
          if ACTOR_TO_CHANGE[pos].has_key?(actor.level)
            # save typing :P
            temp = ACTOR_TO_CHANGE[pos][actor.level]
            # need graphic change?
            if temp[:change_chara_graph]
              # need change, change it now
              actor.set_graphic(temp[:new_character_name], temp[:new_character_hue], temp[:new_battler_name], temp[:new_battler_hue])
              $game_party.refresh_sprites
#              p "Graphic changed!"
            end
            # need class change?
            if temp[:change_class]
#                p "Class changed!"
                actor.class_id = temp[:new_class_id]
            end
            # need skill change?
            if temp[:change_skill]
              # keep old skills?
              if temp[:omit_old_skills]
                # remove old skills
                actor.skills.clear
              end
              # now learn new skills
              for skill_id in temp[:new_skills]
                actor.learn_skill(skill_id)
              end
#              p "Skills changed"
            end
          end
        end
      end
    end
  end
end

class Game_Party
  def refresh_sprites
      for i in 1 .. 4
        @characters[i - 1].setup(actors[i])
      end
  end
end

hope this helps...
 

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