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.

Attaching a skill to a battle command in RPG Advocate script

In this script, how can I attach a skill to a battle command?
The site doesn't explain how to create new commands that links to a skill, making that skill usable by clicking on the command.

Is there someone who can help me, please?
 
It is a bit harder to pull off since you can't use skills the actor doesn't know

But you can do this (Bear with me I haven't touched that script in ages > 1 year)

Add this when statement and change (skill) to the skill you want to use
Code:
when 'Command Name'
  # Play decision SE
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 1 #Use skill
  @active_battler.current_action.skill_id = (skill)
  @active_battler.current_action.special = true
  phase3_next_actor

add this in a new script above main
Code:
class Game_BattleAction
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :special
  #--------------------------------------------------------------------------
  # * Clears an action
  #--------------------------------------------------------------------------
  alias commands_clear clear
  def clear
    @special = nil
    commands_clear
  end
end

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Skill Can Use?
  #--------------------------------------------------------------------------
  alias command_skill_can_use? skill_can_use?
  def skill_can_use?(skill_id)
    # Get Flag
    flag = command_skill_can_use?(skill_id)
    # If in Scene_Battle
    if $scene.is_a?(Scene_Battle)
      # If the Skill Id Parameter equals the skill id sent
      flag |= self.current_action.special
    end
    return flag
  end
end

Untested but It should work

Also on another note I do have my own individual battle commands script and the skill linked to a command feature is already implemented
 
Your script have more features then this I'm using, but it requires the SDK (not compatible with most of the scripts I'm using). I'd really like to use yours but I can't...

Anyway, the script you gave me works, but it misses something: I'm not able to choose the target for that skill.
But that doesn't matter. A really big THANK YOU to you Trickster!
 
*Points to SDK Conversion Request Topic*
(Are you sure all of your scripts are below SDK?)

Yes depending upon the scope of the skill you may need to call start_actor_select or start_enemy_select instead of phase3_next_actor forgot to mention that
 

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