UltimaForum

Wsparcie [VX] - Bardzo Ważne xD

CreeperCrisis - Czw 14 Paź, 2010 20:47
Temat postu: Bardzo Ważne xD
Witajcie, mam problem z niedawno stworzonym skryptem:
Spoiler:

Kod:
#===============================================================================
#
# SEBASTIAN MINKOWSKI
#
# THE... I DON'T KNOW... DOBRA TO COŚ CZYMŚ JEST... xDDDDDDDDD
#
#===============================================================================

#===============================================================================
# TO COŚ... JAKIŚ MODUŁ...
#===============================================================================
  module Crisis
    NAZWA_UMIEJĘTNOŚCI = "Strzał"
    ID_UMIEJĘTNOŚCI = 108
  end

#===============================================================================
# TO COŚ... JAKAŚ DEFINICJA... (2)
#===============================================================================
  def setup(actor)
    case @actor_id
    when 1
      s1 = Vocab::attack
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid   
        s2 = actor.class.skill_name     
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0

    when 2
      s1 = Crisis::NAZWA_UMIEJĘTNOŚCI
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid     
        s2 = actor.class.skill_name   
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0
    end
  end

#===============================================================================
# TO COŚ... JAKAŚ DEFINICJA...
#===============================================================================
  def update_actor_command_selection
    case @actor_id
    when 1
      if Input.trigger?(Input::B)
        Sound.play_cancel
        prior_actor
      elsif Input.trigger?(Input::C)
        case @actor_command_window.index
        when 0  # Attack
          Sound.play_decision
          @active_battler.action.set_attack
          start_target_enemy_selection
        when 1  # Skill
          Sound.play_decision
          start_skill_selection
        when 2  # Guard
          Sound.play_decision
          @active_battler.action.set_guard
          next_actor
        when 3  # Item
          Sound.play_decision
          start_item_selection
    when 2
      if Input.trigger?(Input::B)
        Sound.play_cancel
        prior_actor
      elsif Input.trigger?(Input::C)
        case @actor_command_window.index
        when 0  # Attack
          Sound.play_decision
          @active_battler.action.set_skill(Crisis::ID_UMIEJĘTNOŚCI)
          start_target_enemy_selection
        when 1  # Skill
          Sound.play_decision
          start_skill_selection
        when 2  # Guard
          Sound.play_decision
          @active_battler.action.set_guard
          next_actor
        when 3  # Item
          Sound.play_decision
          start_item_selection
        end
      end
    end
  end
end
end


Chciałbym, aby dwóch bohaterów miało inne czynności podczas pojedynku. Najważniejszy mój bohater ma ID 2 i chciałbym, aby zamiast ataku używał umiejętność o ID 108. :-)

Ayene - Pią 15 Paź, 2010 09:38

Przede wszystkim tworzysz skrypt... masz z nim podstawowe problemy, a już etykietujesz go swoim imieniem ;-)

Podałeś definicje, ale nie przypisałeś ich odpowiednim klasom.
Kod:
def setup(actor)

powinno być zamknięte w klasie:
Kod:
class Window_ActorCommand < Window_Command

Z kolei
Kod:
def update_actor_command_selection

w klasie:
Kod:
class Scene_Battle < Scene_Base


Ponadto w klasach tych nie ma zadeklarowanej zmiennej:
Kod:
@actor_id


Skrypt zatem, jeśli ma być w takiej formie powinien wyglądać:
Spoiler:

Kod:
#===============================================================================
#
# SEBASTIAN MINKOWSKI
#
# THE... I DON'T KNOW... DOBRA TO COŚ CZYMŚ JEST... xDDDDDDDDD
#
#===============================================================================

#===============================================================================
# TO COŚ... JAKIŚ MODUŁ...
#===============================================================================
  module Crisis
    NAZWA_UMIEJĘTNOŚCI = "Strzał"
    ID_UMIEJĘTNOŚCI = 82
  end
#===============================================================================
# TO COŚ... JAKAŚ DEFINICJA... (2)
#===============================================================================
class Window_ActorCommand < Window_Command
  def setup(actor)
    case actor.id
    when 1
      s1 = Vocab::attack
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid   
        s2 = actor.class.skill_name     
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0
    when 2
      s1 = Crisis::NAZWA_UMIEJĘTNOŚCI
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid     
        s2 = actor.class.skill_name   
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0
    end
  end
end
#===============================================================================
# TO COŚ... JAKAŚ DEFINICJA...
#===============================================================================
class Scene_Battle < Scene_Base
  def update_actor_command_selection
    case @active_battler.id
    when 1
      if Input.trigger?(Input::B)
        Sound.play_cancel
        prior_actor
      elsif Input.trigger?(Input::C)
        case @actor_command_window.index
        when 0  # Attack
          Sound.play_decision
          @active_battler.action.set_attack
          start_target_enemy_selection
        when 1  # Skill
          Sound.play_decision
          start_skill_selection
        when 2  # Guard
          Sound.play_decision
          @active_battler.action.set_guard
          next_actor
        when 3  # Item
          Sound.play_decision
          start_item_selection
        end
      end     
    when 2
      if Input.trigger?(Input::B)
        Sound.play_cancel
        prior_actor
      elsif Input.trigger?(Input::C)
        case @actor_command_window.index
        when 0  # Attack
          Sound.play_decision
          @active_battler.action.set_skill(Crisis::ID_UMIEJĘTNOŚCI)
          start_target_enemy_selection
        when 1  # Skill
          Sound.play_decision
          start_skill_selection
        when 2  # Guard
          Sound.play_decision
          @active_battler.action.set_guard
          next_actor
        when 3  # Item
          Sound.play_decision
          start_item_selection
        end
      end
    end
  end
end


Namieszałeś ponadto z endami.

CreeperCrisis - Pią 15 Paź, 2010 13:18

Coś tu za bardzo nie wyszło ponieważ, gdy klikam przycisk potwierdzający każdą czynność, ona się nie uruchamia... :-?
Ayene - Pią 15 Paź, 2010 18:42

To jest tylko przerobiony Twój skrypt. Jeśli nie masz w drużynie bohatera o id 1 i 2 to nie będzie żadnych komend.
CreeperCrisis - Pią 15 Paź, 2010 18:47

Mam tych dwóch bohaterów w czasie walki i każdy ma inne czynności jak chciałem, chodź nie działają. :-?
CreeperCrisis - Wto 19 Paź, 2010 18:51

Ciąg problemów xDDDD Czekam i odświerzam. :-)
Ayene - Wto 19 Paź, 2010 18:56

Musisz coś źle robić albo jakiś skrypt Tobie blokuje. Najlepiej zhostuj projekt i wyślij mi linka na PW. Wtedy zobaczę.
Ayene - Pią 22 Paź, 2010 15:40

A czy bez tego skryptu, działa Tobie walka? Bo mi nie działa.
CreeperCrisis - Pią 22 Paź, 2010 17:09

Właśnie jest pewien problem, spróbuj usunąć skrypty ze skrótami [YEM], [COZ] oraz [WOR]
Mam nadzieję że zadziała.

Ayene - Pon 25 Paź, 2010 20:42

Wejdź w skrypt ATB 2 i znajdź:
Kod:
def update_actor_command_selection

zamień na:
Spoiler:

Kod:
  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 
        case @commander.id
        when 1
          Sound.play_decision
          @commander.action.set_attack
          start_target_enemy_selection
        when 2
          Sound.play_decision
          @commander.action.set_skill(Crisis::ID_UMIEJĘTNOŚCI)
          start_target_enemy_selection
        end
      when 1
        Sound.play_decision
        $in_select = true
        start_skill_selection
      when 2
        Sound.play_decision
        @commander.action.set_guard
        end_command
      when 3
        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


Swój skrypt zamień na:
Spoiler:

Kod:
#===============================================================================
#
# SEBASTIAN MINKOWSKI AND ZUZANNA HORACZUK
#
# THE... I DON'T KNOW... DOBRA TO COŚ CZYMŚ JEST... xDDDDDDDDD
#
#===============================================================================
module Crisis
  NAZWA_UMIEJĘTNOŚCI = "Strzał"
  ID_UMIEJĘTNOŚCI = 108
end
class Window_ActorCommand < Window_Command
  def setup(actor)
    case actor.id
    when 1
      s1 = Vocab::attack
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid   
        s2 = actor.class.skill_name     
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0
    when 2
      s1 = Crisis::NAZWA_UMIEJĘTNOŚCI
      s2 = Vocab::skill
      s3 = Vocab::guard
      s4 = Vocab::item
      if actor.class.skill_name_valid     
        s2 = actor.class.skill_name   
      end
      @commands = [s1, s2, s3, s4]
      @item_max = 4
      refresh
      self.index = 0
    end
  end
end



Powered by phpBB modified by Przemo © 2003 phpBB Group