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.

Need some help regarding ''Spell Weapons''

Ok, so in my game i have all sorts of weapons, but what's been troubling me, i just can't get ''Spell Weapons'' to work...
Spell weapons are weapons that give a pretty big boost to your Int and such (And gives access to some spells.), but disables the normal attack...

How can i disable the normal attack button if a spell weapon is equipped?
So, anyone knows how (If it's possible.) to do this?
 
Are you already using another script to grant additional spells when a weapon is equipped?

Code:
#--------------------------------------------------------------------------
# * Spell Weapons
#
#   Sets "Attack" to disabled if a spell weapon is equipped
#
#   Add all spell weapon IDs (from the database) to the SPELL_WEAPONS
#   array.
#
#--------------------------------------------------------------------------

class Scene_Battle
  
  SPELL_WEAPONS = [1,2,3]
  #--------------------------------------------------------------------------
  # * Actor Command Window Setup
  #--------------------------------------------------------------------------
  def phase3_setup_command_window
    # Disable party command window
    @party_command_window.active = false
    @party_command_window.visible = false
    # disable ATTACK is spell weapon equipped
    normal_color = Color.new(255, 255, 255, 255)
    if SPELL_WEAPONS.include? $game_party.actors[@actor_index].weapon_id
      @actor_command_window.disable_item(0)
    else
      @actor_command_window.draw_item(0, normal_color)
    end
    # Enable actor command window
    @actor_command_window.active = true
    @actor_command_window.visible = true
    # Set actor command window position
    @actor_command_window.x = @actor_index * 160
    # Set index to 0
    @actor_command_window.index = 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : basic command)
  #--------------------------------------------------------------------------
  def update_phase3_basic_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Go to command input for previous actor
      phase3_prior_actor
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by actor command window cursor position
      case @actor_command_window.index
      when 0  # attack
        if SPELL_WEAPONS.include? $game_party.actors[@actor_index].weapon_id
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
        # Start enemy selection
        start_enemy_select
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 1
        # Start skill selection
        start_skill_select
      when 2  # guard
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        # Go to command input for next actor
        phase3_next_actor
      when 3  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 2
        # Start item selection
        start_item_select
      end
      return
    end
  end
end
 
EDIT: Somehow it doesn't work with my current project... I have the Side view Battle system script in it by the way.

I was also wondering, is it possible that this can be done with common events and such?
 
1) You could have mentioned that up front. It would have saved me from wasting my time.
2) Test it in a new project with no other custom scripts. It works fine.
3) You didn't answer my question, "How are you granting spells when a spell weapon is equipped?"
4) There is no "THE Side View Battle System." There are many. Which one?
5) You could use common events to add the spell when the weapon is equipped. You have to use scripting to modify the battle menus.
6) Do you have any other custom scripts, or script edits beside your Side View battle?
 
1) You could have mentioned that up front. It would have saved me from wasting my time.
....Sorry?
2) Test it in a new project with no other custom scripts. It works fine.
Yes, it works fine as i said.
3) You didn't answer my question, "How are you granting spells when a spell weapon is equipped?"
Common Events.
4) There is no "THE Side View Battle System." There are many. Which one?
Rye.JP's Starterpack 0.6 ([url] [url=http://www.rmxp.org/forums/viewtopic.php?f=11&t=24608]viewtopic.php?f=11&t=24608[/url][/url])
5) You could use common events to add the spell when the weapon is equipped. You have to use scripting to modify the battle menus.
Ok.
6) Do you have any other custom scripts, or script edits beside your Side View battle?
Other than that, i have the caterpillar script. (Don't ask me wich version.)

Anymore information required?
 
Just a little statement, about your 1) ...Sorry? Brewmeister is saying that in this forum you have to include every little detail you can tell, as it will help us to help you faster and better. Now you didnt do this, so Brewmeister might actually have wasted his time. Other than that I cant help you, sorry.
 
I'm not offended, just saying there's no need to rub it in my face. ;)

It was a mistake, i didn't realize i needed more information to ask a ''Can it be done?'' question.

Now, can we move on the possible solutions? ^_^
 
Well I searched the forums for spell weapon script, and that was what it founded. Also, isn't that for XP? I thought so... Well, I think I can't do anything more for you, as I can't script :blush: .
 
Hmmm, I just tried this in Rye's demo, and it worked fine.

Paste the script right above main, and below all of Rye's scripts.

If it's still broke, you may have to send me a copy of your project to debug.
 

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