CANUSE (actor command)

● ARCHIVED · READ-ONLY
Started by deilin 3 posts View original ↗
  1. This script enables ATTACK, GUARD and ITEM actor commands in battle based on actor id. you can disable lines and functions as you need.

    WHY?

    In my games, basic attacks are a free SKILL attacks.

    in one of my games, an untrained character wouldn't know how to gurd effectively enough to do so.

    In my current game, only one person can use items since they are the only one that can hold them in their "bag", disallowing other to use them.

    Code:
    #------------------------#CANUSE commands#Modifies what actor commands appear in battle based on#by DeiLin#------------------------module CANUSE  #leaving [] below will disallow all actors  CANATTACK = [] #actor ids that can use attack command  CANGUARD = [] #actor ids that can use guard command  CANITEM = [] #actor ids that can use item command  #Skill isn't included since it's based on RPG Maker VX ACE traitsend#------------------------#Don't modify below unless you know what you are doing.#------------------------class Game_Actor < Game_Battler  attr_reader   :actor_idendclass Window_ActorCommand < Window_Command  attr_reader   :actor  attr_reader   :actor_id  def make_command_list    return unless @actor    add_attack_command if CANUSE::CANATTACK.include?(actor.actor_id)   add_skill_commandsadd_guard_command if CANUSE::CANGUARD.include?(actor.actor_id)    add_item_command if CANUSE::CANITEM.include?(actor.actor_id)  endend
  2. Gah. Will fix display when home.
  3. Code fixed
    Ruby:
    #------------------------
    #CANUSE commands
    #Modifies what actor commands appear in battle based on
    #by DeiLin
    #------------------------
    module CANUSE
        #leaving [] below will disallow all actors
        CANATTACK = []
        #actor ids that can use attack command
        CANGUARD = []
        #actor ids that can use guard command
        CANITEM = []
        #actor ids that can use item command
        #Skill isn't included since it's based on RPG Maker VX ACE traits
    end
    #------------------------
    #Don't modify below unless you know what you are doing.
    #------------------------
    class Game_Actor < Game_Battler
        attr_reader   :actor_id
    end
    
    class Window_ActorCommand < Window_Command
        attr_reader   :actor
        attr_reader   :actor_id
        def make_command_list
            return unless @actor
            add_attack_command if CANUSE::CANATTACK.include?(actor.actor_id)
            add_skill_commands
            add_guard_command if CANUSE::CANGUARD.include?(actor.actor_id)
            add_item_command if CANUSE::CANITEM.include?(actor.actor_id)
        end
    end
    Well that was a silly mistake, but I corrected my error.