collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Kampfmenü individualisieren  (Gelesen 849 mal)

Offline Eddyle

  • RTP-Mapper
  • *
  • Beiträge: 28
Kampfmenü individualisieren
« am: Februar 23, 2011, 19:51:06 »
Ich sitze momentan an etwas dran, aber weiß noch nicht ob es etwas ernsthaftes wird oder ich es doch irgendwann verwerfe...

Jedenfalls ist mir die Idee zu einem individualisierten Kampfmenü gekommen und so wie ich das sehe nur Skripttechnisch zu lösen ist.
Ich habe mir gedacht, dass es toll wäre, wenn jeder Charakter eine andere Auswahl im Menü bekommt.

Sprich:
Held 1 hat die Auswahl
- Angriff
- Stehlen
- Technik
- Item

Held 2 hat die Auswahl

- Angriff
- Zauber
- Abwehr

Held 3 hat die Auswahl

- Heilung
- Buff
- Abwehr
- Item

Ich hab mir auch Gedanken darüber gemacht, um so ein Script allgemein Benutzerfreundlich zu gestalten. Es sollte dabei auf die Datenbank IDs zurückgreifen. (Entschuldigt falls ich Scriptbefehle falsch auffasse, ich hab wenig ahnung davon  :zwinker:)
Das heißt wenn ich im Script z.B. Actor() die ID 001 zuweise, also im Script dann Actor(001), dem Charakter in der Datenbank auf Position 001 nachfolgende Kampfbefehle zu Ordne.

Mit den Kampfbefehlen selber könnte es genau so aussehen. Held 1 besitzt den Kampfbefehl "Stehlen" welcher ja eigentlich eine Technik is die man in der Datenbank erstellt hat. Soll also ohne Umweg über die Technikenliste, die Technik "Stehlen" einsetzen. Genau so wie beim dritten Charakter, dann das Kommando "Heilung".

Müsste man dann im Skript im Fall von Actor(001) in der zweiten Zeile der Kommandos die Vokabel "Stehlen" eingeben und darauf verweisen, das es auf die Technik ID 001: Stehlen in der Datenbank zurückgreift und diese ausführt, wenn es im Kampf ausgewählt worden ist.
Beim dritten Helden genauso zu verfahren mit "Heilung" -> Datenbank Technik ID 002: Heilung.

Held 1 besitzt das Kommando Technik. Held 2 besitzt das Kommando Zauber. Held 3 besitzt das Kommando Buff. Haben aber eigentlich alle 3 den selben effekt, dass sie einfach das Technikenmenü des jeweiligen Charakter aufrufen.

Natürlich soll diese ganze Aufführung nur als Beispiel gelten. Im fertigen Skript sollte jeder, der es nutzen will, seinen Charakteren, seien es 3, 4 oder 16 an der Zahl, selber einstellen können, welche kommandos diese besitzen. Für den Endbenutzer also durch simples copy&paste und Actor ID, ActorCommand S1 = Vocab::(Technikname);(Technik ID) des selben Skripts weiter ausbaubar sein.

Ich hoffe ich habs genau genug erklären können ohne, dass nem Skripter davon schwindlig wird. :faint:
Bin dankbar für jeden der sich an sowas dranhockt und es versucht. ^^

Re: Kampfmenü individualisieren

Offline FlipelyFlip

  • Will sein Alter nicht verraten xD
  • Administrator
  • VX-Großmeister
  • ****
  • Beiträge: 884
  • Heyho (=
    • Flips Musik Kariere auf Facebook xD
Re: Kampfmenü individualisieren
« Antwort #1 am: Februar 23, 2011, 20:28:34 »
ist sogar möglich und es existiert auch so ein script ;)

ist von Yanfly und nennt sich CustomBattleCommand (=

Spoiler for Hiden:
#===============================================================================
#
# Yanfly Engine RD - Custom Battle Actions
# Last Date Updated: 2009.06.25
# Level: Normal
#
# For those who would like to have more than just Attack, Skill, Guard, and
# Item for their actions in their list, this script allows just that. You can
# rearrange the ordering of the actions, bind new custom actions to skills,
# and even incorporate subskill actions into the individual command lists.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.06.25 - Bug fix for enemy targetting cancel selection.
# o 2009.06.23 - Compatibility update with Custom Skill Effects Upgrade 3.
# o 2009.06.21 - Bug fix for ally targetting custom skill cancel.
# o 2009.05.28 - Started script and finished.
#===============================================================================
# Instructions
#===============================================================================
#
# Scroll down below and modify the module to reflect how you would like the
# battle commands to appear for each class-type.
#
#===============================================================================
#
# Compatibility
# - Works With: Yanfly Custom Skill Effects
# - Alias: Game_Actor: skill_can_use?
# - Overwrites: Scene_Battle, execute_action_wait, update_actor_command
# - Overwrites: Window_ActorCommand: all of it
#
#===============================================================================

$imported = {} if $imported == nil
$imported["CustomBattleActions"] = true

module YE
  module BATTLE
    module COMMANDS
     
      #------------------------------------------------------------------------
      # CLASS COMMANDS
      #------------------------------------------------------------------------
      # This following section will adjust commands for individual classes. If
      # a class ID is not included, it will take out the commands from class 0.
      # With that said, do not remove class 0.
      #
      # There are a few commands verbal commands reserved for the command hash.
      #    "-Attack"   - Reserved for basic attacking.
      #    "-Skill"    - Reserved for selecting skills.
      #    "-Guard"    - Reserved for guarding.
      #    "-Item"     - Reserved for using items.
      #    "-Wait"     - Reserved for the wait command.
      #    "-Subclass" - Reserved for subclass skills.
      #    ""          - If empty, skip it.
      #
      # If you input other commands, be sure to spell them correctly as they
      # will reflect upon how it appears in game.
      #------------------------------------------------------------------------
      # Note that class commands will be determined by the character's primary
      # class if you're using the Subclass Selection System.
      #------------------------------------------------------------------------
      CLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO!
      # ClassID => [ Actions, Actions, Actions...]
              0 => ["-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
              #1 => ["X-Attack", "-Skill", "-Subclass", "-Guard", "-Item"],
      } # Do not remove this.
     
      # This following hash will determine what commands to replace when the
      # "-Subclass" command is inputted into the array of commands. If the
      # subclass's ID does not appear in this array, then it will return 0.
      SUBCLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO!
      # ClassID => Name
              0 => "",
              2 => "X-Attack",
              5 => "Light",
              6 => "Darkness",
              7 => "3-Attack",
      } # Do not remove this.
     
      # The following hash allows you to adjust which custom commands to bind
      # to which skills for the actions to come out of. The custom actions will
      # still consume HP/MP/Rage. If it's unusable, then it'll be greyed out.
      CUSTOM_COMMANDS ={ # Follow the example.
      # -Command Name- => Skill.ID
            "X-Attack" => 1,
            "3-Attack" => 3,
               "Light" => 78,
            "Darkness" => 80,
      } # Do not remove this.
     
      # For those who use "-Wait" and would like to change how Wait appears,
      # adjust the value below. Also following is how the action takes place.
      WAIT_VOCAB  = "Wait"
      ACTION_WAIT = "%s is waiting."    # Set to nil to not show wait.
     
    end # COMMANDS
   end # BATTLE
end # YE

#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================

module Vocab
  DoWait = YE::BATTLE::COMMANDS::ACTION_WAIT
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :custom_action_flag
 
  #--------------------------------------------------------------------------
  # alias skill_can_use?
  #--------------------------------------------------------------------------
  alias skill_can_use_cba skill_can_use? unless $@
  def skill_can_use?(skill)
    if @custom_action_flag == true
      return super
    else
      return skill_can_use_cba(skill)
    end
  end
 
end

#===============================================================================
# Scene_Battle
#===============================================================================

class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias execute_action_wait
  #--------------------------------------------------------------------------
  alias execute_action_wait_cba execute_action_wait unless $@
  def execute_action_wait
    if Vocab::DoWait != nil
      execute_action_wait_cba
    end
  end
 
  #--------------------------------------------------------------------------
  # alias end_target_enemy_selection
  #--------------------------------------------------------------------------
  alias end_target_enemy_selection_cba end_target_enemy_selection unless $@
  def end_target_enemy_selection
    end_target_enemy_selection_cba
    if @skill_window == nil
      @actor_command_window.active = true
    end
  end
 
  #--------------------------------------------------------------------------
  # alias end_target_actor_selection
  #--------------------------------------------------------------------------
  alias end_target_actor_selection_cba end_target_actor_selection unless $@
  def end_target_actor_selection
    end_target_actor_selection_cba
    if @skill_window == nil
      @actor_command_window.active = true
    end
  end
 
  #--------------------------------------------------------------------------
  # alias update actor command selection
  #--------------------------------------------------------------------------
  alias update_actor_command_selection_cba update_actor_command_selection unless $@
  def update_actor_command_selection
    if Input.trigger?(Input::C)
      if $imported["CustomSkillEffects"]
        @active_battler.reset_mix_items
        @active_battler.subskill_flag = nil
        @active_battler.set_chain
      end
      determine_actor_command
    else
      update_actor_command_selection_cba
    end
  end
 
  #--------------------------------------------------------------------------
  # new method determine actor command
  #--------------------------------------------------------------------------
  def determine_actor_command
    @active_battler.custom_action_flag = false
    command = @actor_command_window.command
    case command
    when "-Attack"
      Sound.play_decision
      @active_battler.action.set_attack
      start_target_enemy_selection
    when "-Skill"
      Sound.play_decision
      start_skill_selection
    when "-Guard"
      Sound.play_decision
      @active_battler.action.set_guard
      next_actor
    when "-Item"
      Sound.play_decision
      start_item_selection
    when "-Wait"
      Sound.play_decision
      @active_battler.action.kind = 0
      @active_battler.action.basic = 3
      next_actor
    else
      unless YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(command)
        Sound.play_buzzer
      else
        @active_battler.custom_action_flag = true
        @skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[command]]
        if @active_battler.skill_can_use?(@skill)
          Sound.play_decision
          if $imported["CustomSkillEffects"] and @skill.mix_items
            start_skill_selection
            create_mix_item_windows
          elsif $imported["CustomSkillEffects"] and @skill.subskills != []
            start_skill_selection
            create_subskill_windows
          elsif $imported["CustomSkillEffects"] and @skill.chain_type > 0
            start_skill_selection
            create_chain_windows
          elsif $imported["CustomSkillEffects"] and @skill.throw_skill
            start_skill_selection
            create_throw_windows
          else
            determine_custom_action
          end
        else
          Sound.play_buzzer
        end
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # determine_custom_action
  #--------------------------------------------------------------------------
  def determine_custom_action
    @active_battler.action.set_skill(@skill.id)
    if @skill.need_selection?
      if @skill.for_opponent?
        start_target_enemy_selection
      else
        start_target_actor_selection
      end
    else
      next_actor
    end
  end
 
end # Scene_Battle

#===============================================================================
# Window_ActorCommand
#===============================================================================

class Window_ActorCommand < Window_Selectable
 
  #--------------------------------------------------------------------------
  # overwrite initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 128, 128)
    self.active = false
  end
 
  #--------------------------------------------------------------------------
  # overwrite setup
  #--------------------------------------------------------------------------
  def setup(actor)
    @actor = actor
    @commands = []
    if YE::BATTLE::COMMANDS::CLASS_COMMANDS.include?(@actor.class.id)
      array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[@actor.class.id]
    else
      array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[0]
    end
    for command in array
      if command == "-Subclass"
        if subclass_check?
          command = YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS[@actor.subclass.id]
        else
          command = ""
        end
      end
      @commands.push(command) unless command == ""
    end
    @item_max = @commands.size
    refresh
    self.index = 0
  end
 
  #--------------------------------------------------------------------------
  # subclass check
  #--------------------------------------------------------------------------
  def subclass_check?
    return false unless $imported["SubclassSelectionSystem"]
    return false if @actor.subclass == nil
    sub_id = @actor.subclass_id
    return false if !YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS.include?(sub_id)
    return true
  end
 
  #--------------------------------------------------------------------------
  # overwrite refresh
  #--------------------------------------------------------------------------
  def refresh
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
 
  #--------------------------------------------------------------------------
  # return command
  #--------------------------------------------------------------------------
  def command
    return @commands[self.index]
  end
 
  #--------------------------------------------------------------------------
  # new method draw item
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    cmd = @commands[index]
    #---
    case cmd
    when "-Attack"
      text = Vocab::attack
    when "-Skill"
      if @actor.class.skill_name_valid
        text = @actor.class.skill_name
      else
        text = Vocab::skill
      end
    when "-Guard"
      text = Vocab::guard
    when "-Item"
      text = Vocab::item
    when "-Wait"
      text = YE::BATTLE::COMMANDS::WAIT_VOCAB
    else
      text = cmd
      if YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(cmd)
        skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[cmd]]
        @actor.custom_action_flag = true
        enabled = @actor.skill_can_use?(skill)
        @actor.custom_action_flag = false
      else
        enabled = false
      end
    end
    #---
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text)
  end
 
end # Window_ActorCommand

#===============================================================================
#
# END OF FILE
#
#===============================================================================
[/spiler]

Das Script ist eigentlich gut beschrieben, also benötigt es keine weitere erklärung eigentlich, jedoch steh ich gern für Fragen zur verfügung (=

lg flip

Re: Kampfmenü individualisieren

Offline Eddyle

  • RTP-Mapper
  • *
  • Beiträge: 28
Re: Kampfmenü individualisieren
« Antwort #2 am: Februar 23, 2011, 21:34:05 »
Wunderbar, genau das was ich brauch und funktioniert einwandfrei.
Nach nem bischen angucken, hab sogar ich verstanden wies funktionert.  :haha_zwinker:
Vielen Dank. ^^

 


 Bild des Monats

rooftop party

Views: 3615
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal