[VX] Custom Commands

Custom Commands
by Dargor
Version 1.16


Introduction

Here it is, the little brother of the XP Commands Manager script!
This scripting tool deals with general commands such as Menu, Party and Actor commands.
It helps modifying these commands without having to worry about their index in the window.
NEW: Version 1.5 supports commands substitution based on actor's class ID.
Search for
  1.  
  2. class RPG::Class
  3.  
Expand to see the code.

and edit the @commands array.

IMPORTANT: READ THE NOTES BELOW!

Features
  • Supports Menu, Title, Party and Actor Commands
  • Commands are now 'String Based' (Instead of 'Index Based')
  • Add/remove any commands of any windows at any index
  • Support for commands substitutes (based on an actor class ID)
  • Support command icons
  • Support message codes (Color, Variable & Name) in command ans item names
  • Can make flashy rainbow commands!
  • Comes with a template for Custom Battle Commands!

Screenshots
Image

Script

Read the script comments carefully before using this it!
  1. #==============================================================================
  2. # ** Custom Commands
  3. #------------------------------------------------------------------------------
  4. #  © Dargor, 2008-2009
  5. #  18/12/09
  6. #  Version 1.16
  7. #------------------------------------------------------------------------------
  8. #  VERSION HISTORY:
  9. #   - 1.0   (09/03/08), Initial release
  10. #   - 1.1   (15/03/08), Added support for Party Commands
  11. #   - 1.2   (15/03/08), Added support for Actor Commands
  12. #   - 1.2.1 (15/03/08), Bug fixed with Selectable Window's contents
  13. #   - 1.3   (24/03/08), Added the 'Selection' method to Window_Selectable
  14. #   - 1.4   (08/05/08), Works with the 'Selection' method
  15. #   - 1.5   (08/06/08), Added support for command substitution based
  16. #                         on an actor's class ID
  17. #   - 1.6   (13/06/08), Added support for Title Screen Commands
  18. #   - 1.7   (13/06/08), Bug fixed when disabling default commands
  19. #   - 1.7.1 (16/06/08), Increased compatibility
  20. #   - 1.8   (18/06/08), Menu Index has been corrected when comming back of
  21. #                       default scenes (Item/Skill/Equip/Status/Save/End).
  22. #   - 1.9   (18/06/08), Added support for enabling/disabling commands.
  23. #   - 1.9.1 (05/09/08), Minor revisions
  24. #   - 1.10  (07/09/08), Added support for command icons
  25. #   - 1.11  (16/02/09), Added support for message codes in command names
  26. #   - 1.12  (16/02/09), Added a "Rainbow" command feature
  27. #   - 1.13  (16/02/09), Added support for message codes in item names
  28. #   - 1.14  (23/02/09), Fixed a bug when drawing command names
  29. #   - 1.15  (03/03/09), Fixed a bug with font characters width
  30. #   - 1.16  (18/12/09), Fixed a bug with icon placement in horizontal commands
  31. #------------------------------------------------------------------------------
  32. #  INSTRUCTIONS:
  33. #     1) Place this script above all custom scripts and below all
  34. #         default scripts
  35. #     2) To change the default menu commands, use:
  36. #           - $game_system.menu_commands = [string1, string2...]
  37. #               or
  38. #           - $game_system.add_menu_command(index, command)
  39. #               or
  40. #           - $game_system.remove_menu_command(command)
  41. #     3) To change the default party commands, use:
  42. #           - $game_system.party_commands = [string1, string2...]
  43. #               or
  44. #           - $game_system.add_party_command(index, command)
  45. #               or
  46. #           - $game_system.remove_party_command(command)
  47. #     4) To change an actor's battle commands, use:
  48. #           - $game_actors[id].commands = [string1, string2...]
  49. #               or
  50. #           - $game_actors[id].add_command(index, command)
  51. #               or
  52. #           - $game_actors[id].remove_command(command)
  53. #------------------------------------------------------------------------------
  54. #  NOTES:
  55. #     - When using the following methods:
  56. #             > $game_system.add_menu_command(index, command)
  57. #             > $game_system.remove_menu_command(command)
  58. #             > $game_system.add_party_command(index, command)
  59. #             > $game_system.remove_party_command(command)
  60. #             > $game_actors[id].add_command(index, command)
  61. #             > $game_actors[id].remove_command(command)
  62. #       'command' can be a String or an Array
  63. #     - This script overides the following methods:
  64. #             > Window_PartyCommand
  65. #               <> initialize
  66. #             > Window_ActorCommand
  67. #               <> initialize
  68. #               <> setup
  69. #             > Scene_Menu
  70. #               <> create_command_window
  71. #               <> update_command_selection
  72. #               <> update_actor_selection
  73. #             > Scene_Battle
  74. #               <> update_party_command_selection
  75. #               <> update_actor_command_selection
  76. #         This script will be incompatible with any other scripts
  77. #         modifying these methodsunless they are based on the
  78. #         Custom Commands script methods.
  79. #     - Some message codes are available for command and item names:
  80. #             > Color Change: \C[x]
  81. #             > Variable:     \V[x]
  82. #             > Actor Name:   \N[x]
  83. #==============================================================================
  84.        
  85. module Custom_Commands
  86.   # Temporary System Data
  87.   $data_system = load_data('Data/System.rvdata')
  88.   # Maximum number of commands visible at the same time in the
  89.   # command windows
  90.   Menu_Item_Max = 7
  91.   Party_Item_Max = 4
  92.   Actor_Item_Max = 4
  93.   Title_Item_Max = 3
  94.   # Icon index based on command names
  95.   Icons = {
  96.             # title screen
  97.             Vocab::new_game => 141,
  98.             Vocab::continue => 133,
  99.             Vocab::shutdown => 112,
  100.             # main menu
  101.             Vocab::item => 144,
  102.             Vocab::skill => 119,
  103.             Vocab::equip => 41,
  104.             Vocab::status => 149,
  105.             Vocab::save => 159,
  106.             Vocab::game_end => 112,
  107.             # battle
  108.             Vocab::attack => 2,
  109.             Vocab::guard => 52,
  110.             Vocab::fight => 2,
  111.             Vocab::escape => 48,
  112.             # game end
  113.             Vocab::to_title => 141,
  114.             Vocab::cancel => 143
  115.           }
  116.   # Commands that will flash in rainbow colors
  117.   Rainbow_Commands = []
  118.   # Colors for "Rainbow" commands (color index from windowskin)
  119.   Rainbow_Colors = [1,2,5,10,17]
  120.   # Delay between "Rainbow" commands update
  121.   Rainbow_Frame_Skip = 4
  122. end
  123.  
  124. #==============================================================================
  125. # ** RPG::Class
  126. #------------------------------------------------------------------------------
  127. #  This class handles actors classes.
  128. #==============================================================================
  129.  
  130. class RPG::Class
  131.   #--------------------------------------------------------------------------
  132.   # * Command Name
  133.   # Returns a substitute to command_name.
  134.   # Returns the original command name if no substitues are found.
  135.   #     command_name : command name
  136.   #--------------------------------------------------------------------------
  137.   def command_name(command)
  138.     # Commands Substitution Array
  139.     @commands = []
  140.     # SYNTAX: @commands[class_ID] = { original_command => substitute }
  141.     @commands[1] = {
  142.                     Vocab::attack => 'Strike',
  143.                     Vocab::item   => 'Things',
  144.                    }
  145.     @commands[2] = {
  146.                     Vocab::guard => 'Protect',
  147.                     Vocab::item  => 'Stuff',
  148.                    }
  149.     # Get command substitute
  150.     if @commands[@id].nil? or @commands[@id][command].nil?
  151.       return command
  152.     end
  153.     return @commands[@id][command]
  154.   end
  155. end
  156.  
  157. #==============================================================================
  158. # ** Game_System
  159. #------------------------------------------------------------------------------
  160. #  This class handles system-related data. Also manages vehicles and BGM, etc.
  161. # The instance of this class is referenced by $game_system.
  162. #==============================================================================
  163.  
  164. class Game_System
  165.   #--------------------------------------------------------------------------
  166.   # * Public Instance Variables
  167.   #--------------------------------------------------------------------------
  168.   attr_accessor :menu_commands
  169.   attr_accessor :party_commands
  170.   attr_accessor :title_commands
  171.   attr_accessor :disabled_menu_commands
  172.   attr_accessor :disabled_party_commands
  173.   attr_accessor :disabled_title_commands
  174.   #--------------------------------------------------------------------------
  175.   # * Alias Listing
  176.   #--------------------------------------------------------------------------
  177.   alias dargor_vx_cmc_system_initialize initialize
  178.   #--------------------------------------------------------------------------
  179.   # * Object Initialization
  180.   #--------------------------------------------------------------------------
  181.   def initialize
  182.     dargor_vx_cmc_system_initialize
  183.     @disabled_menu_commands = {}
  184.     @disabled_party_commands = {}
  185.     @disabled_title_commands = {}
  186.     s1 = Vocab::item
  187.     s2 = Vocab::skill
  188.     s3 = Vocab::equip
  189.     s4 = Vocab::status
  190.     s5 = Vocab::save
  191.     s6 = Vocab::game_end
  192.     @menu_commands = []
  193.     add_menu_command(0,[s1, s2, s3, s4, s5, s6])
  194.     s1 = Vocab::fight
  195.     s2 = Vocab::escape
  196.     @party_commands = []
  197.     add_party_command(0,[s1, s2])
  198.     s1 = Vocab::new_game
  199.     s2 = Vocab::continue
  200.     s3 = Vocab::shutdown
  201.     @title_commands = []
  202.     add_title_command(0,[s1, s2, s3])
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # * Add Menu Command
  206.   #--------------------------------------------------------------------------
  207.   def add_menu_command(index, command)
  208.     return if @menu_commands.include?(command)
  209.     if command.is_a?(String)
  210.       @menu_commands.insert(index, command)
  211.       @disabled_menu_commands[command] = false
  212.     elsif command.is_a?(Array)
  213.       for i in 0...command.size
  214.         @menu_commands.insert(index+i, command[i])
  215.         @disabled_menu_commands[command[i]] = false
  216.       end
  217.     end
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # * Add Party Command
  221.   #--------------------------------------------------------------------------
  222.   def add_party_command(index, command)
  223.     return if @party_commands.include?(command)
  224.     if command.is_a?(String)
  225.       @party_commands.insert(index, command)
  226.       @disabled_party_commands[command] = false
  227.     elsif command.is_a?(Array)
  228.       for i in 0...command.size
  229.         @party_commands.insert(index+i, command[i])
  230.         @disabled_party_commands[command[i]] = false
  231.       end
  232.     end
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # * Add Title Command
  236.   #--------------------------------------------------------------------------
  237.   def add_title_command(index, command)
  238.     return if @title_commands.include?(command)
  239.     if command.is_a?(String)
  240.       @title_commands.insert(index, command)
  241.       @disabled_party_commands[command] = false
  242.     elsif command.is_a?(Array)
  243.       for i in 0...command.size
  244.         @title_commands.insert(index+i, command[i])
  245.         @disabled_title_commands[command[i]] = false
  246.       end
  247.     end
  248.   end
  249.   #--------------------------------------------------------------------------
  250.   # * Remove Menu Command
  251.   #--------------------------------------------------------------------------
  252.   def remove_menu_command(command)
  253.     if command.is_a?(String)
  254.       @menu_commands.delete(command)
  255.     elsif command.is_a?(Array)
  256.       for i in command
  257.         @menu_commands.delete(i)
  258.       end
  259.     end
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # * Remove Party Command
  263.   #--------------------------------------------------------------------------
  264.   def remove_party_command(command)
  265.     if command.is_a?(String)
  266.       @party_commands.delete(command)
  267.     elsif command.is_a?(Array)
  268.       for i in command
  269.         @party_commands.delete(i)
  270.       end
  271.     end
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # * Remove Title Command
  275.   #--------------------------------------------------------------------------
  276.   def remove_title_command(command)
  277.     if command.is_a?(String)
  278.       @title_commands.delete(command)
  279.     elsif command.is_a?(Array)
  280.       for i in command
  281.         @party_commands.delete(i)
  282.       end
  283.     end
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # * Add Menu Command
  287.   #--------------------------------------------------------------------------
  288.   def enable_menu_command(command)
  289.     @disabled_menu_commands[command] = false
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # * Add Party Command
  293.   #--------------------------------------------------------------------------
  294.   def enable_party_command(command)
  295.     @disabled_party_commands[command] = false
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # * Add Title Command
  299.   #--------------------------------------------------------------------------
  300.   def enable_title_command(command)
  301.     @disabled_title_commands[command] = false
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # * Add Menu Command
  305.   #--------------------------------------------------------------------------
  306.   def disable_menu_command(command)
  307.     @disabled_menu_commands[command] = true
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # * Add Party Command
  311.   #--------------------------------------------------------------------------
  312.   def disable_party_command(command)
  313.     @disabled_party_commands[command] = true
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # * Add Title Command
  317.   #--------------------------------------------------------------------------
  318.   def disable_title_command(command)
  319.     @disabled_title_commands[command] = true
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # * Add Menu Command
  323.   #--------------------------------------------------------------------------
  324.   def menu_command_disabled?(command)
  325.     return @disabled_menu_commands[command]
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # * Add Party Command
  329.   #--------------------------------------------------------------------------
  330.   def party_command_disabled?(command)
  331.     return @disabled_party_commands[command]
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # * Add Title Command
  335.   #--------------------------------------------------------------------------
  336.   def title_command_disabled?(command)
  337.     return @disabled_title_commands[command]
  338.   end
  339. end
  340.  
  341. #==============================================================================
  342. # ** Game_Interpreter
  343. #------------------------------------------------------------------------------
  344. #  An interpreter for executing event commands. This class is used within the
  345. #  Game_Map, Game_Troop, and Game_Event classes.
  346. #==============================================================================
  347.  
  348. class Game_Interpreter
  349.   #--------------------------------------------------------------------------
  350.   # * Alias Listing
  351.   #--------------------------------------------------------------------------
  352.   alias dargor_vc_cmc_interpreter_command_134 command_134
  353.   alias dargor_vc_cmc_interpreter_command_301 command_301
  354.   #--------------------------------------------------------------------------
  355.   # * Change Save Access
  356.   #--------------------------------------------------------------------------
  357.   def command_134
  358.     if @params[0] == 0
  359.       $game_system.disable_party_command(Vocab::save)
  360.     else
  361.       $game_system.enable_party_command(Vocab::save)
  362.     end
  363.     # The usual
  364.     dargor_vc_cmc_interpreter_command_134
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # * Battle Processing
  368.   #--------------------------------------------------------------------------
  369.   def command_301
  370.     return true if $game_temp.in_battle
  371.     if @params[2]
  372.       $game_system.enable_party_command(Vocab::escape)
  373.     else
  374.       $game_system.disable_party_command(Vocab::escape)
  375.     end
  376.     # The usual
  377.     dargor_vc_cmc_interpreter_command_301
  378.   end
  379. end
  380.  
  381. #==============================================================================
  382. # ** Game_Actor
  383. #------------------------------------------------------------------------------
  384. #  This class handles actors. It's used within the Game_Actors class
  385. # ($game_actors) and referenced by the Game_Party class ($game_party).
  386. #==============================================================================
  387.  
  388. class Game_Actor < Game_Battler
  389.   #--------------------------------------------------------------------------
  390.   # * Public Instance Variables
  391.   #--------------------------------------------------------------------------
  392.   attr_reader   :commands                   # battle commands
  393.   #--------------------------------------------------------------------------
  394.   # * Alias Listing
  395.   #--------------------------------------------------------------------------
  396.   alias dargor_vx_battle_commands_actor_setup setup
  397.   #--------------------------------------------------------------------------
  398.   # * Setup
  399.   #     actor_id : actor ID
  400.   #--------------------------------------------------------------------------
  401.   def setup(actor_id)
  402.     dargor_vx_battle_commands_actor_setup(actor_id)
  403.     actor = $data_actors[actor_id]
  404.     s1 = self.class.command_name(Vocab::attack)
  405.     s2 = self.class.command_name(Vocab::skill)
  406.     s3 = self.class.command_name(Vocab::guard)
  407.     s4 = self.class.command_name(Vocab::item)
  408.     if self.class.skill_name_valid     # Skill command name is valid?
  409.       s2 = self.class.skill_name       # Replace command name
  410.     end
  411.     @commands = [s1, s2, s3, s4, 'Black']
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # * Add Command
  415.   #--------------------------------------------------------------------------
  416.   def add_command(index, command)
  417.     return if @commands.include?(command)
  418.     if command.is_a?(String)
  419.       @commands.insert(index, command)
  420.     elsif command.is_a?(Array)
  421.       for i in 0...command.size
  422.         @commands.insert(index+i, command[i])
  423.       end
  424.     end
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # * Remove Command
  428.   #--------------------------------------------------------------------------
  429.   def remove_command(command)
  430.     if command.is_a?(String)
  431.       @commands.delete(command)
  432.     elsif command.is_a?(Array)
  433.       for i in command
  434.         @commands.delete(i)
  435.       end
  436.     end
  437.   end
  438. end
  439.  
  440. #==============================================================================
  441. # ** Window_Base
  442. #------------------------------------------------------------------------------
  443. #  This is a superclass of all windows in the game.
  444. #==============================================================================
  445.  
  446. class Window_Base < Window
  447.   #--------------------------------------------------------------------------
  448.   # * Draw Item Name
  449.   #     item    : Item (skill, weapon, armor are also possible)
  450.   #     x       : draw spot x-coordinate
  451.   #     y       : draw spot y-coordinate
  452.   #     enabled : Enabled flag. When false, draw semi-transparently.
  453.   #--------------------------------------------------------------------------
  454.   def draw_item_name(item, x, y, enabled = true)
  455.     if item != nil
  456.       draw_icon(item.icon_index, x, y, enabled)
  457.       self.contents.font.color = normal_color
  458.       temp_name = item.name.dup
  459.       temp_name.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  460.       temp_name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  461.       temp_name.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  462.       cx = 0
  463.       loop do
  464.         c = temp_name.slice!(/./m)           # Get next text character
  465.         case c
  466.         when nil
  467.           break
  468.         when "\x01"                       # \C[n]  (text character color change)
  469.           temp_name.sub!(/\[([0-9]+)\]/, "")
  470.           self.contents.font.color = text_color($1.to_i)
  471.           next
  472.         else
  473.           cw = contents.text_size(c).width
  474.           ch = contents.text_size(c).height
  475.           self.contents.font.color.alpha = enabled ? 255 : 128
  476.           self.contents.draw_text(x + cx + 24, y + 2, cw, ch, c)
  477.           cx += cw
  478.         end
  479.       end
  480.       self.contents.font.color = normal_color
  481.     end
  482.   end
  483. end
  484.  
  485. #==============================================================================
  486. # ** Window_Selectable
  487. #------------------------------------------------------------------------------
  488. #  This window contains cursor movement and scroll functions.
  489. #==============================================================================
  490.  
  491. class Window_Selectable < Window_Base
  492.   #--------------------------------------------------------------------------
  493.   # * Selection
  494.   #--------------------------------------------------------------------------
  495.   def selection
  496.     return @commands[self.index]
  497.   end
  498. end
  499.  
  500. #==============================================================================
  501. # ** Window_Command
  502. #------------------------------------------------------------------------------
  503. #  This window deals with general command choices.
  504. #==============================================================================
  505.  
  506. class Window_Command < Window_Selectable
  507.   #--------------------------------------------------------------------------
  508.   # * Alias Listing
  509.   #--------------------------------------------------------------------------
  510.   alias dargor_vx_cmc_window_command_draw_item draw_item
  511.   alias dargor_vx_cmc_window_command_update update
  512.   #--------------------------------------------------------------------------
  513.   # * Draw Item
  514.   #     index   : item number
  515.   #     enabled : enabled flag. When false, draw semi-transparently.
  516.   #--------------------------------------------------------------------------
  517.   def draw_item(index, enabled = true)
  518.     return if index.nil?
  519.     return if @commands[index].nil?
  520.     rect = item_rect(index)
  521.     rect.x += 4
  522.     icon_index = Custom_Commands::Icons[@commands[index]]
  523.     rect.x += 20 unless icon_index.nil?
  524.     rect.width -= 8
  525.     self.contents.clear_rect(rect)
  526.     self.contents.font.color = normal_color
  527.     self.contents.font.color.alpha = enabled ? 255 : 128
  528.     temp_command = @commands[index].dup
  529.     temp_command.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  530.     temp_command.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  531.     temp_command.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  532.     cx = 0
  533.     loop do
  534.       c = temp_command.slice!(/./m)           # Get next text character
  535.       case c
  536.       when nil
  537.         break
  538.       when "\x01"                       # \C[n]  (text character color change)
  539.         temp_command.sub!(/\[([0-9]+)\]/, "")
  540.         self.contents.font.color = text_color($1.to_i)
  541.         next
  542.       else
  543.         if Custom_Commands::Rainbow_Commands.include?(@commands[index])
  544.           color = Custom_Commands::Rainbow_Colors[rand(Custom_Commands::Rainbow_Colors.size)]
  545.           self.contents.font.color = text_color(color)
  546.         end
  547.         cw = contents.text_size(c).width
  548.         ch = contents.text_size(c).height
  549.         self.contents.draw_text(rect.x + cx, rect.y, cw, ch, c)
  550.         cx += cw
  551.       end
  552.     end
  553.     draw_icon(icon_index,rect.x - 24,rect.y, enabled) unless icon_index.nil?
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # * Frame Update
  557.   #--------------------------------------------------------------------------
  558.   def update
  559.     # The Usual
  560.     dargor_vx_cmc_window_command_update
  561.     # Update "Rainbow" commands
  562.     for command in @commands
  563.       if Custom_Commands::Rainbow_Commands.include?(command)
  564.         index = @commands.index(command)
  565.         if Graphics.frame_count % Custom_Commands::Rainbow_Frame_Skip == 0
  566.           draw_item(index)
  567.         end
  568.       end
  569.     end
  570.   end
  571. end
  572.  
  573. #==============================================================================
  574. # ** Window_PartyCommand
  575. #------------------------------------------------------------------------------
  576. #  This window is used to select whether to fight or escape on the battle
  577. # screen.
  578. #==============================================================================
  579.  
  580. class Window_PartyCommand < Window_Command
  581.   #--------------------------------------------------------------------------
  582.   # * Object Initialization
  583.   #--------------------------------------------------------------------------
  584.   def initialize
  585.     @commands = $game_system.party_commands
  586.     super(128, @commands, 1, 0)
  587.     self.height = 32 + Custom_Commands::Party_Item_Max * WLH
  588.     for i in [email hidden]
  589.       draw_item(i, !$game_system.party_command_disabled?(@commands[i]))
  590.     end
  591.     self.active = false
  592.   end
  593. end
  594.  
  595. #==============================================================================
  596. # ** Window_ActorCommand
  597. #------------------------------------------------------------------------------
  598. #  This window is used to select actor commands, such as "Attack" or "Skill".
  599. #==============================================================================
  600.  
  601. class Window_ActorCommand < Window_Command
  602.   #--------------------------------------------------------------------------
  603.   # * Object Initialization
  604.   #--------------------------------------------------------------------------
  605.   def initialize
  606.     super(128, [], 1, 4)
  607.     self.active = false
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # * Setup
  611.   #     actor : actor
  612.   #--------------------------------------------------------------------------
  613.   def setup(actor)
  614.     @commands = actor.commands
  615.     @item_max = @commands.size
  616.     height = 32 + Custom_Commands::Actor_Item_Max * WLH
  617.     self.contents = Bitmap.new(width - 32, (@item_max * WLH))
  618.     refresh
  619.     self.index = 0
  620.   end
  621. end
  622.  
  623. #==============================================================================
  624. # ** Scene_Menu
  625. #------------------------------------------------------------------------------
  626. #  This class performs the menu screen processing.
  627. #==============================================================================
  628.  
  629. class Scene_Menu < Scene_Base
  630.   #--------------------------------------------------------------------------
  631.   # * Create Command Window
  632.   #--------------------------------------------------------------------------
  633.   def create_command_window
  634.     @command_window = Window_Command.new(160, $game_system.menu_commands)
  635.     @command_window.index = @menu_index
  636.     @command_window.height = 8 + Custom_Commands::Menu_Item_Max * 24
  637.     if $game_party.members.size == 0          # If number of party members is 0
  638.       index = $game_system.menu_commands.index(Vocab::item)
  639.       @command_window.draw_item(index, false)     # Disable item
  640.       index = $game_system.menu_commands.index(Vocab::skill)
  641.       @command_window.draw_item(index, false)     # Disable skill
  642.       index = $game_system.menu_commands.index(Vocab::equip)
  643.       @command_window.draw_item(index, false)     # Disable equipment
  644.       index = $game_system.menu_commands.index(Vocab::status)
  645.       @command_window.draw_item(index, false)     # Disable status
  646.     end
  647.     if $game_system.save_disabled             # If save is forbidden
  648.       index = $game_system.menu_commands.index(Vocab::save)
  649.       @command_window.draw_item(index, false)     # Disable save
  650.     end
  651.     for command in $game_system.menu_commands
  652.       index = $game_system.menu_commands.index(command)
  653.       if $game_system.menu_command_disabled?(command)
  654.         @command_window.draw_item(index, false)    # Disable command
  655.       end
  656.     end
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # * Update Command Selection
  660.   #--------------------------------------------------------------------------
  661.   def update_command_selection
  662.     command = @command_window.selection
  663.     if Input.trigger?(Input::B)
  664.       Sound.play_cancel
  665.       $scene = Scene_Map.new
  666.     elsif Input.trigger?(Input::C)
  667.       if $game_party.members.size == 0 and (command == Vocab::item or
  668.                                             command == Vocab::skill or
  669.                                             command == Vocab::equip or
  670.                                             command == Vocab::status)
  671.         Sound.play_buzzer
  672.         return
  673.       elsif $game_system.save_disabled and command == Vocab::save
  674.         Sound.play_buzzer
  675.         return
  676.       elsif $game_system.menu_command_disabled?(command)
  677.         Sound.play_buzzer
  678.         return
  679.       end
  680.       Sound.play_decision if !$game_system.menu_command_disabled?(command)
  681.       case command
  682.       when Vocab::item
  683.         $scene = Scene_Item.new
  684.       when Vocab::skill,Vocab::equip,Vocab::status
  685.         start_actor_selection
  686.       when Vocab::save
  687.         $scene = Scene_File.new(true, false, false)
  688.       when Vocab::game_end
  689.         $scene = Scene_End.new
  690.       end
  691.     end
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # * Update Actor Selection
  695.   #--------------------------------------------------------------------------
  696.   def update_actor_selection
  697.     if Input.trigger?(Input::B)
  698.       Sound.play_cancel
  699.       end_actor_selection
  700.     elsif Input.trigger?(Input::C)
  701.       $game_party.last_actor_index = @status_window.index
  702.       Sound.play_decision
  703.       case @command_window.selection
  704.       when Vocab::skill  # skill
  705.         $scene = Scene_Skill.new(@status_window.index)
  706.       when Vocab::equip  # equipment
  707.         $scene = Scene_Equip.new(@status_window.index)
  708.       when Vocab::status  # status
  709.         $scene = Scene_Status.new(@status_window.index)
  710.       end
  711.     end
  712.   end
  713. end
  714.  
  715. #==============================================================================
  716. # ** Scene_Battle
  717. #------------------------------------------------------------------------------
  718. #  This class performs battle screen processing.
  719. #==============================================================================
  720.  
  721. class Scene_Battle < Scene_Base
  722.   #--------------------------------------------------------------------------
  723.   # * Alias Listing
  724.   #--------------------------------------------------------------------------
  725.   alias dargor_vx_custom_commands_battle_create_info_viewport create_info_viewport
  726.   #--------------------------------------------------------------------------
  727.   # * Create Information Display Viewport
  728.   #--------------------------------------------------------------------------
  729.   def create_info_viewport
  730.     dargor_vx_custom_commands_battle_create_info_viewport
  731.     for command in $game_system.party_commands
  732.       index = $game_system.party_commands.index(command)
  733.       if $game_system.party_command_disabled?(command)
  734.         @party_command_window.draw_item(index, false)    # Disable command
  735.       end
  736.     end
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # * Update Party Command Selection
  740.   #--------------------------------------------------------------------------
  741.   def update_party_command_selection
  742.     if Input.trigger?(Input::C)
  743.       case @party_command_window.selection
  744.       when Vocab::fight  # Fight
  745.         Sound.play_decision
  746.         @status_window.index = @actor_index = -1
  747.         next_actor
  748.       when Vocab::escape  # Escape
  749.         if $game_troop.can_escape == false
  750.           Sound.play_buzzer
  751.           return
  752.         end
  753.         Sound.play_decision
  754.         process_escape
  755.       end
  756.     end
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # * Update Actor Command Selection
  760.   #--------------------------------------------------------------------------
  761.   def update_actor_command_selection
  762.     skill = Vocab::skill
  763.     if @active_battler.class.skill_name_valid
  764.       skill = @active_battler.class.skill_name
  765.     end
  766.     if Input.trigger?(Input::B)
  767.       Sound.play_cancel
  768.       prior_actor
  769.     elsif Input.trigger?(Input::C)
  770.       case @actor_command_window.selection
  771.       when @active_battler.class.command_name(Vocab::attack)  # Attack
  772.         Sound.play_decision
  773.         @active_battler.action.set_attack
  774.         start_target_enemy_selection
  775.       when skill # Skill
  776.         Sound.play_decision
  777.         start_skill_selection
  778.       when @active_battler.class.command_name(Vocab::guard)  # Guard
  779.         Sound.play_decision
  780.         @active_battler.action.set_guard
  781.         next_actor
  782.       when @active_battler.class.command_name(Vocab::item)  # Item
  783.         Sound.play_decision
  784.         start_item_selection
  785.       end
  786.     end
  787.   end
  788. end
  789.  
  790. #==============================================================================
  791. # ** Scene_Title
  792. #------------------------------------------------------------------------------
  793. #  This class performs the title screen processing.
  794. #==============================================================================
  795.  
  796. class Scene_Title < Scene_Base
  797.   #--------------------------------------------------------------------------
  798.   # * Create Command Window
  799.   #--------------------------------------------------------------------------
  800.   alias dargor_vx_cmc_title_check_continue check_continue
  801.   #--------------------------------------------------------------------------
  802.   # * Create Command Window
  803.   #--------------------------------------------------------------------------
  804.   def create_command_window
  805.     @command_window = Window_Command.new(172, $game_system.title_commands)
  806.     @command_window.x = (544 - @command_window.width) / 2
  807.     @command_window.y = 288
  808.     @command_window.height = 32 + Custom_Commands::Title_Item_Max * 24
  809.     continue_index = $game_system.title_commands.index(Vocab::continue)
  810.     if @continue_enabled                      # If continue is enabled
  811.       @command_window.index = continue_index  # Move cursor over command
  812.     else                                      # If disabled
  813.       @command_window.draw_item(continue_index, false) # Make command semi-transparent
  814.     end
  815.     for command in $game_system.title_commands
  816.       index = $game_system.title_commands.index(command)
  817.       if $game_system.title_command_disabled?(command)
  818.         @command_window.draw_item(index, false)    # Disable command
  819.       end
  820.     end
  821.     @command_window.openness = 0
  822.     @command_window.open
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # * Determine if Continue is Enabled
  826.   #--------------------------------------------------------------------------
  827.   def check_continue
  828.     # The usual
  829.     dargor_vx_cmc_title_check_continue
  830.     if @continue_enabled
  831.       $game_system.enable_title_command(Vocab::continue)
  832.     else
  833.       $game_system.disable_title_command(Vocab::continue)
  834.     end
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # * Frame Update
  838.   #--------------------------------------------------------------------------
  839.   def update
  840.     super
  841.     @command_window.update
  842.     if Input.trigger?(Input::C)
  843.       case @command_window.selection
  844.       when Vocab::new_game    #New game
  845.         command_new_game
  846.       when Vocab::continue    # Continue
  847.         command_continue
  848.       when Vocab::shutdown    # Shutdown
  849.         command_shutdown
  850.       end
  851.     end
  852.   end
  853. end
  854.  
  855. #==============================================================================
  856. # ** Scene_Item
  857. #------------------------------------------------------------------------------
  858. #  This class performs the item screen processing.
  859. #==============================================================================
  860.  
  861. class Scene_Item < Scene_Base
  862.   #--------------------------------------------------------------------------
  863.   # * Return to Original Screen
  864.   #--------------------------------------------------------------------------
  865.   def return_scene
  866.     index = $game_system.menu_commands.index(Vocab::item)
  867.     $scene = Scene_Menu.new(index)
  868.   end
  869. end
  870.  
  871. #==============================================================================
  872. # ** Scene_Skill
  873. #------------------------------------------------------------------------------
  874. #  This class performs the skill screen processing.
  875. #==============================================================================
  876.  
  877. class Scene_Skill < Scene_Base
  878.   #--------------------------------------------------------------------------
  879.   # * Return to Original Screen
  880.   #--------------------------------------------------------------------------
  881.   def return_scene
  882.     index = $game_system.menu_commands.index(Vocab::skill)
  883.     $scene = Scene_Menu.new(index)
  884.   end
  885. end
  886.  
  887. #==============================================================================
  888. # ** Scene_Equip
  889. #------------------------------------------------------------------------------
  890. #  This class performs the equipment screen processing.
  891. #==============================================================================
  892.  
  893. class Scene_Equip < Scene_Base
  894.   #--------------------------------------------------------------------------
  895.   # * Return to Original Screen
  896.   #--------------------------------------------------------------------------
  897.   def return_scene
  898.     index = $game_system.menu_commands.index(Vocab::equip)
  899.     $scene = Scene_Menu.new(index)
  900.   end
  901. end
  902.  
  903. #==============================================================================
  904. # ** Scene_Status
  905. #------------------------------------------------------------------------------
  906. #  This class performs the status screen processing.
  907. #==============================================================================
  908.  
  909. class Scene_Status < Scene_Base
  910.   #--------------------------------------------------------------------------
  911.   # * Return to Original Screen
  912.   #--------------------------------------------------------------------------
  913.   def return_scene
  914.     index = $game_system.menu_commands.index(Vocab::status)
  915.     $scene = Scene_Menu.new(index)
  916.   end
  917. end
  918.  
  919. #==============================================================================
  920. # ** Scene_File
  921. #------------------------------------------------------------------------------
  922. #  This class performs the save and load screen processing.
  923. #==============================================================================
  924.  
  925. class Scene_File < Scene_Base
  926.   #--------------------------------------------------------------------------
  927.   # * Return to Original Screen
  928.   #--------------------------------------------------------------------------
  929.   alias dargor_vx_custom_commands_return_scene return_scene
  930.   #--------------------------------------------------------------------------
  931.   # * Return to Original Screen
  932.   #--------------------------------------------------------------------------
  933.   def return_scene
  934.     if !@from_title && !@from_event
  935.       index = $game_system.menu_commands.index(Vocab::save)
  936.       $scene = Scene_Menu.new(index)
  937.     else
  938.       dargor_vx_custom_commands_return_scene
  939.     end
  940.   end
  941. end
  942.  
  943. #==============================================================================
  944. # ** Scene_End
  945. #------------------------------------------------------------------------------
  946. #  This class performs game end screen processing.
  947. #==============================================================================
  948.  
  949. class Scene_End < Scene_Base
  950.   #--------------------------------------------------------------------------
  951.   # * Return to Original Screen
  952.   #--------------------------------------------------------------------------
  953.   def return_scene
  954.     index = $game_system.menu_commands.index(Vocab::game_end)
  955.     $scene = Scene_Menu.new(index)
  956.   end
  957. end
  958.  
Expand to see the code.


Demo
http://www.mediafire.com/?2oafnsrq0jg

Extra Commands

Battle Commands Show
  • Devour - Requested by Ryuzaki
  • Darkside - Requested by iceplosion
  • Prayer - Requested by wsensor
  • Run - Requested by Chronopro

Menu Commands Show
  • Dargor's Bestiary - Requested by Reikei
  • Lettuce's Stat Points Distribution - Requested by Sesune


Notes

An important note:
This script overrides the following methods:
> Window_PartyCommand
initialize
> Window_ActorCommand
initialize
setup
> Scene_Menu
create_command_window
update_command_selection
update_actor_selection
> Scene_Battle
update_party_command_selection
update_actor_command_selection
This script will be incompatible with any other scripts modifying these methods unless they are based on the Custom Commands script methods.

BE SURE TO PLACE THIS SCRIPT ABOVE EVERY CUSTOM SCRIPTS!

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


Enjoy!
-Dargor
Script updated to version 1.4.
I have it installed and everything, and I was able to add in a custom battle command for actor 2 just under the 'Attack' option (following the scripting demo you provided). Let's say I want to remove that command once it is used, is it possible to do so by calling a common event with some scripting in it, or what exactly would I need to do? And then if I wanted the command to re-appear for the next battle, how should I go about that? I'm figuring I can set a switch with the common event that will auto-run another common event to turn the switch off, and then the command will reappear, but I need to know the syntax I'd need to use, everything I've tried using doesn't work. (I don't script with Ruby much if you couldn't tell. =p)

Anyway, thanks in advance.

EDIT: Never mind, I figured it out through lots of trial and error.
I'm now taking Custom Battle Commands and Menu Commands requests.
When asking for a command, please follow this form:

Name: (name of the command)
Type: (menu/battle/both?)
Description: (short description)
Index: (optional, specify the commands position in the window)
Related Scripts: (if another script is needed, specify the name/version/author)
I am sorry if this isn't the exact format you wanted, but I was a bit confused over the name portion. Did you want my name, or did you want me to name the custom menu? Anyways, here is my request. I have been trying to get it myself for the past couple of hours, but I can't figure out how to modify your script easily.

Name: Bestiary
Type: Menu
Description: Bestiary
Index:
  • Item
  • Skill
  • Equip
  • Status
  • Party
  • Order
  • Bestiary
  • Save
  • Exit Program
Related Scripts: Dargor's bestiary.
Name is the name of the command.
Here it is reikei.
Place the script bellow the Bestiary.
Bestiary Command Show
#==============================================================================
# ** Custom Commands - Bestiary
#------------------------------------------------------------------------------
#   © Dargor, 2008
#  25/05/08
#  Requested by reikei 
#==============================================================================

# Vocabulary
Vocab::Bestiary = 'Bestiary'

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

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cmcbestiary_menu_create_command_window create_command_window
  alias dargor_vx_cmcbestiary_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::Bestiary) if $game_system.menu_party_changer
    dargor_vx_cmcbestiary_menu_create_command_window
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    dargor_vx_cmcbestiary_menu_update_command_selection
    command = @command_window.selection
    if Input.trigger?(Input::C)
      Sound.play_decision
      case @command_window.selection
      when Vocab::Bestiary
        $scene = Scene_Bestiary.new(true)
      end
    end
  end
end
#==============================================================================
# ** Scene_Bestiary
#------------------------------------------------------------------------------
#  This class performs the bestiary screen processing.
#==============================================================================

class Scene_Bestiary < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cmcbestiary_update_list_selection update_list_selection
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(from_menu=false)
    @from_menu = from_menu
  end
  #--------------------------------------------------------------------------
  # * Update List Selection
  #--------------------------------------------------------------------------
  def update_list_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      if @from_menu
        index = $game_system.menu_commands.index(Vocab::Bestiary)
        $scene = Scene_Menu.new(index)
      else
        $scene = Scene_Map.new
      end
      return
    end
    dargor_vx_cmcbestiary_update_list_selection
  end
end
Expand to see the code.


By the way, "Name" is the name of the command that will appear in the window. I'm sure you don't want Game_System (Menu Command) to appear in the command window :thumb:

Hope you like it!
Excellent, thank you. :)
Hey, Dargor, since you're taking requests, would you be willing to do the custom commands for FF4VX?  :o
Sure! It'll be a pleasure.
Ah... shoot.  Nevermind. I need to learn how to read.
hey this is from ff4 / ff2jp

Name: Prayer
Type: (battle)
Description: Well in the jap version it would heal your party members by some ammount... not 100% sure how this ammount was done lol..

other info: if you could is there a way to make it so it chooses from 4-5 different skills? I sorta want to make a couple skills get used with it...
like random amounts of healing or just nothing at all... like so if I have 3 skills that heal and 2 that just say your prayers have gone unanswered...
I would like it to choose randomly which ones to use that way its not as if it always heals the same...

Index: under attack or 3rd position
Related Scripts: none that I know of
Prayer Command Show
#==============================================================================
# ** Custom Commands - Prayer
#------------------------------------------------------------------------------
#  Â © Dargor, 2008
#  25/05/08
#  Requested by wsensor
#==============================================================================

# Command name
Vocab::Prayer = 'Prayer'
Vocab::PrayerFail = "%s's prayer has not been heared..."

# Prayer COmmand Customization Module
module CBC_Prayer
  # Actors with the Prayer command
  Actors = [1,2]
  # Random Skills casted
  Skills = [33,34,35]
  # Success Rate
  # SYNTAX: Actor_ID => Rate (percent)
  Success_Rate = {
                   1 => 75,
                   2 => 60,
                 }
  # ID of the uneffective skill
  # This skill will NEVER be casted.
  Uneffective_Skill = 93
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_cbcprayer_actor_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_cbcprayer_actor_setup(actor_id)
    # Add battle commands
    if CBC_Prayer::Actors.include?(@actor_id)
      # Add 'Prayer' command
      add_command(2, Vocab::Prayer)
    end
  end
end

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

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_cbcprayer_update_actor_command_selection update_actor_command_selection
  alias dargor_vx_cbcprayer_execute_action_skill execute_action_skill
  #--------------------------------------------------------------------------
  # * Update Actor Command Selection
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    dargor_vx_cbcprayer_update_actor_command_selection
    if Input.trigger?(Input::C)
      case @actor_command_window.selection
      when Vocab::Prayer # Prayer Command
        Sound.play_decision
        # Prepare to cast Newclear
        success_rate = rand(100)
        if success_rate < CBC_Prayer::Success_Rate[@active_battler.id]
          skill_id = CBC_Prayer::Skills[rand(CBC_Prayer::Skills.size)]
        else
          skill_id = CBC_Prayer::Uneffective_Skill
        end
        @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
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Skill
  #--------------------------------------------------------------------------
  def execute_action_skill
    skill = @active_battler.action.skill
    if skill.id == CBC_Prayer::Uneffective_Skill
      text = sprintf(Vocab::PrayerFail, @active_battler.name)
      @message_window.add_instant_text(text)
      wait(60)
      return
    else
      dargor_vx_cbcprayer_execute_action_skill
    end
  end
end
Expand to see the code.


I added a little customization module. You can randomize prayer skills, set the success rate depending on the actor, choose which actor has the Prayer command and more!
so I put this below the command script and add it to party members XD hmm...
oh yea is there a way to make it so they have to have a certain (item in inventory) or equiped equipment?
Item would be easier but I was actually wandering is it possible to set it based on class?
either way works but actually the item/equipment way would work better for me I think

thanks XD I figured since Atemu asked for ff4 skills that I would recommend something about prayer XD

I love that prayer has not been heard haha... what I was originally going to do was set the 2 different skills with failure messages but this works better haha


gonna mess around and make other skills XD

ok well this worked for me and I am using http://hbgames.org/forums/index.php?topic=45777.0
and well lets just say that using the Prayer skill works...
but it casts all 3 skills one after another

hmm ok that might not be right lol hmm ok I seem to have screwed up and made themattack skills

now if only it would show the skill messages
wsensor wrote:
ok well this worked for me and I am using http://hbgames.org/forums/index.php?topic=45777.0
and well lets just say that using the Prayer skill works...
but it casts all 3 skills one after another

hmm ok that might not be right lol hmm ok I seem to have screwed up and made themattack skills


So you're using Tankentai's CBS... I don't guaranty compatibility with this CBS because this one overrides a lot of methods... 
I've designed this script for the Default Battle System.
yea ok I also have a default battle system problem for me T_T

script 'game_battleaction' line 212:NoMethodError occurred.
undefined method 'speed' fir buk:nilclass

  #--------------------------------------------------------------------------
  # * Confirm Action Speed
  #--------------------------------------------------------------------------
  def make_speed
    @speed = battler.agi + rand(5 + battler.agi / 4)
    @speed += skill.speed if skill?
    @speed += item.speed if item?
    @speed += 2000 if guard?
    @speed += 1000 if attack? and battler.fast_attack
  end
Expand to see the code.
It's probably because the Ineffective_Skill is still 93. Change this value for the ID of the 'Failure' skill.
ok thats what it was... T_T
Name: Darkside
Type: Battle
Description: An attack that has increased power and hits all enemies but uses up a percentage of the users HP
Index: um...in the battle window above Guard
Related Scripts:
What's with the FFIV requests? I'd rather see this:

Name: Devour
Type: Battle
Description: Eats the enemy when their HP is low enough and depending on the enemy the character either regains HP, MP or loses HP, MP or is even inflicted with a negative stat!
Related Scripts: I don't think there is a Devour script yet :(
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://hbgames.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
Menu Command for Lettuce's Stat Points Distribution Show
#==============================================================================
# ** 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
Expand to see the code.


And Here's your request iceplosion
Darkside Battle Command Show
#==============================================================================
# ** 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
Expand to see the code.


@Ryuzaki
Your script will be there soon!

Take care!
-Dargor
Can't wait to see a giant monster get KOd by a small child eating it lol
Here it is.
Devour Battle Command Show
#==============================================================================
# ** 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
Expand to see the code.


Hope you like it!
-Dargor
Thanks Dargor.
Thank you so much!
That was also pretty fast and it works great!
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...
wsensor wrote:
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. 😆

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