질문과 답변

Extra Form

말 그대롭니다.

 

파티원 따라다니기 스크립트가

 

처음 진행할때는 괜찮게 돌아가다가

 

전투를 하면 바로 케릭터들이 사라집니다.

 

왜그런건가요?

 

  # MAX_SIZE is the max size of the followers.
  # CATERPILLAR is the switch to turn on or off followers. The default is 2
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  MAX_SIZE = 8
  CATERPILLAR = 2

class Game_Player
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_down(turn_enabled = true)   
    super(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_left(turn_enabled = true)
    super(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_right(turn_enabled = true)
    super(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move up
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_up(turn_enabled = true)
    super(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Lower Left
  #--------------------------------------------------------------------------
  def move_lower_left
    super
  end
  #--------------------------------------------------------------------------
  # * Move Lower Right
  #--------------------------------------------------------------------------
  def move_lower_right
    super
  end
  #--------------------------------------------------------------------------
  # * Move Upper Left
  #--------------------------------------------------------------------------
  def move_upper_left
    super
  end
  #--------------------------------------------------------------------------
  # * Move Upper Right
  #--------------------------------------------------------------------------
  def move_upper_right
    super
  end
end

class Game_Follower < Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :actor
  attr_accessor :move_speed
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor)
    super()
    @through = true
    @actor = actor
  end
  #--------------------------------------------------------------------------
  # * Set Actor
  #--------------------------------------------------------------------------
  def actor=(actor)
    @actor = actor
    setup
  end
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup
    if @actor != nil     
      @character_name = $game_actors[@actor].character_name
      @character_index = $game_actors[@actor].character_index
    else
      @character_name = ""
      @character_index = 0
    end
    @opacity = 255
    @blend_type = 0
    @priority_type = 0
  end
 
  #--------------------------------------------------------------------------
  # * Screen Z
  #--------------------------------------------------------------------------
  def screen_z
    if $game_player.x == @x and $game_player.y == @y
      return $game_player.screen_z - 1
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Same Position Starting Determinant (Disabled)
  #--------------------------------------------------------------------------
  def check_event_trigger_here(triggers)
    result = false
    return result
  end
  #--------------------------------------------------------------------------
  # * Front Envent Starting Determinant (Disabled)
  #--------------------------------------------------------------------------
  def check_event_trigger_there(triggers)
    result = false
    return result
  end
  #--------------------------------------------------------------------------
  # * Touch Event Starting Determinant (Disabled)
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    result = false
    return result
  end
end

class Spriteset_Map
  alias_method :spriteset_map_create_characters, :create_characters
  def create_characters
    spriteset_map_create_characters
    $game_party.followers.each do |char|
      @character_sprites << Sprite_Character.new(@viewport1, char)
    end
  end
end

class Game_Party

  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :followers
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_party_initialize, :initialize
  def initialize
    trick_caterpillar_party_initialize
    @followers = Array.new(MAX_SIZE - 1) {Game_Follower.new(nil)}
    @move_list = []
  end
  #--------------------------------------------------------------------------
  # * Update Followers
  #--------------------------------------------------------------------------
  def update_followers
    flag = $game_player.transparent || $game_switches[CATERPILLAR]
    @followers.each_with_index do |char, i|
      char.actor = @actors[i + 1]
      char.move_speed = $game_player.move_speed
      if $game_player.dash?
        char.move_speed += 1
      end
      char.update
      char.transparent = flag
    end
  end
  #--------------------------------------------------------------------------
  # * Move To Party
  #--------------------------------------------------------------------------
  def moveto_party(x, y)
    @followers.each {|char| char.moveto(x, y)}
    @move_list.clear
  end
  #--------------------------------------------------------------------------
  # * Move Party
  #--------------------------------------------------------------------------
  def move_party
    @move_list.each_index do |i|
      if @followers[i] == nil
        @move_list[i...@move_list.size] = nil
        next
      end
      case @move_list[i].type
      when 2
        @followers[i].move_down(*@move_list[i].args)
      when 4
        @followers[i].move_left(*@move_list[i].args)
      when 6
        @followers[i].move_right(*@move_list[i].args)
      when 8
        @followers[i].move_up(*@move_list[i].args)
      when j
        @followers[i].move_lower_left
      when 3
        @followers[i].move_lower_right
      when 7
        @followers[i].move_upper_left
      when 9
        @followers[i].move_upper_right
      when 5
        @followers[i].jump(*@move_list[i].args)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Add Move List
  #--------------------------------------------------------------------------
  def update_move(type, *args)
    move_party
    @move_list.unshift(Game_MoveListElement.new(type, args))
  end
end

class Game_MoveListElement
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(type, args)
    @type = type
    @args = args
  end
  #--------------------------------------------------------------------------
  # * Type
  #--------------------------------------------------------------------------
  def type
    return @type
  end
  #--------------------------------------------------------------------------
  # * Args
  #--------------------------------------------------------------------------
  def args
    return @args
  end
end

class Game_Player
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :move_speed
 
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_update, :update
  def update
    $game_party.update_followers
    trick_caterpillar_player_update
  end
  #--------------------------------------------------------------------------
  # * Moveto
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_moveto, :moveto
  def moveto(x, y)
    $game_party.moveto_party(x, y)
    trick_caterpillar_player_moveto(x, y)
  end
  #--------------------------------------------------------------------------
  # * Move Down
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_down, :move_down
  def move_down(turn_enabled = true)
    if passable?(@x, @y+1)
      $game_party.update_move(2, turn_enabled)
    end   
    trick_caterpillar_player_move_down(turn_enabled)   
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_left, :move_left
  def move_left(turn_enabled = true)
    if passable?(@x-1, @y)
      $game_party.update_move(4, turn_enabled)
    end
    trick_caterpillar_player_move_left(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_right, :move_right
  def move_right(turn_enabled = true)
    if passable?(@x+1, @y)
      $game_party.update_move(6, turn_enabled)
    end
    trick_caterpillar_player_move_right(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Up
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_up, :move_up
  def move_up(turn_enabled = true)
    if passable?(@x, @y-1)
      $game_party.update_move(8, turn_enabled)
    end
    trick_caterpillar_player_move_up(turn_enabled)
  end
  #--------------------------------------------------------------------------
  # * Move Lower Left
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_lower_left, :move_lower_left
  def move_lower_left
    if passable?(@x - 1, @y) and passable?(@x, @y + 1)
      $game_party.update_move(1)
    end
    trick_caterpillar_player_move_lower_left
  end
  #--------------------------------------------------------------------------
  # * Move Lower Right
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_lower_right, :move_lower_right
  def move_lower_right
    if passable?(@x + 1, @y) and passable?(@x, @y + 1)
      $game_party.update_move(3)
    end
    trick_caterpillar_player_move_lower_right
  end
  #--------------------------------------------------------------------------
  # * Move Upper Left
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_upper_left, :move_upper_left
  def move_upper_left
    if passable?(@x - 1, @y) and passable?(@x, @y - 1)
      $game_party.update_move(7)
    end
    trick_caterpillar_player_move_upper_left
  end
  #--------------------------------------------------------------------------
  # * Move Upper Right
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_move_upper_right, :move_upper_right
  def move_upper_right
    if passable?(@x + 1, @y) and passable?(@x, @y - 1)
      $game_party.update_move(9)
    end
    trick_caterpillar_player_move_upper_right
  end
  #--------------------------------------------------------------------------
  # * Jump
  #--------------------------------------------------------------------------
  alias_method :trick_caterpillar_player_jump, :jump
  def jump(x_plus, y_plus)
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
      $game_party.update_move(5, x_plus, y_plus)
    end
    trick_caterpillar_player_jump(x_plus, y_plus)
  end
end

 

참고로 아방스님이 강좌 만드신 스크립트를 사용중입니다.

Comment '9'
  • profile
    Crack-er 2012.02.18 11:23

    스크립트 자체에 오류는 없었음. 다른스크립트 쓰시면 그거랑 충돌한걸수도 있슴다

    8방향이동같은 이동관련 스크립트 삭제해보시고 해보세여

  • ?
    네이피어 2012.02.18 11:59

    쪽지 넣어드렸습니다.

     

    이동관련 스크립트는 안쓰고

    타이틀/시야 효과 스크립트 쓰는데

    두개다 없애고 해봐도 전투후 파티원들이 없어지네요.

  • profile
    Crack-er 2012.02.18 13:40

    혹시 캐릭터 칩의 크기가 기본 VX사양과 다른가요?

    만약 그러시다면 기본 칩을 써서 해 보시고 그래도 안되신다면 프로젝트를 하나 더 만들어서

    스크립트만 추가해서 해 보세요

  • ?
    네이피어 2012.02.18 22:26

    칩의 크기와 기본사양이 같도록 했습니다.

    개개인 따로따로 그래픽 설정도 해보고요

    엑터 파일 이름으로 덮어씌우기 저장도 해보고

    다 안되네요.

     

    케릭터를 다른 그래픽으로 바꾸면 안되는 스크립트인가요,,,?

  • ?
    네이피어 2012.02.18 22:28

    다른 프로젝트에서 실험해 본 결과 이상 없었습니다.

    심지어 제가 원하는 그래픽을 입혀도 상관 없었습니다.

     

    그럼 문제는 다른 스크립트와 충돌이란 거.. 맞나요..?

     

    근데 제가 사용하는 스크립트는 타이틀과 메뉴화면일 뿐인데요..

  • ?
    네이피어 2012.02.18 23:15

    아아 스위칭 2번을 만지면 안되는 거였군요 .

     

    해결됫습니다.

     

    휴우... ;ㅅ;

  • ?
    훈군 2012.02.18 11:29

    전투를 마치고 다들 뿌듯한 마음으로 집으로 돌아간겁니다......


    ....죄송합니다.

    개드립한번 쳐보고 싶었습니다.

  • profile
    쿠쿠밥솥 2012.02.18 23:13

    스위치 2번 항상 켜놓으셨나요?.?

  • ?
    네이피어 2012.02.19 00:32

    2번스위치를 키면 안되고

    항상 꺼눠야 한느군요.

    몰랐습니다.

    그래서 이틀을 해매서.. ㅠ


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12441
이벤트 작성 RMMV 이미지 범위내 선택시 이벤트 발생 8 file 율무보리삼김 2021.09.05 83
기본툴 사용법 RMMV 텍스트 이벤트에 적의 이름을 띄우는 치환문자도 있나요? 5 PPPL 2020.04.13 83
RMMV 상호작용키를 누르면 이벤트가 빨리 진행되는 것을 해제하는 방법 질문 Generator 2016.12.03 83
RMVX 이벤트 스위치 질문 드립니다 2 후라이팬샷 2017.02.14 83
RMVXA 이벤트 실행 전투 실행 이안됌요 3 오오오오하군 2016.08.02 83
RMMV galv massage busts 질문 1 file 잠행인 2017.01.26 83
RMMV 타일 리소스한계치를 늘리고싶습니다. 독재자헤르모드 2017.04.22 83
에러 해결 RMVXA 번역작업중 게임 특수문자가 깨져서 나옵니다. 1 file 므아앙 2020.12.11 83
RMVXA Scene1-Menu 스크립트가 날라갔습니다 ㅠㅠ 2 하루0117 2018.07.08 83
RMVXA VXA전투시 화면 상단에뜨는 문자의 한글화에 대해 알고싶습니다. 1 file st게카 2018.11.12 83
이벤트 작성 RMMV 타이머 이벤트 시 키가 안먹힘 2 file 매지션k 2019.02.09 83
턴제 전투 RMXP 명중률 회피 적용이 어떻게 해도 안되요. 라엔 2019.05.30 83
기본툴 사용법 RMMV 이전에 사용하던 게임 제작소스들을 그대로 다음 게임에 만들고 싶습니다. 1 PPPL 2020.03.31 83
스크립트 작성 RMMV 아이템창 항목 제거 방법 요호 2023.01.08 83
기타 RMMV 등장인물 그림 말풍선 뒤로 가게 어떻게 하나요 1 file 김희리 2024.04.21 83
기본툴 사용법 RMMV MV 맵타일 배치 후 테스트플레이에서 안보이는 현상 4 file 머리큰두두 2023.06.28 83
에러 해결 RMMV 캐릭터가 걸을 때 옆으로 한 픽셀씩 늘어납니다 3 file 조각0 2023.05.10 83
기타 사이트 이용 포럼에 리소스 관련 글인데... 4 무명시절 2019.01.26 84
RMVXA 타일이 깨집니다 ㅜㅜ 1 file 베네수엘라 2018.05.12 84
RMXP XP!!액터선택창 넘어가기 늄늉이 2018.06.26 84
Board Pagination Prev 1 ... 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ... 516 Next
/ 516