Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> A certain script is only 'half functioning', Battle-related
Spaz Bunny
post Nov 21 2011, 05:07 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 128
Type: Developer
RM Skill: Skilled




I'm using this script: http://www.rpgrevolution.com/forums/index....showtopic=18535

The 2.0 version, to be exact, alongside the RPG Tankentai SBS + ATB, and the script only seems to be half working. It WILL grey out the battle commands, but the battle commands will still be selectable and usable even though I'm trying to disable them, and I saw this thread here: http://www.rpgmakervx.net/index.php?showtopic=40144 of a person using the exact same script, and same battle system to success. I figited around with the position of the Command Disabling script on the list, whether it be above or below certain battle system things, but I didn't move the SBS or ATB scripts.

PLEASE help. This is taking way too much of my time and I want to figure this out.


__________________________

A diverse adventure game that will test your emotions.

Please support the development of Gladius by visiting and leaving feedback!
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies (1 - 2)
Night_Runner
post Nov 22 2011, 04:00 PM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,529
Type: Scripter
RM Skill: Undisclosed




I'm assuming that you're using this version of the Tankentai smile.gif

Anyway, I've edited Jens009's code, just inserting their buzzer into the Tankentai's processing, so it works fine smile.gif
Just make sure that this code is after the SBS
Code
CODE
#============================================
# Deactivate Battle Commands
# By Jens009
# Version: 2.0
# Release Date: August 5, 2008
# Description: Deactivate Battle Commands Using a Script Switch
# Log:
#   - Major Change in Coding
#     Instead of deleting the actual command, it just blackens it and plays
#     buzzer when selected
# How to use:
#   Use a call script.
#     Deactivating, attack, skill, guard or item:
#       $game_troop.no_attack = true/false
#       $game_troop.no_skill = true/false
#       $game_troop.no_guard = true/false
#       $game_troop.no_item = true/false
#       $game_troop.no_attack = true/false
#  Setting it to true disables the battle command
# Author\'s Notes:
#   2 methods aliased.
#     jens009_command_deactivate_initialize initialize
#     jens009_deactivate_commands_setup setup
#   1 method directly edited
#     update_actor_command_selection
#================================================

#===================================================
# Start Game_Troop Edit
# Add Global Instances
#==================================================
class Game_Troop < Game_Unit
  attr_accessor :no_attack
  attr_accessor :no_skill
  attr_accessor :no_guard
  attr_accessor :no_item

  alias jens009_command_deactivate_initialize initialize
  
  def initialize
    @no_attack = false
    @no_skill = false
    @no_guard = false
    @no_item = false
    jens009_command_deactivate_initialize
  end
end



#==============================================
# End Game_Troop Edit
# Start Window_Actor_Command Edit
#===============================================
class Window_ActorCommand < Window_Command
    alias jens009_deactivate_commands_setup setup
  # Modify Setup
    def setup(actor)
      jens009_deactivate_commands_setup(actor)
       draw_item(0, false) if $game_troop.no_attack # Deactive attack
       draw_item(1, false) if $game_troop.no_skill  # Deactive skill
       draw_item(2, false) if $game_troop.no_guard  # Deactive guard
       draw_item(3, false) if $game_troop.no_item   # Deactive item
    end # End method
  
end # END CLASS
#============================================
# End Window_ActorCommand Edit
#===========================================
#====================================
# Start Scene_Battle edit
#  Method Edited: update_actor_command_selection
#     Play buzzer when deactivated.
#====================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● コマンド更新  ※再定義
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    return reset_command unless commanding?
    if Input.trigger?(Input::B)
      Input.update
      Sound.play_decision
      start_party_command
    elsif Input.trigger?(Input::C)
      Input.update
      case @actor_command_window.index
      when 0  # Attack
        return Sound.play_buzzer if $game_troop.no_attack
        Sound.play_decision
        @commander.action.set_attack
        start_target_enemy_selection
      when 1  # Skill
        return Sound.play_buzzer if $game_troop.no_skill
        Sound.play_decision
        $in_select = true
        start_skill_selection
      when 2  # Guard
        return Sound.play_buzzer if $game_troop.no_guard
        Sound.play_decision
        @commander.action.set_guard
        end_command
      when 3  # Item
        return Sound.play_buzzer if $game_troop.no_item
        Sound.play_decision
        $in_select = true
        start_item_selection
      end
    # →キーでコマンドキャラ送り
    elsif Input.trigger?(Input::RIGHT)
      next_commander
    # ←キーでコマンドキャラ戻し
    elsif Input.trigger?(Input::LEFT)
      back_commander
    end
  end
end # END CLASS


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Spaz Bunny
post Nov 22 2011, 04:29 PM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 128
Type: Developer
RM Skill: Skilled




Absolutely fantastic. Works perfectly, but... I need the same thing done with the 'No Run' command, also. I hope you don't find it too much to ask that I want the 'no run addon' script done this way, too :S I tried to see if I could do it myself but it failed. Don't worry, I didn't mess anything up permanently. I made sure to re-copy and paste this script back. The script you just made worked perfectly, but I just need to get the 'no run' version to work, too. Sorry >.<


__________________________

A diverse adventure game that will test your emotions.

Please support the development of Gladius by visiting and leaving feedback!
Go to the top of the page
 
+Quote Post
   

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

 

Lo-Fi Version Time is now: 19th June 2013 - 02:19 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker