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] Custom Commands

Senune

Member

Nice Script! :thumb:

Also I have a request for you...

Name: Upgrade Stats
Type: Menu
Description:I'm trying to get a seperate menu command so that I can use Lettuce's Stat Distribustion Script.
Related Script:This One:http://rmxp.org/forums/index.php?topic=46347.0

Thanks for making this when you get the chance.
Main reason I need this, I suck at scripting... :down:
 
Here's your script Senune
Code:
#==============================================================================
# ** Custom Commands - Lettuce's Stat Points Distribution
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  28/05/08
#  Requested by Senune  
#==============================================================================

# Vocabulary
Vocab::StatsUpgrade = 'Upgrade'

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

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cmcstatsup_menu_create_command_window create_command_window
  alias dargor_vx_cmcstatsup_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::StatsUpgrade) if $game_system.menu_party_changer
    dargor_vx_cmcstatsup_menu_create_command_window
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    dargor_vx_cmcstatsup_menu_update_command_selection
    command = @command_window.selection
    if Input.trigger?(Input::C)
      Sound.play_decision
      case @command_window.selection
      when Vocab::StatsUpgrade
        $scene = Scene_Stat_Dist.new(0)
      end
    end
  end
end

And Here's your request iceplosion
Code:
#==============================================================================
# ** Custom Battle Commands - Darkside
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  28/05/08
#  Requested by iceplosion
#==============================================================================

# Darkside Command name
Vocab::Darkside = 'Darkside'

# Darkside Command Customization Module
module CBC_Darkside
  # HP cost in percent based on the actor's maxhp
  HP_Cost = 10
  # Skill to be casted
  Skill = 80
  # Actors with the Darkside command
  Actors = [1,2]
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcdarkside_actor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_cbcdarkside_actor_setup(actor_id)
    # Add battle commands
    if CBC_Darkside::Actors.include?(@actor_id)
      # Add 'Darkside' command
      index = @commands.index(Vocab::guard)
      add_command(index, Vocab::Darkside)
    end
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcdarkside_update_actor_command_selection update_actor_command_selection
  alias dargor_vx_cbcdarkside_execute_action_skill execute_action_skill
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Skill
  #--------------------------------------------------------------------------
  def execute_action_skill
    skill = @active_battler.action.skill
    # If using Darkside
    if skill.id == CBC_Darkside::Skill
      text = @active_battler.name + skill.message1
      @message_window.add_instant_text(text)
      unless skill.message2.empty?
        wait(10)
        @message_window.add_instant_text(skill.message2)
      end
      targets = @active_battler.action.make_targets
      display_animation(targets, skill.animation_id)
      hp_damage = CBC_Darkside::HP_Cost * (@active_battler.maxhp / 100)
      @active_battler.hp -= hp_damage
      $game_temp.common_event_id = skill.common_event_id
      text = sprintf(Vocab::ActorDamage, @active_battler.name, hp_damage)
      @message_window.add_instant_text(text)
      for target in targets
        target.skill_effect(@active_battler, skill)
        display_action_effects(target, skill)
      end
    else
      dargor_vx_cbcdarkside_execute_action_skill
    end
  end
  #--------------------------------------------------------------------------
  # * Update Actor Command Selection
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    dargor_vx_cbcdarkside_update_actor_command_selection
    if Input.trigger?(Input::C)
      case @actor_command_window.selection
      when Vocab::Darkside # Darkside Command
        Sound.play_decision
        # Prepare to cast Darkside skill
        skill_id = CBC_Darkside::Skill
        @active_battler.last_skill_id = skill_id
        @active_battler.action.set_skill(skill_id)
        # Force the action to be executed
        @active_battler.action.forcing = true
        # Switch to next actor
        next_actor
      end
    end
  end
end

@Ryuzaki
Your script will be there soon!

Take care!
-Dargor
 
Here it is.
Code:
#==============================================================================
# ** Custom Battle Commands - Devour
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  28/05/08
#  Requested by Ryuzaki
#==============================================================================

# Darkside Command name
Vocab::Devour = 'Devour'
Vocab::DevourSuccess = '%s devoured %s!'
Vocab::DevourFail = '%s failed to devour %s.'

# Darkside Command Customization Module
module CBC_Devour
  # Percentage of HP the enemy must have 
  HP_Rate = 10
  # Animation ID
  Animation_ID = 49
  # Actors with the Devour command
  Actors = [1]
  # HP Gain
  # SYNTAX: Enemy_ID => HP_Gain
  HP_Gain = {
              1 => 100,
              2 => -25
            }
  # MP Gain
  # SYNTAX: Enemy_ID => MP_Gain
  MP_Gain = {
              1 => -5,
              2 => 25
            }
  # Stats Plus
  # SYNTAX: Enemy_ID => State_ID
  State_Plus = {
                 1 => 2,
                 2 => 8
               }
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcdevour_actor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_cbcdevour_actor_setup(actor_id)
    # Add battle commands
    if CBC_Devour::Actors.include?(@actor_id)
      # Add 'Devour' command
      add_command(0, Vocab::Devour)
    end
  end
end

#==============================================================================
# ** Game_BattleAction
#------------------------------------------------------------------------------
#  This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================

class Game_BattleAction
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcdevour_action_clear clear
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    dargor_vx_cbcdevour_action_clear
    @devour = false
  end
  #--------------------------------------------------------------------------
  # * Set Normal Attack
  #--------------------------------------------------------------------------
  def set_devour
    @kind = 0
    @basic = 0
    @devour = true
  end
  #--------------------------------------------------------------------------
  # * Normal Attack Determination
  #--------------------------------------------------------------------------
  def devour?
    return (@kind == 0 and @basic == 0 and @devour)
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcdevour_battle_execute_action_attack execute_action_attack
  alias dargor_vx_cbcdevour_update_actor_command_selection update_actor_command_selection
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Attack
  #--------------------------------------------------------------------------
  def execute_action_attack
    if @active_battler.action.devour?
      actor_name = @active_battler.name
      targets = @active_battler.action.make_targets
      for target in targets
        enemy_name = target.name
        if target.hp <= ((target.maxhp / 100) * CBC_Devour::HP_Rate)
          display_animation(targets, CBC_Devour::Animation_ID)
          text = sprintf(Vocab::DevourSuccess, actor_name, enemy_name)
          @message_window.add_instant_text(text)
          wait(40)
          apply_devour_hp_change(target)
          apply_devour_mp_change(target)
          apply_devour_state_change(target)
          target.add_state(1)
          target.perform_collapse
        else
          text = sprintf(Vocab::DevourFail, actor_name, enemy_name)
          @message_window.add_instant_text(text)
          wait(40)
        end
      end
    else
      dargor_vx_cbcdevour_battle_execute_action_attack
    end
  end
  #--------------------------------------------------------------------------
  # * Apply Devour HP Change
  #--------------------------------------------------------------------------
  def apply_devour_hp_change(target)
    return if CBC_Devour::HP_Gain[target.enemy_id].nil?
    hp_gain = CBC_Devour::HP_Gain[target.enemy_id]
    name = @active_battler.name
    @active_battler.hp += hp_gain
    if CBC_Devour::HP_Gain[target.enemy_id] > 0
      text = sprintf(Vocab::ActorRecovery, name, Vocab::hp, hp_gain)
    elsif CBC_Devour::HP_Gain[target.enemy_id] < 0
      hp_gain = hp_gain.abs
      text = sprintf(Vocab::ActorDamage, name, hp_gain)
    end
    @message_window.add_instant_text(text)
    wait(40)
  end
  #--------------------------------------------------------------------------
  # * Apply Devour MP Change
  #--------------------------------------------------------------------------
  def apply_devour_mp_change(target)
    return if CBC_Devour::MP_Gain[target.enemy_id].nil?
    mp_gain = CBC_Devour::MP_Gain[target.enemy_id]
    name = @active_battler.name
    @active_battler.mp += mp_gain
    if CBC_Devour::MP_Gain[target.enemy_id] > 0
      text = sprintf(Vocab::ActorRecovery, name, Vocab::mp, mp_gain)
    elsif CBC_Devour::MP_Gain[target.enemy_id] < 0
      mp_gain = mp_gain.abs
      text = sprintf(Vocab::ActorDamage, name, mp_gain)
    end
    @message_window.add_instant_text(text)
    wait(40)
  end
  #--------------------------------------------------------------------------
  # * Apply Devour State Change
  #--------------------------------------------------------------------------
  def apply_devour_state_change(target)
    return if CBC_Devour::State_Plus[target.enemy_id].nil?
    state = $data_states[CBC_Devour::State_Plus[target.enemy_id]]
    return if state.message1.empty?
    @active_battler.add_state(state.id)
    @active_battler.added_states.push(state.id) 
    text = @active_battler.name + state.message1
    @message_window.add_instant_text(text)
    wait(40)
  end
  #--------------------------------------------------------------------------
  # * Update Actor Command Selection
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    dargor_vx_cbcdevour_update_actor_command_selection
    if Input.trigger?(Input::C)
      case @actor_command_window.selection
      when Vocab::Devour # Devour Command
        Sound.play_decision
        # Prepare the Devour command
        @active_battler.action.set_devour
        # Start enemy selection
        start_target_enemy_selection
      end
    end
  end
end

Hope you like it!
-Dargor
 

Reliez

Member

Hi there, I was wondering if you could make a battle script for me. It might be a bit much to ask for, especially the second part, which if it's too complex, can be omitted.

Name: Scan/Sketch
Type: Battle
Description:
This goes hand-in-hand with the Beastiary. Basically, when an actor uses a skill from the skills menu, let's say scan, it'll add the enemy into the Beastiary book instead of just from encountering them in battle and automatically adding them from encountering them, and if possible reveal the monsters Remaining Hp/Mp, weaknesses, and perhaps a little "thought" or message which could be set in the script and could show up in the beastiary as well.
(If you've ever played Super Mario RPG, it's sorta of like Mallow's Psychopath skill)

Related Scripts:
Dargor's Beastiary

Thanks a bunch!  :thumb:

Edit:
Oh, I have one more question/request!
Sorry if this is pushing it. . . :down:
But for your Skill Draw Script, is there any way to have only selected actors have limited skill usage?
I seems that if you use it long enough your other team members will run out of skills to use, since it's limited to 99 uses.
So basically I'm just asking if theres away to have the Skill Draw Script effect only selected actors, but everybody have unlimited Skill Usage instead of the max of 99 uses like they would normally have on the default battle skill system? And is there away to keep learned skills on the actor unlimited but the skills drawn limited by the number drawn?

Sorry again if it's too much/ confusing . . . :down:
 
umm actually for Reliez request
would it not be better to ask if he can read the "Thought" from the monsters note information? that way you do not have to change the script for that information and if you want it changed just update it through the notes on the monsters info
 
are you still taking request? if its posible i need to take off party command and put the command "run" to the actor command window...
 

Reliez

Member

wsensor":208upd2h said:
umm actually for Reliez request
would it not be better to ask if he can read the "Thought" from the monsters note information? that way you do not have to change the script for that information and if you want it changed just update it through the notes on the monsters info
Actually, that would seem a lot better and more manageable to do. :lol:
 
Thanks for the Devour script.

I have a new request (if it's not too much trouble):

Name: Jump
Type: Battle
Description: Character jumps into the air, next turn descends and attacks the foe
Related Scripts: Haven't seen one.

I'm not sure if I even need a script for this, but better to be safe than sorry.
 
@Reliez
Hi there, I was wondering if you could make a battle script for me. It might be a bit much to ask for, especially the second part, which if it's too complex, can be omitted.

Name: Scan/Sketch
Type: Battle
Description:
This goes hand-in-hand with the Beastiary. Basically, when an actor uses a skill from the skills menu, let's say scan, it'll add the enemy into the Beastiary book instead of just from encountering them in battle and automatically adding them from encountering them, and if possible reveal the monsters Remaining Hp/Mp, weaknesses, and perhaps a little "thought" or message which could be set in the script and could show up in the beastiary as well.
(If you've ever played Super Mario RPG, it's sorta of like Mallow's Psychopath skill)

Related Scripts:
Dargor's Beastiary

Unless you want Scan or Sketch to be a battle command, I won't do that. It's more a Skill request than a Command request.

Oh, I have one more question/request!
Sorry if this is pushing it. . .
But for your Skill Draw Script, is there any way to have only selected actors have limited skill usage?
I seems that if you use it long enough your other team members will run out of skills to use, since it's limited to 99 uses.
So basically I'm just asking if theres away to have the Skill Draw Script effect only selected actors, but everybody have unlimited Skill Usage instead of the max of 99 uses like they would normally have on the default battle skill system? And is there away to keep learned skills on the actor unlimited but the skills drawn limited by the number drawn?

This has nothing to do with my offer. However, this feature will be implemented in the Draw script soon.

@wsensor
umm actually for Reliez request
would it not be better to ask if he can read the "Thought" from the monsters note information? that way you do not have to change the script for that information and if you want it changed just update it through the notes on the monsters info

That's a good idea, for the bestiary script :thumb:

@Chronnopro
are you still taking request? if its possible i need to take off party command and put the command "run" to the actor command window...

I will stop taking requests in 2 days. (Sunday 12:00 PM)

@Ryuzaki
I have a new request (if it's not too much trouble):

Name: Jump
Type: Battle
Description: Character jumps into the air, next turn descends and attacks the foe
Related Scripts: Haven't seen one.

I can do that but I don't see the point of having a Jump command, unless you're using a side-view battle system. And if you're using this kind of CBS, then I will not do the animated sprite part. If you're using the DBS or any front_view battle system, then it would only cast a Jump skill... Quite pointless in a front-view battle system.

Take care!
-Dargor
 

Reliez

Member

Dargor":ka2qs2js said:
@Reliez
Hi there, I was wondering if you could make a battle script for me. It might be a bit much to ask for, especially the second part, which if it's too complex, can be omitted.

Name: Scan/Sketch
Type: Battle
Description:
This goes hand-in-hand with the Beastiary. Basically, when an actor uses a skill from the skills menu, let's say scan, it'll add the enemy into the Beastiary book instead of just from encountering them in battle and automatically adding them from encountering them, and if possible reveal the monsters Remaining Hp/Mp, weaknesses, and perhaps a little "thought" or message which could be set in the script and could show up in the beastiary as well.
(If you've ever played Super Mario RPG, it's sorta of like Mallow's Psychopath skill)

Related Scripts:
Dargor's Beastiary

Unless you want Scan or Sketch to be a battle command, I won't do that. It's more a Skill request than a Command request.

Oh, I have one more question/request!
Sorry if this is pushing it. . .
But for your Skill Draw Script, is there any way to have only selected actors have limited skill usage?
I seems that if you use it long enough your other team members will run out of skills to use, since it's limited to 99 uses.
So basically I'm just asking if theres away to have the Skill Draw Script effect only selected actors, but everybody have unlimited Skill Usage instead of the max of 99 uses like they would normally have on the default battle skill system? And is there away to keep learned skills on the actor unlimited but the skills drawn limited by the number drawn?

This has nothing to do with my offer. However, this feature will be implemented in the Draw script soon.

@wsensor
umm actually for Reliez request
would it not be better to ask if he can read the "Thought" from the monsters note information? that way you do not have to change the script for that information and if you want it changed just update it through the notes on the monsters info

That's a good idea, for the bestiary script :thumb:

@Chronnopro
are you still taking request? if its possible i need to take off party command and put the command "run" to the actor command window...

I will stop taking requests in 2 days. (Sunday 12:00 PM)

@Ryuzaki
I have a new request (if it's not too much trouble):

Name: Jump
Type: Battle
Description: Character jumps into the air, next turn descends and attacks the foe
Related Scripts: Haven't seen one.

I can do that but I don't see the point of having a Jump command, unless you're using a side-view battle system. And if you're using this kind of CBS, then I will not do the animated sprite part. If you're using the DBS or any front_view battle system, then it would only cast a Jump skill... Quite pointless in a front-view battle system.

Take care!
-Dargor

Yeah, a battle command would be more than fine! :]
 
@Chronnopro 
Here's your Run command
Code:
#==============================================================================
# ** Custom Battle Commands - Run
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  01/06/08
#  Requested by Chronnopro
#==============================================================================

# Run vocabulary
Vocab::Run = 'Run'
Vocab::RunStart = "%s has started to escape!"
Vocab::RunFailure   = "However, %s was unable to escape!"

# Run Command Customization Module
module CBC_Run
  # Actors with the Run command
  Actors = [1,2,3,4]
  # Is the party escape command enabled?
  Party_Escape = false
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_system_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_cbcrun_system_initialize
    unless CBC_Run::Party_Escape
      remove_party_command(Vocab.escape)
    end
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_actor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_cbcrun_actor_setup(actor_id)
    # Add battle commands
    if [1,2,3,4].include?(@actor_id)
      # Add 'Run' command
      add_command(@commands.size, Vocab::Run)
    end
  end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold 
# and items. The instance of this class is referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_party_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_cbcrun_party_initialize
    @escaped_actors = []
  end
  #--------------------------------------------------------------------------
  # * Add Escaped Actor
  #--------------------------------------------------------------------------
  def add_escaped_actor(actor_id)
    unless @escaped_actors.include?(actor_id)
      @escaped_actors << actor_id
    end
  end
  #--------------------------------------------------------------------------
  # * Restore Escaped Actors
  #--------------------------------------------------------------------------
  def restore_escaped_actors
    for actor_id in @escaped_actors
      add_actor(actor_id)
    end
    @escaped_actors = []
  end
  #--------------------------------------------------------------------------
  # * Escaped Members
  #--------------------------------------------------------------------------
  def escaped_members
    result = []
    for actor_id in @escaped_actors
      result << $game_actors[actor_id]
    end
    return result
  end
end

#==============================================================================
# ** Game_BattleAction
#------------------------------------------------------------------------------
#  This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================

class Game_BattleAction
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_action_clear clear
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    dargor_vx_cbcrun_action_clear
    @run = false
  end
  #--------------------------------------------------------------------------
  # * Set Run
  #--------------------------------------------------------------------------
  def set_run
    @kind = 0
    @basic = 1
    @run = true
  end
  #--------------------------------------------------------------------------
  # * Normal Attack Determination
  #--------------------------------------------------------------------------
  def run?
    return (@kind == 0 and @basic == 1 and @run)
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_battle_execute_action execute_action
  alias dargor_vx_cbcrun_battle_battle_end battle_end
  alias dargor_vx_cbcrun_battle_process_defeat process_defeat
  alias dargor_vx_cbcrun_update_actor_command_selection update_actor_command_selection
  #--------------------------------------------------------------------------
  # * Update Actor Command Selection
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    dargor_vx_cbcrun_update_actor_command_selection
    if Input.trigger?(Input::C)
      case @actor_command_window.selection
      when Vocab::Run # Run Command
        Sound.play_decision
        # Set run action
        @active_battler.action.set_run
        # Switch to next actor
        next_actor
      end
    end
  end
  #--------------------------------------------------------------------------
  # * End Battle
  #     result : Results (0: win, 1: escape, 2:lose)
  #--------------------------------------------------------------------------
  def battle_end(result)
    $game_party.restore_escaped_actors
    dargor_vx_cbcrun_battle_battle_end(result)
  end
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def process_defeat
    # If actors have escaped durring the battle, proccess a normal escape
    if $game_party.escaped_members.size > 0
      battle_end(1)
    else
      dargor_vx_cbcrun_battle_process_defeat
    end
  end
  #--------------------------------------------------------------------------
  # * Escape Processing (for a single actor)
  #--------------------------------------------------------------------------
  def process_actor_escape
    @info_viewport.visible = false
    @message_window.visible = true
    text = sprintf(Vocab::RunStart, @active_battler.name)
    $game_message.texts.push(text)
    if $game_troop.preemptive
      success = true
    else
      success = (rand(100) < @escape_ratio)
    end
    Sound.play_escape
    if success
      wait_for_message
      if $game_party.members.size == 1
        battle_end(1)
      else
        $game_party.add_escaped_actor(@active_battler.id)
        $game_party.remove_actor(@active_battler.id)
      end
      return
    else
      @escape_ratio += 10
      text = sprintf(Vocab::RunFailure, @active_battler.name)
      $game_message.texts.push('\.' + text)
      wait_for_message
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Battle Actions
  #--------------------------------------------------------------------------
  def execute_action
    if @active_battler.action.run?
      process_actor_escape
      return
    else
      dargor_vx_cbcrun_battle_execute_action
    end
  end
end

@hanmac
Good idea. I'll also make a demo with all these commands soon.

EDIT: Unfortunately, I can't post every commands in the first post. The post length limit is to low for that. I'll make a list and upload the demo ASAP.

@Reliez
Since I stop taking requests, like now, I will add these effects to my upcoming Pack of Special Skill Effects.
It will include things like skill reflection, steal, mug, scan, mimic, self-destruction, sketch, etc.
I will also have an option to turn some of these effects into battle commands so you'll find what you want there. :thumb:


IMPORTANT: I'M NOT TAKING REQUESTS ANYMORE
Please, don't ask for another requests. Thank you for your comprehension. :smile:

Tale care!
-Dargor
 

Reliez

Member

Dargor":22sju7c0 said:
@Chronnopro 
Here's your Run command
Code:
#==============================================================================
# ** Custom Battle Commands - Run
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  01/06/08
#  Requested by Chronnopro
#==============================================================================

# Run vocabulary
Vocab::Run = 'Run'
Vocab::RunStart = "%s has started to escape!"
Vocab::RunFailure   = "However, %s was unable to escape!"

# Run Command Customization Module
module CBC_Run
  # Actors with the Run command
  Actors = [1,2,3,4]
  # Is the party escape command enabled?
  Party_Escape = false
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_system_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_cbcrun_system_initialize
    unless CBC_Run::Party_Escape
      remove_party_command(Vocab.escape)
    end
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_actor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_cbcrun_actor_setup(actor_id)
    # Add battle commands
    if [1,2,3,4].include?(@actor_id)
      # Add 'Run' command
      add_command(@commands.size, Vocab::Run)
    end
  end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold 
# and items. The instance of this class is referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_party_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_cbcrun_party_initialize
    @escaped_actors = []
  end
  #--------------------------------------------------------------------------
  # * Add Escaped Actor
  #--------------------------------------------------------------------------
  def add_escaped_actor(actor_id)
    unless @escaped_actors.include?(actor_id)
      @escaped_actors << actor_id
    end
  end
  #--------------------------------------------------------------------------
  # * Restore Escaped Actors
  #--------------------------------------------------------------------------
  def restore_escaped_actors
    for actor_id in @escaped_actors
      add_actor(actor_id)
    end
    @escaped_actors = []
  end
  #--------------------------------------------------------------------------
  # * Escaped Members
  #--------------------------------------------------------------------------
  def escaped_members
    result = []
    for actor_id in @escaped_actors
      result << $game_actors[actor_id]
    end
    return result
  end
end

#==============================================================================
# ** Game_BattleAction
#------------------------------------------------------------------------------
#  This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================

class Game_BattleAction
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_action_clear clear
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    dargor_vx_cbcrun_action_clear
    @run = false
  end
  #--------------------------------------------------------------------------
  # * Set Run
  #--------------------------------------------------------------------------
  def set_run
    @kind = 0
    @basic = 1
    @run = true
  end
  #--------------------------------------------------------------------------
  # * Normal Attack Determination
  #--------------------------------------------------------------------------
  def run?
    return (@kind == 0 and @basic == 1 and @run)
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcrun_battle_execute_action execute_action
  alias dargor_vx_cbcrun_battle_battle_end battle_end
  alias dargor_vx_cbcrun_battle_process_defeat process_defeat
  alias dargor_vx_cbcrun_update_actor_command_selection update_actor_command_selection
  #--------------------------------------------------------------------------
  # * Update Actor Command Selection
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    dargor_vx_cbcrun_update_actor_command_selection
    if Input.trigger?(Input::C)
      case @actor_command_window.selection
      when Vocab::Run # Run Command
        Sound.play_decision
        # Set run action
        @active_battler.action.set_run
        # Switch to next actor
        next_actor
      end
    end
  end
  #--------------------------------------------------------------------------
  # * End Battle
  #     result : Results (0: win, 1: escape, 2:lose)
  #--------------------------------------------------------------------------
  def battle_end(result)
    $game_party.restore_escaped_actors
    dargor_vx_cbcrun_battle_battle_end(result)
  end
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def process_defeat
    # If actors have escaped durring the battle, proccess a normal escape
    if $game_party.escaped_members.size > 0
      battle_end(1)
    else
      dargor_vx_cbcrun_battle_process_defeat
    end
  end
  #--------------------------------------------------------------------------
  # * Escape Processing (for a single actor)
  #--------------------------------------------------------------------------
  def process_actor_escape
    @info_viewport.visible = false
    @message_window.visible = true
    text = sprintf(Vocab::RunStart, @active_battler.name)
    $game_message.texts.push(text)
    if $game_troop.preemptive
      success = true
    else
      success = (rand(100) < @escape_ratio)
    end
    Sound.play_escape
    if success
      wait_for_message
      if $game_party.members.size == 1
        battle_end(1)
      else
        $game_party.add_escaped_actor(@active_battler.id)
        $game_party.remove_actor(@active_battler.id)
      end
      return
    else
      @escape_ratio += 10
      text = sprintf(Vocab::RunFailure, @active_battler.name)
      $game_message.texts.push('\.' + text)
      wait_for_message
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Battle Actions
  #--------------------------------------------------------------------------
  def execute_action
    if @active_battler.action.run?
      process_actor_escape
      return
    else
      dargor_vx_cbcrun_battle_execute_action
    end
  end
end

@hanmac
Good idea. I'll also make a demo with all these commands soon.

EDIT: Unfortunately, I can't post every commands in the first post. The post length limit is to low for that. I'll make a list and upload the demo ASAP.

@Reliez
Since I stop taking requests, like now, I will add these effects to my upcoming Pack of Special Skill Effects.
It will include things like skill reflection, steal, mug, scan, mimic, self-destruction, sketch, etc.
I will also have an option to turn some of these effects into battle commands so you'll find what you want there. :thumb:


IMPORTANT: I'M NOT TAKING REQUESTS ANYMORE
Please, don't ask for another requests. Thank you for your comprehension. :smile:

Tale care!
-Dargor

OK, sure, I'll be waiting for that then! :D
 
Question: how do I add new commands in the menu? For example the Mix Skills script. Can't figure it out.

I managed to get it in the menu list, but when I stand on it and confirm, all I get is a sound,  but it doesn't open up the mix skills script. O_o
 

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