질문과 답변

Extra Form

vampyr sbabs 액알 스크립트 사용 중인데요
 

주인공 캐릭터나 적 캐릭터의 공격이 미스가 되었을 때도 공격 애니메이션이 나타나서 약간 이질감을 주더라고요

 

그래서 공격이 미스가 되었을 때만 애니메이션 효과가 나타나지 않도록 조정해주고 싶은데 어떻게 해야 하나요?

 

 

-----------------------------------------------------------------------------------------------------

저번에 한 번 물었던 질문인데

 

액알 스크립트의 정확한 이름을 적어야 한다고 하셔서 다시 올립니다...

Comment '2'
  • profile
    습작 2012.06.24 13:30

    0.

     

      Vampyr SBABS 시리즈는 여러 버전이 있으며 버전마다 스크립트 코드가 서로 상이합니다. 때문에 확실히 어떤 것인지는 알 수 없으나 일단 회원분들께서 가장 많이 사용할 9버전을 기준으로 설멍하겠습니다.


      해당 문제는 기본 기능상에서는 지원하지 않는 기능입니다. 때문에 스크립트를 수정해야 하며, 이를 위해서는 스크립트적 지식이 필요합니다.


      우선 문제는 캐릭터의 머리 위에 애니메이션을 띄우는 것이 그 이후 데미지나 상태문구를 띄우는 effect 판정보다 앞서기 때문입니다. 먼저 Game_Player, Game_Ally, Game_Event, Game_Monster 클래스에서 각종 공격에 관련해서 작동시 애니메이션 id를 부여하고, 그 다음에  Game_Battler 클래스의 attack_effect함수나 skill_effect함수에서 skipped, missed, evaded, damage 판정이 따르는 것이지요.


      Game_Player 클래스에서 일반공격을 작동시키는 부분을 잠깐 살펴보면 위에서 설명한 내용을 확인할수 있을 겁니다.


      def normal_attack_right

        for monster in $game_monsters.compact

          next unless in_front?(self, monster)

          next if monster.actor.dead?

          next if monster.flying and !jumping?

          monster.animation_id = self.actor.atk_animation_id # 애니메이션 표시

          hit_count

          monster.actor.attack_effect(self.actor) # 공격 유효 판정. Game_Battler 클래스의 attack_effect로 이동

          monster.jump(0,0)

          monster.target = self

        end

        for event in $game_map.events.values

          next unless event.in_battle

          next unless in_front?(self, event)

          next if event.actor.dead? or event.object

          next if event.flying and !jumping?

          event.animation_id = self.actor.atk_animation_id # 애니메이션 표시

          return if event.kill_with_weapon > 0 and event.kill_with_weapon != @attack_weapon.id or

          event.kill_with_skill > 0 or event.kill_with_item > 0

          hit_count

          event.actor.attack_effect(self.actor) # 공격 유효 판정. Game_Battler 클래스의 attack_effect로 이동

          event.jump(0,0) unless event.puzzle

          event.target = self

        end

      end


      판정을 앞으로 그리고 애니메이션 표시를 뒤로 순서를 바꾸고, 애니메이션 표시에 앞선 판정의 결과를 조건분기로 넣는 것입니다. Game_Player, Game_Ally, Game_Event, Game_Monster 클래스의 근거리, 원거리, 또는 스킬 사용 판정부분을 모두 고쳐주셔야 합니다. 더불어 Game_Battler 클래스에서도 attack_effect함수나 skill_effect함수의 결과값을 받을 수 있도록 해주셔야 겠습니다.


      def attack_effect(attacker)

        clear_action_results

        unless attack_effective?(attacker)

          @skipped = true

          @damage = $Vampyr_SBABS.damage_properties["Texts"][0]

          return false

        end

        if rand(100) >= calc_hit(attacker)

          @missed = true

          @damage = $Vampyr_SBABS.damage_properties["Texts"][0]

          return false

        end

        if rand(100) < calc_eva(attacker)

          @evaded = true

          @damage = $Vampyr_SBABS.damage_properties["Texts"][0]

          return false

        end

        make_attack_damage_value(attacker)

        execute_damage(attacker)

        return true if @hp_damage == 0

        apply_state_changes(attacker)

        return true

      end


      때문에 만약 위처럼 Game_Battler 클래스에서 결과값을 반환한다면...


      def normal_attack_right

        for monster in $game_monsters.compact

          next unless in_front?(self, monster)

          next if monster.actor.dead?

          next if monster.flying and !jumping?

          hit_count

          monster.animation_id = self.actor.atk_animation_id if monster.actor.attack_effect(self.actor)

          monster.jump(0,0)

          monster.target = self

        end

        for event in $game_map.events.values

          next unless event.in_battle

          next unless in_front?(self, event)

          next if event.actor.dead? or event.object

          next if event.flying and !jumping?

          return if event.kill_with_weapon > 0 and event.kill_with_weapon != @attack_weapon.id or

          event.kill_with_skill > 0 or event.kill_with_item > 0

          hit_count

          event.animation_id = self.actor.atk_animation_id if event.actor.attack_effect(self.actor)

          event.jump(0,0) unless event.puzzle

          event.target = self

        end

      end


      위와 같은 형태로도 가능하리라 생각합니다.


      본인이 사용하시는 ABS 버전과 다를 수 있으므로 코드를 잘 읽으신 다음 적절히 수정하시면 될 것 같습니다.^^


  • ?
    존스노우 2012.06.28 21:50
    답변 감사드립니다. 한 번 시도해 볼게요

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
RMVX vs로는 xp처럼 아오오니 같은거못만드나여? 2 크루즈 2011.02.06 708
RMVX vs 액터 / 다양한 크기 문 2 에스테반 2011.01.07 563
RMVX VS 맵칩 에서 집 말이에요.. 1 file 비호 2011.07.05 1029
RMVXA vocab을 수정해도 전투 도중의 대사가 바뀌지 않습니다 2 아브렐라 2014.08.18 715
RMVX Vlad의 Vampyr SBABS에서 몬스터에게 공격모션주는 방법 질문합니다. 2 신휴이 2011.07.21 1227
RMVX VLAD ABS 시스템에 관한 질문. 다이나믹로동 2011.07.09 1172
RMVXA VL 고딕 폰트를 갑자기 찾을 수 없다고 하네요 5 보드카짱 2017.05.13 1738
RMVXA Victor 엔진을 활용한 animated battler 전투에서 반격 발동시에 전투가 멈추어버립니다. RAISON 2014.11.04 333
RMVXA Victor 스크립트의 Animated battle 관련 오류 3 file 미양 2013.02.12 578
RMVXA Victor 스크립트 관련 오류 2 file 미양 2013.02.10 573
RMVXA Victor Script - Animated Battle 사용법 2 슈퍼메이저 2012.07.28 1287
RMVXA victor (빅터엔진)스크립트를 이용한 게임이나 예제파일이 있나요 ? 은은색색 2014.02.14 627
RMVX vampyr sbabs에서 공격 미스 났을 때 애니메이션 효과 없애기 2 존스노우 2012.06.20 941
RMVX Vampyr SBABS9에서 캐릭터 크기에 대한 힛포인트에 대해 질문합니다. 2 신휴이 2011.08.25 1514
RMVX Vampyr SBABS9 관련 질문 2 grassmoon 2011.08.18 932
RMVX vampyr SBABS-Requiem ABS 9버전 오류.. 다시올립니다. 3 이런게상세 2011.10.12 2291
RMVX vampyr SBABS-Requiem ABS 9 질문드립니다 6 9219jin 2011.09.24 1236
RMVX vampyr SBABS-Requiem ABS 9 이벤트오류 3 file 이런게상세 2011.10.03 1790
RMVX vampyr SBABS-Requiem ABS 9 에러질문 4 Jung48 2012.05.25 1907
RMVX vampyr SBABS-Requiem ABS 9 변수의조작 오류,, 2 file 이런게상세 2011.10.05 1581
Board Pagination Prev 1 ... 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 ... 516 Next
/ 516